|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.graphics.components.ConstantCollection
public class ConstantCollection
Constant collections are used to support a common set of static
actions applied on constants defined in the
com.sas.graphics.components package. These actions include:
(1) validation of public constant values
(2) translation between constant value and string value
(3) translation between constant value and JSP string value
(4) translation between constant value and localized string value
(5) generation of constant int or string arrays
Please note that the set of constants is defined at construction time and
is immutable. The methods here, are a convenience for working with the
constant values.
The methods toName, toJSPAttribute and toLocalizedName support the conversion of a constant value into its associated form.
The methods valueOfName, valueOfJSPAttribute and valueOfLocalizedName support the conversion from the identifed from back into its associated constant value.
The methods getConstants, getNames, getJSPAttributes and getLocalizedNames are a convenience to produce the specified set of constants as an array in the the desired form.
The methods validate and isValid verify whether or not a specified value is contained in the set of constants.
Constructor Summary | |
---|---|
ConstantCollection(java.lang.Class rbClass,
com.sas.graphics.components.ConstantCollection.Element[] elements)
Constructor used to specify a collection (an immutable set) of constant values. |
|
ConstantCollection(java.lang.Class rbClass,
java.lang.String rbKey,
com.sas.graphics.components.ConstantCollection.Element[] elements)
Constructor used to specify a collection (an immutable set) of constant values. |
Method Summary | |
---|---|
int[] |
getConstants()
Returns all the constants in this set as an int array. |
java.lang.String[] |
getJSPAttributes()
Returns all the constants in this set in the form of a string JSP (Java Server Page)attribute name. |
java.lang.String[] |
getLocalizedNames()
Returns all the constants in this set in the form of easily readable localized string names. |
java.lang.String[] |
getNames()
Returns all the constants in this set in the form of a string name. |
boolean |
isValid(int styleNum)
This method identifies by boolean value whether or not the specified value is contained in this set. |
java.lang.String |
toJSPAttribute(int styleNum)
Provides a conversion from the JSP (Java Server Page) string attribute name representation to its int constant value. |
java.lang.String |
toLocalizedName(int styleNum)
Provides a conversion from the localized string name representation to its int constant value. |
java.lang.String |
toName(int styleNum)
Provides a conversion from the string name representation to its int constant value. |
void |
validate(int styleNum)
This method will throw an IllegalArgument exception if the specified value is not one of the constants specified in this set. |
int |
valueOfJSPAttribute(java.lang.String name)
Provides a conversion from the JSP (Java Server Page) string attribute name to the int constant value. |
int |
valueOfLocalizedName(java.lang.String name)
Provides a conversion from the localized string name to the int constant value. |
int |
valueOfName(java.lang.String name)
Provides a conversion from the string constant name form to the int constant value. |
Constructor Detail |
---|
public ConstantCollection(java.lang.Class rbClass, com.sas.graphics.components.ConstantCollection.Element[] elements)
public ConstantCollection(java.lang.Class rbClass, java.lang.String rbKey, com.sas.graphics.components.ConstantCollection.Element[] elements)
Method Detail |
---|
public void validate(int styleNum) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not contained in the collection.
java.lang.IllegalArgumentException
public boolean isValid(int styleNum)
styleNum
is contained in this set.public int[] getConstants()
public java.lang.String[] getNames()
public java.lang.String[] getJSPAttributes()
public java.lang.String[] getLocalizedNames()
public java.lang.String toName(int styleNum) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not contained in the collection.
java.lang.IllegalArgumentException
public java.lang.String toJSPAttribute(int styleNum) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not contained in the collection.
java.lang.IllegalArgumentException
public java.lang.String toLocalizedName(int styleNum) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not contained in the collection.
java.lang.IllegalArgumentException
public int valueOfName(java.lang.String name) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not recognised as belonging to this set of constants.
java.lang.IllegalArgumentException
public int valueOfJSPAttribute(java.lang.String name) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not recognised as belonging to this set of constants.
java.lang.IllegalArgumentException
public int valueOfLocalizedName(java.lang.String name) throws java.lang.IllegalArgumentException
an
- IllegalArgumentException is thrown if the specified value is
not recognised as belonging to this set of constants.
java.lang.IllegalArgumentException
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |