public enum NodeType extends Enum<NodeType> implements Type
Enum Constant and Description |
---|
ATT
Attribute type.
|
COM
Comment type.
|
DEL
Document element type.
|
DOC
Document type.
|
ELM
Element type.
|
NOD
Node type.
|
NSP
Namespace type.
|
PI
PI type.
|
SCA
Schema-attribute.
|
SCE
Schema-element.
|
TXT
Text type.
|
Modifier and Type | Method and Description |
---|---|
Item |
cast(Item item,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts the specified item to this item type.
|
Item |
cast(Object value,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts the specified Java value to this item type.
|
Item |
castString(String value,
QueryContext qc,
StaticContext sc,
InputInfo ii)
Casts the specified string to this item type.
|
boolean |
eq(Type t)
Checks if this type is equal to the given one.
|
static NodeType |
find(QNm type)
Finds and returns the specified node type.
|
Type.ID |
id()
Returns a type id to differentiate all types.
|
boolean |
instanceOf(Type t)
Checks if the current type is an instance of the specified type.
|
NodeType |
intersect(Type t)
Computes the intersection between this type and the given one, i.e. the least
specific type that is sub-type of both types.
|
boolean |
isNumber()
Checks if the type refers to a number.
|
boolean |
isNumberOrUntyped()
Checks if the type refers to a number or an untyped item.
|
boolean |
isStringOrUntyped()
Checks if the type refers to a number or a string.
|
boolean |
isUntyped()
Checks if the type refers to an untyped item.
|
boolean |
nsSensitive()
Checks if the type is namespace-sensitive.
|
SeqType |
seqType()
Returns a sequence type with this item type.
|
byte[] |
string()
Returns the string representation of this type.
|
String |
toString() |
Type |
union(Type t)
Computes the union between this type and the given one, i.e. the least common
ancestor of both types in the type hierarchy.
|
static NodeType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NodeType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NodeType NOD
public static final NodeType TXT
public static final NodeType PI
public static final NodeType ELM
public static final NodeType DOC
public static final NodeType DEL
public static final NodeType ATT
public static final NodeType COM
public static final NodeType NSP
public static final NodeType SCE
public static final NodeType SCA
public static NodeType[] values()
for (NodeType c : NodeType.values()) System.out.println(c);
public static NodeType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic final boolean isNumber()
Type
public final boolean isUntyped()
Type
public final boolean isNumberOrUntyped()
Type
isNumberOrUntyped
in interface Type
public boolean isStringOrUntyped()
Type
isStringOrUntyped
in interface Type
public final Item cast(Item item, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
Type
cast
in interface Type
item
- item to be convertedqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic Item cast(Object value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
Type
cast
in interface Type
value
- Java valueqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic final Item castString(String value, QueryContext qc, StaticContext sc, InputInfo ii) throws QueryException
Type
castString
in interface Type
value
- string objectqc
- query contextsc
- static contextii
- input infoQueryException
- query exceptionpublic final SeqType seqType()
Type
public final boolean eq(Type t)
Type
public final boolean instanceOf(Type t)
Type
instanceOf
in interface Type
t
- type to be checkedpublic final Type union(Type t)
Type
public final NodeType intersect(Type t)
Type
null
is
returned.public final Type.ID id()
Type
public final byte[] string()
Type
public final String toString()
public boolean nsSensitive()
Type
nsSensitive
in interface Type
Copyright © 2005–2015 BaseX Team. All rights reserved.