gnu.kawa.xml
Class AttributeType

java.lang.Object
  extended by gnu.bytecode.Type
      extended by gnu.bytecode.ObjectType
          extended by gnu.kawa.xml.NodeType
              extended by gnu.kawa.xml.AttributeType
All Implemented Interfaces:
TypeValue, AttributePredicate, ItemPredicate, NodePredicate, java.io.Externalizable, java.io.Serializable

public class AttributeType
extends NodeType
implements TypeValue, java.io.Externalizable, AttributePredicate

Matches an attribute name pattern. FIXME: ElementType and AttributeType should both inherit from a common NamedNodeType class.

See Also:
Serialized Form

Field Summary
static ClassType typeAttributeType
           
 
Fields inherited from class gnu.kawa.xml.NodeType
anyNodeTest, ATTRIBUTE_OK, COMMENT_OK, commentNodeTest, DOCUMENT_OK, documentNodeTest, ELEMENT_OK, nodeType, PI_OK, TEXT_OK, textNodeTest, typeKNode, typeNodeType
 
Fields inherited from class gnu.bytecode.ObjectType
flags
 
Fields inherited from class gnu.bytecode.Type
boolean_ctype, boolean_type, booleanValue_method, byte_type, char_type, clone_method, double_type, doubleValue_method, float_type, floatValue_method, int_type, intValue_method, java_lang_Class_type, long_type, longValue_method, neverReturnsType, nullType, number_type, pointer_type, reflectClass, short_type, string_type, throwable_type, toString_method, tostring_type, typeArray0, void_type
 
Constructor Summary
AttributeType(java.lang.String name, Symbol qname)
           
AttributeType(Symbol qname)
           
 
Method Summary
static SeqPosition coerce(java.lang.Object obj, java.lang.String namespaceURI, java.lang.String localName)
           
 java.lang.Object coerceFromObject(java.lang.Object obj)
          Convert an object to a value of this Type.
static SeqPosition coerceOrNull(java.lang.Object obj, java.lang.String namespaceURI, java.lang.String localName)
           
 void emitCoerceFromObject(CodeAttr code)
          Compile (in given method) cast from Object to this Type.
protected  void emitCoerceOrNullMethod(Variable incoming, Compilation comp)
           
 Type getImplementationType()
          The type used to implement types not natively understood by the JVM.
 java.lang.String getLocalName()
           
 java.lang.String getNamespaceURI()
           
 boolean isInstance(AbstractSequence seq, int ipos, java.lang.Object attrType)
           
 boolean isInstance(java.lang.Object obj)
           
 boolean isInstancePos(AbstractSequence seq, int ipos)
           
static AttributeType make(java.lang.String namespaceURI, java.lang.String localName)
           
static AttributeType make(Symbol qname)
           
 void readExternal(java.io.ObjectInput in)
           
 java.lang.String toString()
           
 void writeExternal(java.io.ObjectOutput out)
           
 
Methods inherited from class gnu.kawa.xml.NodeType
coerceForce, coerceOrNull, compare, emitIsInstance, emitTestIf, getConstructor, isInstance
 
Methods inherited from class gnu.bytecode.ObjectType
getInternalName, getMethods, getReflectClass, isExisting, promote, setExisting
 
Methods inherited from class gnu.bytecode.Type
coerceToObject, emitCoerceToObject, emitIsInstance, getName, getSignature, getSize, getSizeInWords, getType, hashCode, isMoreSpecific, isSubtype, isValidJavaTypeName, isVoid, lookupType, lowestCommonSuperType, make, registerTypeForClass, setName, setReflectClass, setSignature, signatureLength, signatureLength, signatureToName, signatureToPrimitive, signatureToType, signatureToType, swappedCompareResult
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gnu.expr.TypeValue
emitIsInstance, emitTestIf, getConstructor
 

Field Detail

typeAttributeType

public static final ClassType typeAttributeType
Constructor Detail

AttributeType

public AttributeType(Symbol qname)

AttributeType

public AttributeType(java.lang.String name,
                     Symbol qname)
Method Detail

make

public static AttributeType make(java.lang.String namespaceURI,
                                 java.lang.String localName)

make

public static AttributeType make(Symbol qname)

getImplementationType

public Type getImplementationType()
Description copied from class: Type
The type used to implement types not natively understood by the JVM. Usually, the identity function. However, a language might handle union types or template types or type expressions calculated at run time. In that case return the type used at the JVM level, and known at compile time.

Specified by:
getImplementationType in interface TypeValue
Overrides:
getImplementationType in class NodeType

getNamespaceURI

public final java.lang.String getNamespaceURI()

getLocalName

public final java.lang.String getLocalName()

emitCoerceFromObject

public void emitCoerceFromObject(CodeAttr code)
Description copied from class: ObjectType
Compile (in given method) cast from Object to this Type.

Overrides:
emitCoerceFromObject in class NodeType

coerceFromObject

public java.lang.Object coerceFromObject(java.lang.Object obj)
Description copied from class: ObjectType
Convert an object to a value of this Type. Throw a ClassCastException when this is not possible.

Overrides:
coerceFromObject in class NodeType

isInstancePos

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

isInstance

public boolean isInstance(AbstractSequence seq,
                          int ipos,
                          java.lang.Object attrType)
Specified by:
isInstance in interface AttributePredicate

isInstance

public boolean isInstance(java.lang.Object obj)
Overrides:
isInstance in class NodeType

coerceOrNull

public static SeqPosition coerceOrNull(java.lang.Object obj,
                                       java.lang.String namespaceURI,
                                       java.lang.String localName)

coerce

public static SeqPosition coerce(java.lang.Object obj,
                                 java.lang.String namespaceURI,
                                 java.lang.String localName)

emitCoerceOrNullMethod

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

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class NodeType
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class NodeType
Throws:
java.io.IOException
java.lang.ClassNotFoundException

toString

public java.lang.String toString()
Overrides:
toString in class NodeType