com.softwareag.mdm.instance
Interface ValueContext

All Known Subinterfaces:
ValueContextForInputValidation, ValueContextForUpdate, ValueContextForValidation

public interface ValueContext

Common interface for accessing the content and context of an instance or an occurrence.

See Also:
Adaptation

Method Summary
 String displayOccurrence(Object value, Locale aLocale)
          Returns, for user display, a string representation of the value specified.
 String formatOccurrence(Object value)
          Returns the parsable string representation of the value specified.
 AdaptationHome getHome()
          Returns the current repository.
 SchemaNode getNode()
          Returns the current schema node of this context.
 SchemaNode getNode(Path aPath)
          Returns the schema node at the path specified.
 Object getValue()
          Returns the value of the current node of this context.
 Object getValue(Path aPath)
          Returns the value of the node specified.
 

Method Detail

getHome

public AdaptationHome getHome()
Returns the current repository. This method should be used for accessing to other instances in the same repository.


getNode

public SchemaNode getNode()
Returns the current schema node of this context. When a path-based access is made, any relative path is resolved regarding this node.

See Also:
getValue(Path)

getNode

public SchemaNode getNode(Path aPath)
                   throws PathAccessException
Returns the schema node at the path specified. If the path is relative, it is resolved regarding the current node of this context.

Throws:
PathAccessException
See Also:
getNode()

getValue

public Object getValue(Path aPath)
                throws PathAccessException
Returns the value of the node specified. Returns null if node has an undefined value.

An inheritance lookup mechanism may be used for retrieving the value:

Warning: data updates

Any update on data must conform to Rule for updates.

Throws:
PathAccessException - if aPath does not refer to an existing node in the underlying type tree structure.

getValue

public Object getValue()
                throws PathAccessException
Returns the value of the current node of this context.

This method is a shortcut for getValue(Path.SELF).

Warning: data updates

Any update on data must conform to Rule for updates.

Throws:
PathAccessException

displayOccurrence

public String displayOccurrence(Object value,
                                Locale aLocale)
Returns, for user display, a string representation of the value specified.

The value must be compatible with the current node's type. It will be formatted according this type specification in the schema.

If the current node has its maxOccurs > 1, then value passed as argument must be an element of the List instance, not the List itself.

See Also:
formatOccurrence(Object)

formatOccurrence

public String formatOccurrence(Object value)
Returns the parsable string representation of the value specified.

The value must be compatible with the current node's type. It will be formatted according XML Schema specification of this type.

If the current node has its maxOccurs > 1, then value passed as argument must be an element of the List instance, not the List itself.

See Also:
displayOccurrence(Object, Locale)


(report a bug)
webMethods MDM 4.2.8 [0558]
Copyright Software AG 2000-2007. All rights reserved.