|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.commerce.states.ObjectStates
public class ObjectStates
This is the base class for any class representing the possible states for an object.
It provides methods for searching the state maps for the requested state value or string.
Normally the state's integer representation, string representation, and description are
all pulled from the configuration properties file. This does not work very well when
operating in multiple languages. If translation of states is necessary, please use the
methods getStateAsUserResource
and getStateDescriptionAsUserResource
instead of getStateAsString
and getStateDescription
respectively.
The resource file at getResourceFileName
will be used to look up
string values for each of the states.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Constructor Summary | |
---|---|
ObjectStates()
|
Method Summary | |
---|---|
java.lang.String |
getDescriptionResourcePrefix()
Return the resource key prefix for descriptions Currenty this returns resourcePrefix + "DESC" |
java.lang.String |
getResourceFileName()
The name of the resource file to use for the states The default is "atg.commerce.states.StateResource" |
java.lang.String |
getResourcePrefix()
Return the resource key prefix To allow for different objects to have the same states translated in different ways, this prefix will be prepended to any keys. |
java.lang.String |
getResourceString(java.lang.String pPrefix,
java.lang.String pKey)
This method returns a resource string by combining the given prefix with the given key and looking it up in a file using the current locale if prefix="ORDER" and key="SUBMITTED" then the resource key that is used is "ORDER.SUBMITTED" If the key is not found, then pKey is returned. |
java.lang.String |
getStateAsUserResource(int pState)
This method returns a resourced value for the given state. |
java.lang.String |
getStateAsUserResource(java.lang.String pState)
This method returns a resourced value for the given state. |
java.lang.String |
getStateAsUserResource(java.lang.String pPrefix,
int pState)
This method returns a resourced value for the given state. |
java.lang.String |
getStateAsUserResource(java.lang.String pPrefix,
java.lang.String pState)
This method returns a resourced value for the given state. |
java.lang.String |
getStateDescription(int pStateValue)
This method gets the requested states description. |
java.lang.String |
getStateDescription(java.lang.String pStateString)
This method gets the requested states description. |
java.lang.String |
getStateDescriptionAsUserResource(int pState)
This method gets the requested states description from a resource file |
java.lang.String |
getStateDescriptionAsUserResource(java.lang.String pState)
This method gets the requested states description from a resource file. |
java.lang.String |
getStateDescriptionAsUserResource(java.lang.String pPrefix,
int pState)
This method gets the requested states description from a resource file |
java.lang.String |
getStateDescriptionAsUserResource(java.lang.String pPrefix,
java.lang.String pState)
This method gets the requested states description from a resource file. |
java.util.Properties |
getStateDescriptionMap()
stateDescriptionMap is the mapping between a state name and a description string |
int |
getStateFromString(java.lang.String pState)
This method takes a states string value and returns the int value |
java.lang.String |
getStateString(int pState)
This method gets the requested states string value. |
java.util.Properties |
getStateStringMap()
stateStringMap is the mapping between a state name and a string |
int |
getStateValue(java.lang.String pStateName)
This method gets the requested states value. |
java.util.Properties |
getStateValueMap()
stateValueMap is the mapping between a state name and an integer |
void |
setStateDescriptionMap(java.util.Properties pProp)
|
void |
setStateStringMap(java.util.Properties pProp)
|
void |
setStateValueMap(java.util.Properties pProp)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
Constructor Detail |
---|
public ObjectStates()
Method Detail |
---|
public java.lang.String getResourceFileName()
public void setStateValueMap(java.util.Properties pProp)
public java.util.Properties getStateValueMap()
public void setStateStringMap(java.util.Properties pProp)
public java.util.Properties getStateStringMap()
public void setStateDescriptionMap(java.util.Properties pProp)
public java.util.Properties getStateDescriptionMap()
public int getStateValue(java.lang.String pStateName)
pState
- The name of the state we are getting the value for
public java.lang.String getStateDescription(java.lang.String pStateString)
pState
- The string value of the state we are getting the description for
public java.lang.String getStateDescription(int pStateValue)
pState
- The name of the state we are getting the description for
public java.lang.String getStateString(int pState)
pState
- The value of the state we are getting the string value for
public int getStateFromString(java.lang.String pState)
pState
- The string value of the state
public java.lang.String getResourcePrefix()
public java.lang.String getDescriptionResourcePrefix()
public java.lang.String getStateAsUserResource(java.lang.String pState)
pState
- the string value of the state
public java.lang.String getStateAsUserResource(int pState)
pState
- the value of the state
public java.lang.String getStateAsUserResource(java.lang.String pPrefix, java.lang.String pState)
pPrefix
- add this to the beginning of the state that is used as the keypState
- the string value of the state
public java.lang.String getStateAsUserResource(java.lang.String pPrefix, int pState)
pPrefix
- add this to the beginning of the state that is used as the keypState
- the value of the state
public java.lang.String getStateDescriptionAsUserResource(java.lang.String pState)
pState
- The string value of the state we are getting the description for
public java.lang.String getStateDescriptionAsUserResource(int pState)
pState
- The value of the state we are getting the description for
public java.lang.String getStateDescriptionAsUserResource(java.lang.String pPrefix, java.lang.String pState)
pPrefix
- add this to the beginning of the state that is used as the keypState
- The string value of the state we are getting the description for
public java.lang.String getStateDescriptionAsUserResource(java.lang.String pPrefix, int pState)
pPrefix
- add this to the beginning of the state that is used as the keypState
- The value of the state we are getting the description for
public java.lang.String getResourceString(java.lang.String pPrefix, java.lang.String pKey)
pPrefix
- add this to the beginning of the keypKey
- the key that is used when looking up the resource
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |