Interface SchemaNode
-
Method Summary
Modifier and TypeMethodDescriptionCreates a new Java object that complies to this node definition.displayOccurrence
(Object aValue, boolean useLabels, ValueContext aValueContext, Locale aLocale) Returns a user-friendly representation of the specified value.executeRead
(Object aContainerOccurrence) Reads the specified occurrence of the parent node and returns the value corresponding to this node.void
executeWrite
(Object aValue, Object aContainerOccurrence) Modifies the specified occurrence of the parent node by setting the specified value.formatToXsString
(Object aValue) Returns the string that corresponds to the specified value.Returns the static access mode of the current node.Returns the information for an association.Returns the business object model associated to this table node.getBusinessObjectModel
(Adaptation aDataset, Session aSession) Returns the business object model associated to this node if it is a table node.Returns the category that is defined in data model (attributeosd:category
); returnsnull
if no category is specified on the current node, nor on its ancestors.Returns the default value for the node that is defined in data model (attributexs:default
), ornull
if no value is specified.Returns the default view properties for this node, as defined in the data model (elementosd:defaultView
under the elementxs:annotation/xs:appinfo
).getDescription
(Session aSession) Returns the localized description of this node in the context of a user session.getDescription
(Locale aLocale) Returns the localized description of this node.<T> List<T>
getEnumerationList
(ValueContext aValueContext) If the data model specifies an enumeration, returns the values that this node may take on.<T> Nomenclature<T>
getEnumerationNomenclature
(ValueContext aValueContext) Returns the underlyingNomenclature
, if found by searching through facets.Returns the firstenumeration
facet declared on this node.Returns the firstexcludeSegment
facet declared on this node.Returns the firstexcludeValue
facet declared on this node.Returns the firstfractionDigits
facet declared on this node.Returns the firstlength
facet declared on this node.Returns the firstmaxExclusive
facet declared on this node.Returns the firstmaxInclusive
facet declared on this node.Returns the firstmaxlength
facet declared on this node.Returns the firstminExclusive
facet declared on this node.Returns the firstminInclusive
facet declared on this node.Returns the firstminLength
facet declared on this node.Returns the facet corresponding to the cardinality constraint related to a mandatory field (declares bothminOccurs=1
andmaxOccurs=1
).Returns theosd:tableRef
facet (foreign key constraint) declared on this node.Returns theOResource
facet held by this node.Returns the firstpattern
facet declared on this node.Returns an iterator over thefacets
defined by this data model node.Returns the firsttotalDigits
facet declared on this node.Returns the additional information (elementosd:information
) for this node, as defined in the data model.Returns the inheritance properties (elementosd:inheritance
) for this node, as defined in the data model.Class<?>
Returns the specific Java Beanclass
defined on this data model node (attributeosd:class
) ornull
if no Java Bean has been defined and/or this node is not terminal.Returns the label of this node for the specified session.Returns the localized label of this node.Returns the mandatory error message (defined by the data model elementosd:mandatoryErrorMessage
).int
Returns the value ofxs:maxOccurs
.int
Returns the value ofxs:minOccurs
.Returns the node at the specified path, ornull
if no node exists at the specified path.Returns the node at the specified path, ornull
if the node does not exist andisTolerantRead
istrue
.Returns the data model nodes defined directly under this node.getNodeChildren
(boolean includeMetadata) Returns the data model nodes defined directly under this node.Class<?>
Returns the defaultClass
of the Java records of this data model node,null
if this node is above a terminal node.Returns the parent node of this node.Returns the local absolute path.Returns the absolute path of this node in the data model.Returns the information for the relationship defined by this node.Returns all the relationships defined by this node.getRelationships
(Adaptation aDataset, Session aSession) Returns the relationships defined by this node.getRelationships
(Adaptation aDataset, Session aSession, boolean includeMetadata) Returns the relationships defined by this node.Deprecated.Since 5.9.0 it is not possible to define locales for a module anymore.Returns the information for a linked field.Deprecated.Since 5.9.0 it is not possible to define locales for a module anymore.Returns the location of the data model that defines this node.Returns the information for a selection link.Returns the entity name of this node if this node is a table node.If this node is in a table record, returns the node of the containing table, which definesosd:table
.If this node is a table node (see methodisTableNode()
), returns the root node of the record structure.Returns the primary key that is defined in the data model if this node is a table node.Object[]
getTablePrimaryKeyValues
(PrimaryKey aPrimaryKey) If this node is a table node, decomposes the specified primary key object into the primary key field values in the referenced table.Object[]
getTablePrimaryKeyValues
(String aTableRefValue) If this node is a table node, decomposes the specifiedosd:tableRef
value into the primary key field values in the referenced table.Returns theuniqueness constraints
applied on this table using the propertyxs:unique
.Returns the type name of this node, ornull
if this node is associated with an anonymous type definition.boolean
Returnstrue
if an ancestor of this node is a list.boolean
Returnstrue
if this node or one of its ancestors is a list.boolean
Returnstrue
if this node is an association.boolean
Returnstrue
if this node defines an auto-increment.boolean
Returns the value of the propertyosd:checkNullInput
.boolean
Returnstrue
if this node is a complex element declaration.boolean
Specifies if the history is disabled for this node.boolean
Returnstrue
if this node is a linked node.boolean
Returnstrue
if this node is a selection link.boolean
Returnstrue
if this node is a table node.boolean
Returnstrue
if this node is in a table record.boolean
Returnstrue
if this node is terminal.boolean
Returnstrue
if this node is a terminal node whose value is not directly stored in EBX® repository.boolean
Returnstrue
if this node is the descendant of a terminal value node.boolean
Returnstrue
if the validation is disabled on this node.boolean
isValueEqual
(Object aFirstValue, Object aSecondValue) Returnstrue
if the specified values are equal, according to the underlying XML Schema type.boolean
Returnstrue
if this node holds a function.boolean
isValueLessOrEqualTo
(Object aFirstValue, Object aSecondValue) Returnstrue
if first value is less than or equal to the second value, according to the underlying XML Schema type.boolean
isValueStrictlyLessThan
(Object aFirstValue, Object aSecondValue) Returnstrue
if the first value is strictly less than the second value, according to the underlying XML Schema type.parseXsString
(String aString) Returns the value that corresponds to the specified string.
-
Method Details
-
getMinOccurs
int getMinOccurs()Returns the value ofxs:minOccurs
. -
getMaxOccurs
int getMaxOccurs()Returns the value ofxs:maxOccurs
. -
isCheckNullInput
boolean isCheckNullInput()Returns the value of the propertyosd:checkNullInput
. -
getPathInAdaptation
Path getPathInAdaptation()Returns the local absolute path.In a table record, the local absolute path is the path that begins at the table root node (non-inclusive); otherwise, it is the path that starts at the dataset root node (inclusive). In the latter case, the path is the same as the one returned by
getPathInSchema()
.- See Also:
-
getPathInSchema
Path getPathInSchema()Returns the absolute path of this node in the data model.- See Also:
-
isComplex
boolean isComplex()Returnstrue
if this node is a complex element declaration. -
isValueEqual
Returnstrue
if the specified values are equal, according to the underlying XML Schema type.For example, if the data model type is
xs:date
, both specified values must instances ofDate
. Also, equality checking forxs:date
does not take time into account, due to the Java equality checking forDate
. In contrast, equality checking for the typexs:dateTime
in the data model would compare time.- Throws:
ClassCastException
- if a specified value is not an instance of the underlying type.
-
isValueLessOrEqualTo
Returnstrue
if first value is less than or equal to the second value, according to the underlying XML Schema type.- Throws:
UnsupportedOperationException
- if underlying type does not support comparison.ClassCastException
- if a specified value is not an instance of underlying type.
-
isValueStrictlyLessThan
Returnstrue
if the first value is strictly less than the second value, according to the underlying XML Schema type.- Throws:
UnsupportedOperationException
- if the underlying type does not support comparison.ClassCastException
- if a specified value is not an instance of the underlying type.
-
isTerminalValue
boolean isTerminalValue()Returnstrue
if this node is terminal.A node is terminal when:
- it is a field (a node of a simple type) that is not the descendant of a terminal complex
(see
isTerminalValueDescendant()
); - it is a group (a node of a complex type) that is not the descendant of a terminal complex,
and the data model specifies any of the following:
maxOccurs > 1
(either an aggregated list or aosd:table
);- a value function,
osd:function
(see Computed Values); - an access property,
osd:access
(see Access Properties).
Note: if inheritance is enabled, a terminal node value can be inherited.
- See Also:
- it is a field (a node of a simple type) that is not the descendant of a terminal complex
(see
-
isTerminalValueDescendant
boolean isTerminalValueDescendant()Returnstrue
if this node is the descendant of a terminal value node. This implies that the parent node is of a complex type and it is itself either terminal or a descendant of a terminal node.- See Also:
-
isTerminalValueComputed
boolean isTerminalValueComputed()Returnstrue
if this node is a terminal node whose value is not directly stored in EBX® repository.This is the case for a node declaring an
osd:function
,osd:association
andosd:table
. -
isAutoIncrement
boolean isAutoIncrement()Returnstrue
if this node defines an auto-increment.An auto-incremented node is specified in the data model using the the
osd:autoIncrement
element. -
isSelectNode
boolean isSelectNode()Returnstrue
if this node is a selection link.A select node is specified in the data model using the
osd:select
element.- See Also:
-
getSelectionLink
SelectionLink getSelectionLink()Returns the information for a selection link. Returnsnull
if the node has no selection link defined.- See Also:
-
isAssociationNode
boolean isAssociationNode()Returnstrue
if this node is an association.An association node is specified in the data model using the
osd:association
element.- Since:
- 5.5.0
-
getAssociationLink
AssociationLink getAssociationLink()Returns the information for an association. Returnsnull
if the node is not an association.- Since:
- 5.5.0
- See Also:
-
isLinkedNode
boolean isLinkedNode()Returnstrue
if this node is a linked node.A linked node is specified in the data model using the
osd:function linkedField="aPath"
element.- Since:
- 6.0
- See Also:
-
getSchemaLinkedField
SchemaLinkedField getSchemaLinkedField()Returns the information for a linked field.Returns
null
if this node is does not define the elementosd:function linkedField="aPath"
.- Since:
- 6.0
- See Also:
-
getRelationship
SchemaNodeExplicitRelationship getRelationship()Returns the information for the relationship defined by this node. Returnsnull
if the node has no relationship defined. -
getRelationships
Returns the relationships defined by this node.This method is equivalent to:
SchemaNode.getRelationships(Adaptation, Session, false);
- Since:
- 5.7.1
- See Also:
-
getRelationships
SchemaNodeRelationships getRelationships(Adaptation aDataset, Session aSession, boolean includeMetadata) Returns the relationships defined by this node.The relationships returned by this method are filtered according to the permissions defined for the end-user associated to the specified session and in the context of the given dataset that is an instance of the data model containing this node.
* @param includeMetadata iftrue
this method returns also the relationships of the metadata fields if this node is a table node.- Throws:
IllegalArgumentException
- if the specifiedAdaptation
isnull
.IllegalStateException
- if the specifiedAdaptation
is not a dataset.IllegalStateException
- if the specifiedAdaptation
has severe error.IllegalStateException
- if the specified dataset is not an instance of the data model containing this node.IllegalArgumentException
- is the specifiedSession
isnull
.- Since:
- 6.1
- See Also:
-
getRelationships
SchemaNodeRelationships getRelationships()Returns all the relationships defined by this node.The method
getRelationships(Adaptation, Session)
can be used if the relationships held by this node must be filtered according to the permissions defined for a specific end-user, in the context of a dataset which is an instance of the data model containing this node.- Since:
- 5.7.1
- See Also:
-
getBusinessObjectModel
Returns the business object model associated to this node if it is a table node.Permissions are resolved using this method. As a consequence, this method returns
null
if the main table of the related business object model associated cannot be viewed by the end-user associated with the given session and in the context of the specified dataset. The dimensions of the business object model are filtered as well. That is, a dimension (including its child dimensions) are not visible if the related relationship cannot be viewed by the end-user associated with the given session and in the context of the specified dataset. SeeSchemaNodeRelationships.getExplicitRelationships()
for more information about the resolution of the permissions.- Throws:
IllegalArgumentException
- if the specifiedSchemaNode
is not a table node.IllegalArgumentException
- if the specifiedAdaptation
isnull
.IllegalStateException
- if the specifiedAdaptation
is not a dataset.IllegalStateException
- if the specifiedAdaptation
has a severe error.IllegalStateException
- if the specified dataset is not an instance of the data model containing this node.IllegalArgumentException
- if the specifiedSession
isnull
.
-
getBusinessObjectModel
BusinessObjectModel getBusinessObjectModel()Returns the business object model associated to this table node.The method
getBusinessObjectModel(Adaptation, Session)
can be used if the business object model associated to this node must be filtered according to the permissions defined for a specific end-user, in the context of a dataset which is an instance of the data model containing this node.- Throws:
IllegalArgumentException
- if the current node is not a table node.- See Also:
-
getTableNode
SchemaNode getTableNode()If this node is in a table record, returns the node of the containing table, which definesosd:table
. Returns either the table node containing theosd:table
declaration, ornull
if this node is not inside a table.- See Also:
-
isTableNode
boolean isTableNode()Returnstrue
if this node is a table node.A table node is specified in the data model using the element
osd:table
(see Table definition).- See Also:
-
getTablePrimaryKeyNodes
SchemaNode[] getTablePrimaryKeyNodes()Returns the primary key that is defined in the data model if this node is a table node. Returns the nodes of the primary key that are defined in the elementosd:table/primaryKeys
(in their declared order), ornull
if this node is not a table node. -
getTablePrimaryKeyValues
Object[] getTablePrimaryKeyValues(String aTableRefValue) throws InvalidPrimaryKeyException, IllegalArgumentException If this node is a table node, decomposes the specifiedosd:tableRef
value into the primary key field values in the referenced table.The following table gives some examples of decomposition:
Key fields String representation ( aTableRefValue
)returns (xs:string) "abc" "abc" (xs:int) "123" [Integer(123)] (xs:int) "" throws an InvalidPrimaryKeyException
.(xs:int) "aa" throws an InvalidPrimaryKeyException
.(xs:int | xs:string) "123|abc" [Integer(123), "abc"] (xs:int | xs:string) "123|abc|abc" [Integer(123), "abc|abc"] (the second field is itself a foreign key, the second value can hence be itself decomposed) (xs:int | xs:string) "aa|aaa" (invalid integer field) throws an InvalidPrimaryKeyException
.(xs:int | xs:string) "|aaa" throws an InvalidPrimaryKeyException
.(xs:int | xs:string) "" (empty string) throws an InvalidPrimaryKeyException
.(xs:int | xs:string) "aaa" Invalid, throws an InvalidPrimaryKeyException
.- Parameters:
aTableRefValue
- a string value that conforms to the primary key syntax.- Returns:
- an array in which each element is extracted from the specified value and corresponds to the field at the same position in the primary key field array.
- Throws:
InvalidPrimaryKeyException
- if the specified value does not have the expected primary key syntax, or if a field value isnull
.IllegalStateException
- if this node is not a table node.IllegalArgumentException
- if the specified value isnull
.- Since:
- 5.2.3
- See Also:
-
getTablePrimaryKeyValues
Object[] getTablePrimaryKeyValues(PrimaryKey aPrimaryKey) throws InvalidPrimaryKeyException, IllegalArgumentException If this node is a table node, decomposes the specified primary key object into the primary key field values in the referenced table.This method is equivalent to:
this.getTablePrimaryKeyValues(aPrimaryKey.format());
-
getTableEntityName
String getTableEntityName()Returns the entity name of this node if this node is a table node. Returns the entity name defined in the data model or a default one (the last step of the table's path is used as the default entity name), ornull
if this node is not a table node.- Since:
- 6.1.0
-
getTableOccurrenceRootNode
SchemaNode getTableOccurrenceRootNode()If this node is a table node (see methodisTableNode()
), returns the root node of the record structure.This method is used for accessing the internal structure of a table.
Since a table node is considered to be a terminal node, it does not provide direct access to its children. Instead, the child nodes can only be accessed through the root node of the record structure (the object that is returned by this method).
- Returns:
- the root node of the record structure,
null
if this node is not a table node - See Also:
-
isTableOccurrenceNode
boolean isTableOccurrenceNode()Returnstrue
if this node is in a table record. -
isHistoryDisabled
boolean isHistoryDisabled()Specifies if the history is disabled for this node. Returnstrue
if:- this node is a table node and the property
historyProfile
is not set in the data model; - the history is explicitly disabled on this node, in the data model;
- this node is a computed terminal-value;
- the type of this node is of type
osd:password
; - an ancestor of this node in the data model has its history disabled.
- Since:
- 5.5.1
- See Also:
- this node is a table node and the property
-
getAccessMode
AccessPermission getAccessMode()Returns the static access mode of the current node. Access can be further restricted by specifying permissions.For example, a
function
isread-only
.Note: If the node is neither
terminal
nor aterminal descendant
, the returned mode ishidden
. This does not imply that the node is not visible, but rather that it does not directly hold a value.- See Also:
-
getCategory
String getCategory()Returns the category that is defined in data model (attributeosd:category
); returnsnull
if no category is specified on the current node, nor on its ancestors. -
getDefaultValue
Object getDefaultValue()Returns the default value for the node that is defined in data model (attributexs:default
), ornull
if no value is specified.This default value is typed according to type of the current node. That is, the default value specified in the data model must comply with the type of the associated element.
If the current node is an aggregated list (an element defining
maxOccurs > 1
) then the returned default value will be a newList
instance containing a single occurrence of the default value defined in the data model. -
getLabel
Returns the localized label of this node.The label is computed as follows:
- If the data model defines a custom
SchemaDocumentation
, then the computed label is returned, if not, returnsnull
; - Otherwise, the label that is defined statically on the current node in the data model is returned;
- If no static label is defined, the name of this node is returned (the name is the last part of the node's path).
- See Also:
- If the data model defines a custom
-
getDescription
Returns the localized description of this node.The description is computed as follows:
- If the data model defines a
SchemaDocumentation
, then the description it computes is returned, if not, returnsnull
; - Otherwise, the description that is defined statically on the current node in the data model is returned.
- See Also:
- If the data model defines a
-
getLabel
Returns the label of this node for the specified session.The label is computed as follows:
- If the data model defines a
SchemaDocumentation
, then the label it computes is returned, if not, returnsnull
; - Otherwise, the label that is defined statically on the current node in the data model is returned;
- If no static label is defined, the name of this node is returned (the name is the last part of the node's path).
- If the data model defines a
-
getDescription
Returns the localized description of this node in the context of a user session.The description is computed as follows:
- If the data model defines a custom
SchemaDocumentation
, then the computed description is returned, if not, returnsnull
; - Otherwise, the description that is defined statically on the current node in the data model is returned.
- If the data model defines a custom
-
getMandatoryUserMessage
UserMessage getMandatoryUserMessage()Returns the mandatory error message (defined by the data model elementosd:mandatoryErrorMessage
). -
getParent
SchemaNode getParent()Returns the parent node of this node.This method returns the root node of the record structure if the current node is a direct child of a table node.
- Since:
- 5.7.1
- See Also:
-
getNode
Returns the node at the specified path, ornull
if no node exists at the specified path.If the path is relative, it is interpreted based on the location of this node. This method is equivalent to
getNode(aPath, true, false)
.If the path begins with "
//
", this method returns the first node that matches what follows. This syntax is not as efficient as absolute or relative notations.- See Also:
-
getNode
SchemaNode getNode(Path aPath, boolean tolerantRead, boolean absolutePathBeginsAtRecordRoot) throws PathAccessException Returns the node at the specified path, ornull
if the node does not exist andisTolerantRead
istrue
.- Parameters:
aPath
- if relative, it is interpreted based on the location of this node.tolerantRead
- iftrue
, returnsnull
when no node exists at the specified location; otherwise it throwsPathAccessException
.absolutePathBeginsAtRecordRoot
- if value istrue
,aPath
is absolute, and this node is in a table, the root of the path is the table root node.- Throws:
PathAccessException
- if no node exists at the specified path andtolerantRead
isfalse
.
-
getNodeChildren
SchemaNode[] getNodeChildren()Returns the data model nodes defined directly under this node.This method is equivalent to:
SchemaNode.getNodeChildren(false);
-
getNodeChildren
Returns the data model nodes defined directly under this node.This method returns an empty array if the underlying type is a simple type or if this is a table node (see
isTableNode()
). If this is a table node, the methodgetTableOccurrenceRootNode()
must be used to get the structure of the table.Note: A node can have children and still be considered as "terminal" based on the definition given by the method
isTerminalValue()
.- Parameters:
includeMetadata
- iftrue
and if this node is atable root node
, this methods includes the metadata nodes. Metadata nodes contains information related to a table record (e.g. its creator).- See Also:
-
isAncestorMultiOccurrenced
boolean isAncestorMultiOccurrenced()Returnstrue
if an ancestor of this node is a list.- Since:
- 5.7.1
- See Also:
-
isAncestorOrSelfMultiOccurrenced
boolean isAncestorOrSelfMultiOccurrenced()Returnstrue
if this node or one of its ancestors is a list. Returnsfalse
if this node is a table node.- Since:
- 5.7.1
- See Also:
-
getSchemaLocation
SchemaLocation getSchemaLocation()Returns the location of the data model that defines this node. -
getSchemaDefaultLocale
Deprecated.Since 5.9.0 it is not possible to define locales for a module anymore.Repository.getDefaultLocale()
should be used instead.Returns the default locale of EBX®. -
getSchemaLocales
Deprecated.Since 5.9.0 it is not possible to define locales for a module anymore.Repository.getLocales()
should be used instead.Returns the locales that are supported by EBX®. -
getXsTypeName
SchemaTypeName getXsTypeName()Returns the type name of this node, ornull
if this node is associated with an anonymous type definition. -
displayOccurrence
String displayOccurrence(Object aValue, boolean useLabels, ValueContext aValueContext, Locale aLocale) Returns a user-friendly representation of the specified value.Displaying values
A value can be displayed differently than its standard XML formatted value (see methodformatToXsString
) in order to be more relevant to the user:-
Number and date formats:
If the element is a number (
xs:int
,xs:decimal
, etc.), or a date (xs:date
,xs:dateTime
,xs:time
), it is formatted according to the formatting policy associated with the specified locale. -
Value labeling:
If
useLabels
istrue
and the element has a declaration that enables value labeling, as described in the table below.
Data model definition Value label (if useLabels = true
)xs:enumeration
Label is either the value of the attribute osd:label
or the content of the localized elementxs:documentation
, as specified in the data model.osd:tableRef
For a foreign key constraint, the label is computed from the referenced record, if it exists, and its data model declaration. In order of preference: - The elements
osd:tableRef/display
orosd:table/defaultLabel
; - If there is no such declaration, the label is the concatenation of the label of each primary key fields of the referenced record.
osd:enumeration
For a dynamic enumeration, the label comes from the target node, if it defines such labels. osd:constraintEnumeration
For a programmatic enumeration constraint, the label is the string returned by the method ConstraintEnumeration.displayOccurrence
. As a consequence, it may be localized.osd:constraintNomenclature
(deprecated)For a programmatic nomenclature constraint, the label is the string returned by the method NomenclatureItem.getLabel
, if the nomenclature item exists for the specified value.other cases No value labeling is performed, the method returns the formatted value. Context limitations
If the specifiedValueContext
is aProcedureContext
, this method will throw anIllegalArgumentException
when dynamic or programmatic labeling callsValueContext.getValue(Path)
using a relative path.- Parameters:
aValue
- The value must be compatible with the type of the current node. If the current node specifiesmaxOccurs > 1
, then the value must be an element of theList
instance, not theList
itself.useLabels
- Iftrue
and labeling is enabled, specifies to return the label associated with the value. See the table above.aValueContext
- Context that contains the value. It is used when the label to be returned depends on a contextual and dynamic resolution based on a relative path (see above).aLocale
- Locale for formatting numbers, dates or localized labels.- See Also:
-
Number and date formats:
If the element is a number (
-
formatToXsString
Returns the string that corresponds to the specified value. This method uses the underlying XML Schema type for performing theObject
-to-String
conversion.For example, if the underlying type is
xs:date
, the specified record must be aDate
instance and this method will return the XML Schema representation of this date.- Throws:
IllegalArgumentException
- If the resulting string is not a valid XML string (this happens if a specifiedxs:string
contains invalid XML characters).ClassCastException
- if the value is not of the expected Java type.- See Also:
-
parseXsString
Returns the value that corresponds to the specified string. This method uses the underlying XML Schema type for performing theString
-to-Object
conversion.For example, if the underlying type is
xs:date
, the string must conform to the XML Schema representation of dates (for example, "1999-05-31"). This method then returns aDate
instance.- Throws:
ConversionException
- if specified string is invalid with respect to the underlying XML Schema type.- See Also:
-
getOccurrencesJavaClass
Class<?> getOccurrencesJavaClass()Returns the defaultClass
of the Java records of this data model node,null
if this node is above a terminal node.- See Also:
-
getJavaBeanClass
Class<?> getJavaBeanClass()Returns the specific Java Beanclass
defined on this data model node (attributeosd:class
) ornull
if no Java Bean has been defined and/or this node is not terminal. The difference withgetOccurrencesJavaClass()
is the fact that it returnsnull
if no specific Java Bean has been defined in the data model. Therefore for simple types, it returns alwaysnull
.- See Also:
-
createNewOccurrence
Object createNewOccurrence()Creates a new Java object that complies to this node definition.The returned value conforms to the following rules:
- If the element declaration includes
maxOccurs > 1
, the method does not take this fact into account (that is, it returns an element of theList
, not aList
instance). - If the element is of a simple type and no default value is defined, it returns
null
. - If the element is of a simple type and a default value is defined, it returns this default value (a clone of it, if this is a mutable object).
- If the element is of a complex type, it returns a new instance, either of the class
specified in the
osd:class=""
attribute, or of a default internal class (such an instance may be accessed byexecuteRead(Object)
).
- If the element declaration includes
-
executeRead
Reads the specified occurrence of the parent node and returns the value corresponding to this node.Precondition: This node must be a
descendant of a terminal node
.Example
A parent node declares
maxOccurs > 1
and it refers to a complex. Hence, the parent value will be a JavaList
. For each object (occurrence) in the list, this method gets the value associated with this child node.- Parameters:
aContainerOccurrence
- must be an occurrence complying with the data model definition of the parent node.- See Also:
-
executeWrite
Modifies the specified occurrence of the parent node by setting the specified value. As explained in the section Modification of mutable objects, to be persisted, the locally modified object must be set to the context.Precondition: This node must be a
descendant of a terminal node
.- Parameters:
aValue
- value to be set on the parent object, it must comply with the data model definition of this node; if it specifiesmaxOccurs > 1
, the specified value must be aList
.aContainerOccurrence
- parent object to be modified, it must be an occurrence complying with the data model definition of the parent node; the parent node must be a complex type; if it specifiesmaxOccurs > 1
, the specified object must be an element ofList
, not theList
itself.- Since:
- 5.5.1
- See Also:
-
getFacets
Iterator<SchemaFacet> getFacets()Returns an iterator over thefacets
defined by this data model node.This method can be useful for retrieving all facets of a certain type. For example, using this method to get both the static and dynamic
length
facets on this node.- See Also:
-
getFacetOnMandatoryField
SchemaFacetOnMandatoryField getFacetOnMandatoryField()Returns the facet corresponding to the cardinality constraint related to a mandatory field (declares bothminOccurs=1
andmaxOccurs=1
).- Since:
- 6.0.0
- See Also:
-
getFacetLength
SchemaFacetLength getFacetLength()Returns the firstlength
facet declared on this node. Returnsnull
if the node has nolength
facets defined.If multiple
length
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetMaxLength
SchemaFacetMaxLength getFacetMaxLength()Returns the firstmaxlength
facet declared on this node. Returnsnull
if the node has nomaxlength
facets defined.If multiple
maxlength
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetMinLength
SchemaFacetMinLength getFacetMinLength()Returns the firstminLength
facet declared on this node. Returnsnull
if the node has nominLength
facets defined.If multiple
minLength
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetMaxBoundaryExclusive
SchemaFacetBoundaryMaxExclusive getFacetMaxBoundaryExclusive()Returns the firstmaxExclusive
facet declared on this node. Returnsnull
if the node has nomaxExclusive
facets defined.If multiple
maxExclusive
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetMaxBoundaryInclusive
SchemaFacetBoundaryMaxInclusive getFacetMaxBoundaryInclusive()Returns the firstmaxInclusive
facet declared on this node. Returnsnull
if the node has nomaxInclusive
facets defined.If multiple
maxInclusive
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetMinBoundaryExclusive
SchemaFacetBoundaryMinExclusive getFacetMinBoundaryExclusive()Returns the firstminExclusive
facet declared on this node. Returnsnull
if the node has nominExclusive
facets defined.If multiple
minExclusive
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetMinBoundaryInclusive
SchemaFacetBoundaryMinInclusive getFacetMinBoundaryInclusive()Returns the firstminInclusive
facet declared on this node. Returnsnull
if the node has nominInclusive
facets defined.If multiple
minInclusive
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetPattern
SchemaFacetPattern getFacetPattern()Returns the firstpattern
facet declared on this node. Returnsnull
if the node has nopattern
facets defined.If multiple
pattern
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetTotalDigits
SchemaFacetTotalDigits getFacetTotalDigits()Returns the firsttotalDigits
facet declared on this node. Returnsnull
if the node has nototalDigits
facets defined.If multiple
totalDigits
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetExcludeValue
SchemaFacetExcludeValue getFacetExcludeValue()Returns the firstexcludeValue
facet declared on this node. Returnsnull
if the node has noexcludeValue
facets defined.If multiple
excludeValue
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetExcludeSegment
SchemaFacetExcludeSegment getFacetExcludeSegment()Returns the firstexcludeSegment
facet declared on this node. Returnsnull
if the node has noexcludeSegment
facets defined.If multiple
excludeSegment
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetFractionDigits
SchemaFacetFractionDigits getFacetFractionDigits()Returns the firstfractionDigits
facet declared on this node. Returnsnull
if the node has nofractionDigits
facets defined.If multiple
fractionDigits
facets are defined, the methodgetFacets()
can be called instead to retrieve all facets declared on this node.- See Also:
-
getFacetOnTableReference
SchemaFacetTableRef getFacetOnTableReference()Returns theosd:tableRef
facet (foreign key constraint) declared on this node. Returnsnull
if the node does not have a foreign key constraint or if it has errors due to a non-existent container dataset or dataspace. -
getFacetOResource
SchemaFacetOResource getFacetOResource()Returns theOResource
facet held by this node. Returnsnull
if the node does not have anOResource
facet.- See Also:
-
getFacetEnumeration
SchemaFacetEnumeration getFacetEnumeration()Returns the firstenumeration
facet declared on this node. That is, one the following facets:xs:enumeration
,osd:tableRef
,osd:enumeration
,osd:constraintEnumeration
, orosd:constraintNomenclature
(deprecated). Returnsnull
if the node does not define an enumeration. -
getEnumerationList
If the data model specifies an enumeration, returns the values that this node may take on. If no enumeration is specified, this method returnsnull
.When a label is associated with a value, this label may be displayed by invoking
displayOccurrence
.The supported cases are as follows:
Data model definition Result xs:enumeration
For a static enumeration, this method returns the list of static objects defined in the data model. osd:tableRef
For a foreign key constraint, this method returns the list of primary keys defined by the target table, in their String
representation (seePrimaryKey.format()
).osd:enumeration
For a dynamic enumeration, this method returns the list of objects defined by the target node. osd:constraintEnumeration
For a programmatic enumeration constraint, this method returns the list of objects as returned by ConstraintEnumeration.getValues(ValueContext)
.osd:constraintNomenclature
(deprecated)For a programmatic nomenclature constraint, this method returns the list of the values of the nomenclature returned by ConstraintNomenclature.getNomenclature(ValueContext)
.other cases This method returns null
.- Parameters:
aValueContext
- Context containing the enumeration, used when the enumeration to be returned depends on a contextual and dynamic resolution.- See Also:
-
getUniquenessConstraints
List<UniquenessConstraint> getUniquenessConstraints()Returns theuniqueness constraints
applied on this table using the propertyxs:unique
. Returnsnull
if this node is not a table or does not containuniqueness constraints
.- Since:
- 5.8.1
- See Also:
-
getEnumerationNomenclature
Returns the underlyingNomenclature
, if found by searching through facets. If no nomenclature is found, returnsnull
.The supported cases are as follows:
Data model definition Result osd:enumeration
For a dynamic enumeration whose target node itself has a nomenclature, this method returns the nomenclature that corresponds to the values of the target node. osd:constraintNomenclature
(deprecated)For a programmatic nomenclature constraint, this method returns the nomenclature, as returned by ConstraintNomenclature.getNomenclature(ValueContext)
.other cases Returns null
.- Parameters:
aValueContext
- Context containing the nomenclature, used when the nomenclature to be returned depends on a contextual and dynamic resolution.- Returns:
- see table above.
- See Also:
-
isValueFunction
boolean isValueFunction()Returnstrue
if this node holds a function.A function is specified in the data model using an
osd:function
extension.- See Also:
-
isValidationDisabled
boolean isValidationDisabled()Returnstrue
if the validation is disabled on this node.Validation is disabled if this node is computed and defines in the data model the attribute
osd:disableValidation = true
.- Since:
- 5.8.1
- See Also:
-
getInformation
SchemaNodeInformation getInformation()Returns the additional information (elementosd:information
) for this node, as defined in the data model. -
getDefaultViewProperties
SchemaNodeDefaultView getDefaultViewProperties()Returns the default view properties for this node, as defined in the data model (elementosd:defaultView
under the elementxs:annotation/xs:appinfo
).If no default view is specified, this method returns a default
SchemaNodeDefaultView
with the following values:- Since:
- 5.7.1
-
getInheritanceProperties
SchemaInheritanceProperties getInheritanceProperties()Returns the inheritance properties (elementosd:inheritance
) for this node, as defined in the data model. If no inheritance is specified, this method returnsnull
.
-