Interface ReadContext
-
- All Known Subinterfaces:
Adaptation
public interface ReadContextProvides a read-access facade to objects in a tree structure conforming to an underlying data model.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:
- XML Schema part 1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectget(Path aPath)Returns the value of the specified node.Objectget(SchemaNode aNode)Returns the value of the specified node.booleanget_boolean(Path aPath)Returns thebooleanvalue of the node specified.intget_int(Path aPath)Returns theintvalue of the specified node.DategetDate(Path aPath)Returns theDatevalue of the node specified.<T> List<T>getList(Path aPath)Returns theListvalue of the specified node.StringgetResourcePathInModule(Path aPath)Returns the path to the resource that is contained in the specified node.StringgetResourcePathWithModule(Path aPath)Returns the path (including the path of the module) to the resource that is contained by the node specified.StringgetString(Path aPath)Returns theStringvalue of the node specified.AdaptationTablegetTable(Path aPath)Returns the table object at the specified path, nevernull.booleanisEndUserDebug()Returnstrueif debug mode is activated for the current module.voidtoHtmlString(Writer aWriter)For debugging purposes, adds an HTML representation to the writer specified.
-
-
-
Method Detail
-
get
Object get(Path aPath) throws PathAccessException
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:
Adaptation.getValueWithoutResolution(Path)
-
get
Object get(SchemaNode aNode) throws PathAccessException
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 isnullor does not belong to the same table as the current one if this instance is a record.PathAccessException
-
get_boolean
boolean get_boolean(Path aPath) throws PathAccessException
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(Path)
-
get_int
int get_int(Path aPath) throws PathAccessException
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:
get(Path)
-
getDate
Date getDate(Path aPath) throws PathAccessException
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:
get(Path)
-
getList
<T> List<T> getList(Path aPath) throws PathAccessException
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:
get(Path)
-
getResourcePathInModule
String getResourcePathInModule(Path aPath) throws PathAccessException
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:
get(Path)
-
getResourcePathWithModule
String getResourcePathWithModule(Path aPath) throws PathAccessException
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:
get(Path),ServletContext.getResource(String)
-
getString
String getString(Path aPath) throws PathAccessException
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:
get(Path)
-
getTable
AdaptationTable getTable(Path aPath) throws PathAccessException
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:
get(Path)
-
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
void toHtmlString(Writer aWriter)
For debugging purposes, adds an HTML representation to the writer specified. The table hierarchically displays the values in this context.
-
-