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.default <T> TReturns the value of the specified node.get(SchemaNode aNode) Returns the value of the specified node cast to the specified class.default <T> Tget(SchemaNode aNode, Class<T> aClass) Returns the value of the specified node.booleanget_boolean(Path aPath) Returns thebooleanvalue of the node specified.intReturns theintvalue of the specified node.Returns theDatevalue of the node specified.<T> List<T>Returns theListvalue 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 theStringvalue of the node specified.Returns the table object at the specified path, nevernull.booleanReturnstrueif debug mode is activated for the current module.voidtoHtmlString(Writer aWriter) For debugging purposes, adds an HTML representation to the writer specified.
-
Method Details
-
get
Returns the value of the specified node. Returnsnullif 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- ifaPathdoes 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(aPath)followed by a cast to the specified class.- Throws:
PathAccessException- ifaPathdoes 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.ClassCastException- if the value is not of the specified type.- Since:
- 6.2.2
- See Also:
-
get
Returns the value of the specified node cast to the specified class.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 isnullor does not belong to the same table as the current one if this instance is a record.PathAccessException
-
get
Returns the value of the specified node.This method is equivalent to
get(aNode)followed by a cast to the specified class.- 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 isnullor does not belong to the same table as the current one if this instance is a record.ClassCastException- if the value is not of the specified type.PathAccessException- Since:
- 6.2.2
- See Also:
-
get_boolean
Returns thebooleanvalue of the node specified. Returnsfalseif no value is defined.- Throws:
PathAccessException- ifaPathdoes 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 Schemabooleantype.- See Also:
-
get_int
Returns theintvalue of the specified node. Returns0if no value is defined.- Throws:
PathAccessException- ifaPathdoes 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 Schemaintegertype.- See Also:
-
getDate
Returns theDatevalue of the node specified. Returnsnullif no value is defined.The mapping rules of the types
xs:dateandxs:timehave some particularities that are described in Mapping to Java.- Throws:
PathAccessException- ifaPathdoes 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 Schemadatetype.- See Also:
-
getList
Returns theListvalue of the specified node. Returns a new emptyArrayListif no value is defined.A node contains a
Listwhen, 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- ifaPathdoes 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 > 1in XML Schema.- See Also:
-
getResourcePathInModule
Returns the path to the resource that is contained in the specified node. Returnsnullif 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- ifaPathdoes 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 Schemaresourcetype.- See Also:
-
getResourcePathWithModule
Returns the path (including the path of the module) to the resource that is contained by the node specified. Returnsnullif 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- ifaPathdoes 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 Schemaresourcetype.- See Also:
-
getString
Returns theStringvalue of the node specified. Returnsnullif no value is defined.- Throws:
PathAccessException- ifaPathdoes 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 Schemastringtype.- See Also:
-
getTable
Returns the table object at the specified path, nevernull.- Throws:
PathAccessException- ifaPathdoes 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()Returnstrueif debug mode is activated for the current module. This mode is configured using propertyfrontEnd.debugModein 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.
-