Interface ReadContext
- All Known Subinterfaces:
Adaptation
See data model.
Accessing a node
Any node in the structure can be accessed using its path from the root node of the structure.
Node value
If defined, the value of a node exists as:
- an instance of the corresponding XML Schema type, and
- an instance of the Java class that maps to the XML Schema type. It is a JavaBean, if the XML Schema type is a terminal "complex content".
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the value of the specified node.get
(SchemaNode aNode) Returns the value of the specified node.boolean
get_boolean
(Path aPath) Returns theboolean
value of the node specified.int
Returns theint
value of the specified node.Returns theDate
value of the node specified.<T> List<T>
Returns theList
value of the specified node.getResourcePathInModule
(Path aPath) Returns the path to the resource that is contained in the specified node.getResourcePathWithModule
(Path aPath) Returns the path (including the path of the module) to the resource that is contained by the node specified.Returns theString
value of the node specified.Returns the table object at the specified path, nevernull
.boolean
Returnstrue
if debug mode is activated for the current module.void
toHtmlString
(Writer aWriter) For debugging purposes, adds an HTML representation to the writer specified.
-
Method Details
-
get
Returns the value of the specified node. Returnsnull
if the value of the node is undefined.If this method is called on an
Adaptation
, a lookup mechanism is used to retrieve the value (see Inheritance and value resolution).Access and mapping rules
The access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.
- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.UnavailableContentError
- If the associated data model has errors, or when some inter-dataset links have errors in the context of the current dataspace.- See Also:
-
get
Returns the value of the specified node.This method is equivalent to
get(aNode.getPathInAdaptation())
, but is slightly more efficient.- Throws:
UnavailableContentError
- If the associated data model has errors or when some inter-dataset links have errors in the context of the current dataspace.IllegalArgumentException
- if the specified node isnull
or does not belong to the same table as the current one if this instance is a record.PathAccessException
-
get_boolean
Returns theboolean
value of the node specified. Returnsfalse
if no value is defined.- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not aboolean
, that is, the underlying type node is not an XML Schemaboolean
type.- See Also:
-
get_int
Returns theint
value of the specified node. Returns0
if no value is defined.- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not anint
, i.e. the underlying type node is not an XML Schemainteger
type.- See Also:
-
getDate
Returns theDate
value of the node specified. Returnsnull
if no value is defined.The mapping rules of the types
xs:date
andxs:time
have some particularities that are described in Mapping to Java.- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not aDate
, that is, the underlying type node is not an XML Schemadate
type.- See Also:
-
getList
Returns theList
value of the specified node. Returns a new emptyArrayList
if no value is defined.A node contains a
List
when, in the XML Schema, the corresponding node has been declared withmaxOccurs > 1
. The complete access and mapping rules between XML Schema and Java are described in the chapter Mapping to Java.- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not aList
, that is, the underlying type node does not havemaxOccurs > 1
in XML Schema.- See Also:
-
getResourcePathInModule
Returns the path to the resource that is contained in the specified node. Returnsnull
if no value is defined.The returned path can be passed as an argument to
For example:ServletContext.getResource(java.lang.String)
methods: the path begins with a "/", after the specific path of the web application (non-inclusive)./www/images/logos/sample1.gif
- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not an external resource, that is, the underlying type node is not an XML Schemaresource
type.- See Also:
-
getResourcePathWithModule
Returns the path (including the path of the module) to the resource that is contained by the node specified. Returnsnull
if no value is defined.The path starts with a "/" and includes the web application's specific path.
For example:/myWebAppPublicPath/www/fr_FR/images/logos/sample1.gif
- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not an external resource, that is, the underlying type node is not an XML Schemaresource
type.- See Also:
-
getString
Returns theString
value of the node specified. Returnsnull
if no value is defined.- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if the value of the node is not aString
, that is, the underlying type node is not an XML Schemastring
type.- See Also:
-
getTable
Returns the table object at the specified path, nevernull
.- Throws:
PathAccessException
- ifaPath
does not refer to an existing node in the underlying type tree structure.ClassCastException
- if value of the node is not an instance ofAdaptationTable
, that is, the underlying type node is not declared as a table.- See Also:
-
isEndUserDebug
boolean isEndUserDebug()Returnstrue
if debug mode is activated for the current module. This mode is configured using propertyfrontEnd.debugMode
in the filemodule.properties
(default is defined inebx.properties
). -
toHtmlString
For debugging purposes, adds an HTML representation to the writer specified. The table hierarchically displays the values in this context.
-