|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cafesoft.core.util.StandardPropertySpec
public class StandardPropertySpec
StandardPropertySpec implements the PropertySpec
interface, which defines how meta data about a runtime-resolvable property
may be accessed. Each ProperySpec is composed of property name and a
property value specification. The property value specification is composed
of either a property value reference or a literal value. If a property value
reference, the value name may be qualified with a namespace.
PropertySpec is typically used to provide information on a property name/value pair that will be resolved in an environment-specific way. For example, the following textual representation of PropertySpec:
propertyspec.my_cookie={http_cookie:MY_COOKIE}
may be used to indicate that a web component should create a property
named "my_cookie", which is obtained from the current HTTP request using
the value of HTTP cookie "MY_COOKIE". PropertySpec instances may also have
a specific default value assigned if the referenced value name does not
exist. For example, if the HTTP request header "LOGON_USER" does not exist
for the following specification:
propertyspec.logon_user={http_header:LOGON_USER,anonymous}
then a property named "login_user" will be created with a default value of
"anonymous". PropertySpec values may also be literal like the following:
propertyspec.agent_signature=abcdefgxyzwhich indicates that a property named "agent_signature" should be created with literal value "abcdefgxyz".
| Field Summary |
|---|
| Fields inherited from interface com.cafesoft.core.util.PropertySpec |
|---|
VALUE_TYPE_LITERAL, VALUE_TYPE_REFERENCE, VALUE_TYPE_UNDEFINED |
| Constructor Summary | |
|---|---|
StandardPropertySpec(String propertyName,
int specType,
String fqValueRefName,
String valueRefNamespace,
String valueRefName,
String defaultValue)
Creates a new StandardPropertySpec instance. |
|
| Method Summary | |
|---|---|
String |
getDefaultValue()
Get the default property value. |
String |
getFQValueRefName()
Get the fully-qualified property value reference name. |
String |
getPropertyName()
Get the property name. |
int |
getPropertyValueSpecType()
Get the property value specification type. |
String |
getValueRefName()
Get the property value reference name. |
String |
getValueRefNamespace()
Get the property value reference name space. |
static PropertySpec |
newInstance(String propertyName,
String valueSpec)
Creates a new PropertySpec instance by parsing a value specification. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StandardPropertySpec(String propertyName,
int specType,
String fqValueRefName,
String valueRefNamespace,
String valueRefName,
String defaultValue)
propertyName - the property name associated with this PropertySpec.specType - the PropertyValueSpecType (REFERENCE or LITERAL).fqValueRefName - the fully qualified value reference name.valueRefNamespace - the value reference namespace.valueRefName - the unqualified value reference name.defaultValue - the default value.| Method Detail |
|---|
public static PropertySpec newInstance(String propertyName,
String valueSpec)
throws IllegalArgumentException
propertyName - the property name associated with this PropertySpec.valueSpec - the literal value or value reference. The value
specification may use a literal format (e.g. foobar) or a value
reference of the general form {[namespace:]valuename[,defaultvalue]}
where the square brackets indicate optional components. Examples
include:
IllegalArgumentException - if the property name is null or
empty, or the value specification format is invalid.public String getPropertyName()
getPropertyName in interface PropertySpecpublic int getPropertyValueSpecType()
getPropertyValueSpecType in interface PropertySpecpublic String getFQValueRefName()
getFQValueRefName in interface PropertySpecpublic String getValueRefNamespace()
getValueRefNamespace in interface PropertySpecpublic String getValueRefName()
getValueRefName in interface PropertySpecpublic String getDefaultValue()
getDefaultValue in interface PropertySpec
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||