com.cafesoft.core.util
Interface PropertySpec

All Known Implementing Classes:
StandardPropertySpec

public interface PropertySpec

PropertySpec is an interface that 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=abcdefgxyz
 
which indicates that a property named "agent_signature" should be created with literal value "abcdefgxyz".

Since:
12/10/2008

Field Summary
static int VALUE_TYPE_LITERAL
          A LITERAL PropertySpec value type.
static int VALUE_TYPE_REFERENCE
          A REFERENCE PropertySpec value type.
static int VALUE_TYPE_UNDEFINED
          An UNDEFINED PropertySpec value type.
 
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.
 

Field Detail

VALUE_TYPE_UNDEFINED

static final int VALUE_TYPE_UNDEFINED
An UNDEFINED PropertySpec value type.

See Also:
Constant Field Values

VALUE_TYPE_REFERENCE

static final int VALUE_TYPE_REFERENCE
A REFERENCE PropertySpec value type.

See Also:
Constant Field Values

VALUE_TYPE_LITERAL

static final int VALUE_TYPE_LITERAL
A LITERAL PropertySpec value type.

See Also:
Constant Field Values
Method Detail

getPropertyName

String getPropertyName()
Get the property name.

Returns:
the property name as a String.

getPropertyValueSpecType

int getPropertyValueSpecType()
Get the property value specification type.

Returns:
the property value specification type, which may be REFERENCE or LITERAL

getFQValueRefName

String getFQValueRefName()
Get the fully-qualified property value reference name.

Returns:
the fully qualified property value reference name, which is generally of the form: :. For example: http_header:REMOTE_USER

getValueRefNamespace

String getValueRefNamespace()
Get the property value reference name space.

Returns:
the property value reference name space or null if the value type is literal or if the value is in the default namespace.

getValueRefName

String getValueRefName()
Get the property value reference name.

Returns:
the property value reference name or null if the value type is literal.

getDefaultValue

String getDefaultValue()
Get the default property value.

Returns:
the property value if the value type is literal or if the referenced property value does not exist (cannot be resolved).


Generated on 10:38:35 AM April 14, 2011, © 1996-2010 Cafésoft LLC. All rights reserved.