gnu.kawa.xml

Class ElementType

Implemented Interfaces:
Externalizable, ElementPredicate, Externalizable, ItemPredicate, NodePredicate, TypeValue

public class ElementType
extends NodeType
implements TypeValue, Externalizable, ElementPredicate

Field Summary

static String
MATCH_ANY_LOCALNAME
static Symbol
MATCH_ANY_QNAME
static ElementType
anyElement
static ClassType
typeElementType

Fields inherited from class gnu.kawa.xml.NodeType

ATTRIBUTE_OK, COMMENT_OK, DOCUMENT_OK, ELEMENT_OK, PI_OK, TEXT_OK, anyNodeTest, commentNodeTest, documentNodeTest, nodeType, textNodeTest, typeKNode, typeNodeType

Fields inherited from class gnu.bytecode.ObjectType

flags

Fields inherited from class gnu.bytecode.Type

booleanValue_method, boolean_ctype, boolean_type, byte_type, char_type, clone_method, doubleValue_method, double_type, floatValue_method, float_type, intValue_method, int_type, java_lang_Class_type, longValue_method, long_type, neverReturnsType, nullType, number_type, pointer_type, reflectClass, short_type, string_type, throwable_type, toString_method, tostring_type, typeArray0, void_type

Constructor Summary

ElementType(String name, Symbol qname)
ElementType(Symbol qname)

Method Summary

static KElement
coerce(Object obj, String namespaceURI, String localName)
Object
coerceFromObject(Object obj)
static KElement
coerceOrNull(Object obj, String namespaceURI, String localName)
void
emitCoerceFromObject(CodeAttr code)
protected void
emitCoerceOrNullMethod(Variable incoming, Compilation comp)
Procedure
getConstructor()
Type
getImplementationType()
String
getLocalName()
NamespaceBinding
getNamespaceNodes()
String
getNamespaceURI()
boolean
isInstance(Object obj)
boolean
isInstance(AbstractSequence seq, int ipos, Object elementType)
boolean
isInstancePos(AbstractSequence seq, int ipos)
static ElementType
make(String namespaceURI, String localName)
An element type for match by name.
static ElementType
make(Symbol qname)
void
readExternal(ObjectInput in)
void
setNamespaceNodes(NamespaceBinding bindings)
String
toString()
void
writeExternal(ObjectOutput out)

Methods inherited from class gnu.kawa.xml.NodeType

coerceForce, coerceFromObject, coerceOrNull, compare, emitCoerceFromObject, emitCoerceOrNullMethod, emitIsInstance, emitTestIf, getConstructor, getImplementationType, isInstance, isInstance, isInstancePos, readExternal, toString, writeExternal

Methods inherited from class gnu.bytecode.ObjectType

coerceFromObject, compare, emitCoerceFromObject, getContextClass, getImplementationType, getInternalName, getMethods, getReflectClass, isExisting, isInstance, promote, setExisting

Methods inherited from class gnu.bytecode.Type

coerceFromObject, coerceToObject, compare, emitCoerceFromObject, emitCoerceToObject, emitIsInstance, getImplementationType, getName, getReflectClass, getSignature, getSize, getSizeInWords, getType, hashCode, isInstance, isMoreSpecific, isSubtype, isValidJavaTypeName, isVoid, lookupType, lowestCommonSuperType, make, promote, registerTypeForClass, setName, setReflectClass, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType, swappedCompareResult, toString

Field Details

MATCH_ANY_LOCALNAME

public static final String MATCH_ANY_LOCALNAME

MATCH_ANY_QNAME

public static final Symbol MATCH_ANY_QNAME

anyElement

public static final ElementType anyElement

typeElementType

public static final ClassType typeElementType

Constructor Details

ElementType

public ElementType(String name,
                   Symbol qname)

ElementType

public ElementType(Symbol qname)

Method Details

coerce

public static KElement coerce(Object obj,
                              String namespaceURI,
                              String localName)

coerceFromObject

public Object coerceFromObject(Object obj)
Overrides:
coerceFromObject in interface NodeType

coerceOrNull

public static KElement coerceOrNull(Object obj,
                                    String namespaceURI,
                                    String localName)

emitCoerceFromObject

public void emitCoerceFromObject(CodeAttr code)
Overrides:
emitCoerceFromObject in interface NodeType

emitCoerceOrNullMethod

protected void emitCoerceOrNullMethod(Variable incoming,
                                      Compilation comp)
Overrides:
emitCoerceOrNullMethod in interface NodeType

getConstructor

public Procedure getConstructor()
Specified by:
getConstructor in interface TypeValue
Overrides:
getConstructor in interface NodeType

getImplementationType

public Type getImplementationType()
Specified by:
getImplementationType in interface TypeValue
Overrides:
getImplementationType in interface NodeType

getLocalName

public final String getLocalName()

getNamespaceNodes

public NamespaceBinding getNamespaceNodes()

getNamespaceURI

public final String getNamespaceURI()

isInstance

public boolean isInstance(Object obj)
Overrides:
isInstance in interface NodeType

isInstance

public boolean isInstance(AbstractSequence seq,
                          int ipos,
                          Object elementType)
Specified by:
isInstance in interface ElementPredicate

isInstancePos

public boolean isInstancePos(AbstractSequence seq,
                             int ipos)
Specified by:
isInstancePos in interface ItemPredicate
Overrides:
isInstancePos in interface NodeType

make

public static ElementType make(String namespaceURI,
                               String localName)
An element type for match by name.
Parameters:
namespaceURI - full name of namespace, or null for any namespace.
localName - if null matches any local name; otherwise must be intered, and matches by identity.

make

public static ElementType make(Symbol qname)

readExternal

public void readExternal(ObjectInput in)
            throws IOException,
                   ClassNotFoundException
Overrides:
readExternal in interface NodeType

setNamespaceNodes

public void setNamespaceNodes(NamespaceBinding bindings)

toString

public String toString()
Overrides:
toString in interface NodeType

writeExternal

public void writeExternal(ObjectOutput out)
            throws IOException
Overrides:
writeExternal in interface NodeType