Java Doc for Settings.java in  » Web-Framework » struts-2.0.11 » org » apache » struts2 » config » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » struts 2.0.11 » org.apache.struts2.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.struts2.config.Settings

All known Subclasses:   org.apache.struts2.config.PropertiesSettings,  org.apache.struts2.config.TestSettings,  org.apache.struts2.config.DefaultSettings,  org.apache.struts2.config.DelegatingSettings,
Settings
class Settings (Code)
Settings retrieves and exposes default values used by the framework. An application can override a factory default and provide its own value for a setting.

Implementation of the class is pluggable (the default implementation is DefaultSettings ). Pluggability gives applications to ability to customize how settings are retrieved. As an example, an application may wish to check some custom property store before delegating to the usual configuration and property files.

Key methods:

Key methods for subclasses (plugins):



Field Summary
static  SettingsdefaultImpl
     An instance of DefaultSettings to use when another implementation is not provided (plugged in).
static  Localelocale
     An instance of the default locale as specified by the struts.locale setting.
static  SettingssettingsImpl
     A pluggable implementation of Settings, provided through the Settings.setInstance method.


Method Summary
public static  Stringget(String name)
     Provides a setting value as a String.

The method will throw an IllegalArgumentException if an error occurs while retrieveing the property or if the property doesn't exist.
Parameters:
  name - the name of the setting to retrieve.

public  StringgetImpl(String name)
     Implements the Settings.get(String) method.
public static  SettingsgetInstance()
     Provides the Settings object.
public static  LocalegetLocale()
     Provides the Struts default locale.
public static  LocationgetLocation(String name)
     Provides the Location of a setting.

The Location is utilized as part of precise error reporting.

This method will throw an IllegalArgumentException if an error occurs while retrieving the value or if the setting doesn't exist.
Parameters:
  name - the name of the property to get.

public  LocationgetLocationImpl(String name)
     Implements the Settings.getLocation(String) method.
public static  booleanisSet(String name)
     Determines whether or not a setting has a registered value.

This method is useful for testing for the existance of setting without throwing an IllegalArgumentException.
Parameters:
  name - the name of a setting to test.

public  booleanisSetImpl(String name)
     Implements the Settings.isSet(String) method.
public static  Iteratorlist()
     Provides an Iterator of all properties names.
public  IteratorlistImpl()
     Implements the Settings.list() method.
public static  voidreset()
     Resets the default and any plugin Setting instance to null.
public static  voidset(String name, String value)
     Registers a value for a setting.
public  voidsetImpl(String name, String value)
     Implements the Settings.set(String,String) method.
public static  voidsetInstance(Settings config)
     Registers a custom Settings implementation (plugin), and resets the cached locale.

Field Detail
defaultImpl
static Settings defaultImpl(Code)
An instance of DefaultSettings to use when another implementation is not provided (plugged in).



locale
static Locale locale(Code)
An instance of the default locale as specified by the struts.locale setting.
See Also:   Settings.getLocale



settingsImpl
static Settings settingsImpl(Code)
A pluggable implementation of Settings, provided through the Settings.setInstance method.





Method Detail
get
public static String get(String name) throws IllegalArgumentException(Code)
Provides a setting value as a String.

The method will throw an IllegalArgumentException if an error occurs while retrieveing the property or if the property doesn't exist.
Parameters:
  name - the name of the setting to retrieve. the setting value as a String.
throws:
  IllegalArgumentException - if an error occurs retrieving the property or the property does not exist.




getImpl
public String getImpl(String name) throws IllegalArgumentException(Code)
Implements the Settings.get(String) method.
Parameters:
  name - The name of the setting value to retreive The setting value as a String
throws:
  IllegalArgumentException - if an error occurs when retrieving the value
See Also:   Settings.get(String)



getInstance
public static Settings getInstance()(Code)
Provides the Settings object.

This method will substitute the default instance if another instance is not registered. the Settings object.




getLocale
public static Locale getLocale()(Code)
Provides the Struts default locale.

This method utilizes the struts.locale setting, which should be given as the Java java.util.Locale.toString toString() representation of a Locale object ("en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr_MAC", and so forth).

If a struts.locale setting is not registered, then the default virtual machine locale is substituted and cached. the Struts default locale if specified or the VM default locale.
See Also:   java.util.Locale.getDefault




getLocation
public static Location getLocation(String name) throws IllegalArgumentException(Code)
Provides the Location of a setting.

The Location is utilized as part of precise error reporting.

This method will throw an IllegalArgumentException if an error occurs while retrieving the value or if the setting doesn't exist.
Parameters:
  name - the name of the property to get. the Location of a property.
throws:
  IllegalArgumentException - if an error occurs retrieving the property or the property does not exist.




getLocationImpl
public Location getLocationImpl(String name) throws IllegalArgumentException(Code)
Implements the Settings.getLocation(String) method.
Parameters:
  name - Name of the setting to locate The location of the setting
throws:
  IllegalArgumentException - if an error occurs when retrieving the value
See Also:   Settings.getLocation(String)



isSet
public static boolean isSet(String name)(Code)
Determines whether or not a setting has a registered value.

This method is useful for testing for the existance of setting without throwing an IllegalArgumentException.
Parameters:
  name - the name of a setting to test. true if the setting exists and has a value, false otherwise.




isSetImpl
public boolean isSetImpl(String name)(Code)
Implements the Settings.isSet(String) method.
Parameters:
  name - Identifier for the setting value to change True if the setting exists and has a value, false otherwise.
See Also:   Settings.isSet(String)



list
public static Iterator list()(Code)
Provides an Iterator of all properties names. an Iterator of all properties names.



listImpl
public Iterator listImpl()(Code)
Implements the Settings.list() method.
See Also:   Settings.list() A list of the settings as an iterator



reset
public static void reset()(Code)
Resets the default and any plugin Setting instance to null.



set
public static void set(String name, String value) throws IllegalArgumentException, UnsupportedOperationException(Code)
Registers a value for a setting.

This method raises an exception if an error occurs when setting the value or if the settings implementation does not support setting values.
Parameters:
  name - the name of the setting.
Parameters:
  value - the value to register for the setting.
throws:
  IllegalArgumentException - if an error occurs when setting the value.
throws:
  UnsupportedOperationException - if the config implementation does not support setting values.




setImpl
public void setImpl(String name, String value) throws IllegalArgumentException, UnsupportedOperationException(Code)
Implements the Settings.set(String,String) method.
Parameters:
  name - Identifer for the setting to change.
Parameters:
  value - The new value for the setting.
throws:
  IllegalArgumentException - if an error occurs when setting the value.
throws:
  UnsupportedOperationException - if the config implementation does not support setting values.
See Also:   Settings.set(String,String)



setInstance
public static void setInstance(Settings config) throws IllegalStateException(Code)
Registers a custom Settings implementation (plugin), and resets the cached locale.

This method can only be called once.
Parameters:
  config - a Settings implementation
throws:
  IllegalStateException - if an error occurs when setting the settings implementation.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.