Package org.basex.query.value.type
Enum Class NodeType
- All Implemented Interfaces:
Serializable,Comparable<NodeType>,java.lang.constant.Constable,Type
XQuery node types.
- Author:
- BaseX Team 2005-21, BSD License, Leo Woerteler
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAttribute type.Comment type.Document type.Document element type.Element type.Namespace type.Node type.PI type.Schema-attribute.Schema-element.Text type. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionfinal AtomTypeatomic()Returns the atomic type.cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified Java value to this type.final Itemcast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified item to this type.final ItemcastString(String value, QueryContext qc, StaticContext sc, InputInfo ii) Casts the specified string to this type.final booleanChecks if this type is equal to the given one.static NodeTypeFinds and returns the specified node type.final Type.IDid()Returns a type id to differentiate all types.final booleaninstanceOf(Type type) Checks if the current type is an instance of the specified type.final TypeComputes the intersection between this type and the given one, i.e.final booleanisNumber()Checks if items with this type are numbers.final booleanChecks if items with this type are numbers or untyped.final booleanChecks if items of this type are sortable.booleanChecks if items of this type are strings or untyped.final booleanChecks if items with this type are untyped.booleanChecks if the type is namespace-sensitive.final QNmqname()Returns the name of a node type.final SeqTypeInternal function for creating a sequence type with the specified occurrence indicator.final StringtoString()final StringReturns a string representation with the specified argument.final TypeComputes the union between this type and the given one, i.e.static NodeTypeReturns the enum constant of this class with the specified name.static NodeType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NODE
Node type. -
TEXT
Text type. -
PROCESSING_INSTRUCTION
PI type. -
ELEMENT
Element type. -
DOCUMENT_NODE
Document type. -
DOCUMENT_NODE_ELEMENT
Document element type. -
ATTRIBUTE
Attribute type. -
COMMENT
Comment type. -
NAMESPACE_NODE
Namespace type. -
SCHEMA_ELEMENT
Schema-element. -
SCHEMA_ATTRIBUTE
Schema-attribute.
-
-
Field Details
-
LEAF_TYPES
Leaf node types.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isNumber
public final boolean isNumber()Description copied from interface:TypeChecks if items with this type are numbers. -
isUntyped
public final boolean isUntyped()Description copied from interface:TypeChecks if items with this type are untyped. -
isNumberOrUntyped
public final boolean isNumberOrUntyped()Description copied from interface:TypeChecks if items with this type are numbers or untyped.- Specified by:
isNumberOrUntypedin interfaceType- Returns:
- result of check
-
isStringOrUntyped
public boolean isStringOrUntyped()Description copied from interface:TypeChecks if items of this type are strings or untyped. Returns if this item is untyped or a string.- Specified by:
isStringOrUntypedin interfaceType- Returns:
- result of check
-
isSortable
public final boolean isSortable()Description copied from interface:TypeChecks if items of this type are sortable.- Specified by:
isSortablein interfaceType- Returns:
- result of check
-
cast
public final Item cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException Description copied from interface:TypeCasts the specified item to this type.- Specified by:
castin interfaceType- Parameters:
item- item to be convertedqc- query contextsc- static contextii- input info- Returns:
- cast value
- Throws:
QueryException- query exception
-
cast
public Item cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException Description copied from interface:TypeCasts the specified Java value to this type.- Specified by:
castin interfaceType- Parameters:
value- Java valueqc- query contextsc- static contextii- input info- Returns:
- cast value
- Throws:
QueryException- query exception
-
castString
public final Item castString(String value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException Description copied from interface:TypeCasts the specified string to this type.- Specified by:
castStringin interfaceType- Parameters:
value- string objectqc- query contextsc- static contextii- input info- Returns:
- cast value
- Throws:
QueryException- query exception
-
seqType
Description copied from interface:TypeInternal function for creating a sequence type with the specified occurrence indicator. -
qname
Returns the name of a node type.- Returns:
- name
-
eq
Description copied from interface:TypeChecks if this type is equal to the given one. -
instanceOf
Description copied from interface:TypeChecks if the current type is an instance of the specified type.- Specified by:
instanceOfin interfaceType- Parameters:
type- type to be checked- Returns:
- result of check
-
union
Description copied from interface:TypeComputes the union between this type and the given one, i.e. the least common ancestor of both types in the type hierarchy. -
intersect
Description copied from interface:TypeComputes the intersection between this type and the given one, i.e. the least specific type that is sub-type of both types. If no such type exists,nullis returned. -
atomic
Description copied from interface:TypeReturns the atomic type. -
id
Description copied from interface:TypeReturns a type id to differentiate all types. -
nsSensitive
public boolean nsSensitive()Description copied from interface:TypeChecks if the type is namespace-sensitive.- Specified by:
nsSensitivein interfaceType- Returns:
- result of check
-
toString
-
toString
Returns a string representation with the specified argument.- Parameters:
arg- argument- Returns:
- string representation
-
find
Finds and returns the specified node type.- Parameters:
name- name of type- Returns:
- type or
null
-