Interface ValueContext

All Known Subinterfaces:
ChildEntity, Entity, MainEntity, ValueContextForInputValidation, ValueContextForUpdate, ValueContextForValidation

public interface ValueContext
Common interface for accessing the content and context of a dataset or record.
See Also:
  • Method Details

    • getHome

      AdaptationHome getHome()
      Returns the current dataspace or snapshot.

      For a user service data context object that is not a record or a dataset, always returns the reference dataspace.

    • getNode

      SchemaNode getNode()
      Returns the current data model node of this context. When a path-based access is performed, any relative path is resolved with respect to this node.
      See Also:
    • getNode

      SchemaNode getNode(Path aPath) throws PathAccessException
      Returns the data model node at the specified path. If the path is relative, it is resolved with respect to the current node of this context.
      Throws:
      PathAccessException
      See Also:
    • getValue

      Object getValue(SchemaNode aNode)
      Returns the value of the specified node.
      Throws:
      IllegalArgumentException - if the specified node does not belong to the data model of the current content.
      IllegalArgumentException - if the current content is a table record and the specified node is not in the same table as the one of the current record.
      IllegalArgumentException - if the current content is a dataset and the specified node is a table record node.
      See Also:
    • getValue

      Object getValue(Path aPath) throws PathAccessException
      Returns the value of the specified node.

      The resolution of the value is done according to the following rules:

      1. If the specified node is a function, always returns the evaluation of the function.
      2. If the target node specifies a specific osd:inheritance inheritance property, returns the locally defined value if a local value is defined (or "overwritten"/null); if no local value is defined, looks up the first locally defined value, according to the osd:inheritance properties.
      3. Otherwise, the default inheritance mechanism is used: if the value is locally defined, it is returned (it can be null); otherwise, looks up the first locally defined value according to the built-in child-to-parent relationship of datasets; if no locally defined value is found, the data model default value is returned (null is returned if the data model does not define a default value).
      Access and mapping rules

      The access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.

      Throws:
      PathAccessException - if aPath does not refer to an existing node in the underlying type tree structure, or the specified node is above a terminal node.
      See Also:
    • getValue

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

      This method is equivalent to getValue(Path.SELF).

      Throws:
      PathAccessException
    • getAdaptationInstance

      Adaptation getAdaptationInstance()
      Returns the current dataset.

      If this context is on a table record, returns the current dataset that contains the table. Never returns null if current value is from a dataset or record. Returns null for user service data context objects that are not a record or a dataset.

      Important: this instance can belong to a technical snapshot if used in a validation context. Method ValueContextForValidation.getFunctionalDataspace() can be used to retrieve the functional dataspace that contains the original instance.

      See Also:
    • getAdaptationTable

      AdaptationTable getAdaptationTable()
      If this context is for a table record, returns the table that contains it; returns null if this is for a dataset or a user service data context object that are not a record.

      Important: this table can belong to a technical snapshot if used in a validation context. Method ValueContextForValidation.getFunctionalDataspace() can be used to retrieve the functional dataspace that contains the original table.

      See Also: