org.apache.xalan.xsltc.compiler.util
Class ResultTreeType

java.lang.Object
  extended by org.apache.xalan.xsltc.compiler.util.Type
      extended by org.apache.xalan.xsltc.compiler.util.ResultTreeType
All Implemented Interfaces:
Constants

public final class ResultTreeType
extends Type


Field Summary
private  java.lang.String _methodName
           
 
Fields inherited from class org.apache.xalan.xsltc.compiler.util.Type
Attribute, Boolean, Comment, Element, Int, Node, NodeSet, Object, Processing_Instruction, Real, Reference, ResultTree, Root, String, Text, Void
 
Fields inherited from interface org.apache.xalan.xsltc.compiler.Constants
ABSOLUTE_ITERATOR, ACC_FINAL, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_SUPER, ADD_ATTRIBUTE, ADD_ATTRIBUTE_SIG, ADD_ITERATOR, ADD_ITERATOR_SIG, ADD_PARAMETER, ADD_PARAMETER_SIG, APPLY_TEMPLATES, ATTR_SET_SIG, ATTRIBUTE_LIST_FIELD, ATTRIBUTE_LIST_IMPL_CLASS, ATTRIBUTE_LIST_IMPL_SIG, ATTRIBUTES_SIG, BASIS_LIBRARY_CLASS, BOOLEAN_CLASS, BOOLEAN_VALUE, BOOLEAN_VALUE_SIG, CACHED_NODE_LIST_ITERATOR_CLASS, CHARACTERS, CHARACTERS_SIG, CHARACTERSW, CHARACTERSW_SIG, CLEAR_ATTRIBUTES, CLEAR_ATTRIBUTES_SIG, COLLATOR_CLASS, COLLATOR_SIG, COMPILER_PACKAGE, CURRENT_NODE_LIST_FILTER, CURRENT_NODE_LIST_FILTER_SIG, CURRENT_NODE_LIST_ITERATOR, CURRENT_NODE_LIST_ITERATOR_SIG, DEFAULT_NODE_COUNTER, DEFAULT_NODE_COUNTER_SIG, DOCUMENT_PNAME, DOM_ADAPTER_CLASS, DOM_ADAPTER_SIG, DOM_FIELD, DOM_IMPL, DOM_IMPL_CLASS, DOM_IMPL_SIG, DOM_INTF, DOM_INTF_SIG, DOM_PNAME, DOUBLE_CLASS, DOUBLE_SIG, DOUBLE_VALUE, DOUBLE_VALUE_SIG, DUP_FILTERED_ITERATOR, EMPTYATTR_FIELD, EMPTYSTRING, ERROR, EXPAND_STYLESHEET_QNAME_REF, EXPAND_STYLESHEET_QNAME_SIG, FALLBACK_CLASS, FATAL, FILTER_INTERFACE, FILTER_INTERFACE_SIG, FILTER_ITERATOR, FILTER_STEP_ITERATOR, FORMAT_SYMBOLS_FIELD, GET_ATTRIBUTE_VALUE, GET_ATTRIBUTE_VALUE_SIG, GET_CHILDREN, GET_CHILDREN_SIG, GET_ELEMENT_VALUE, GET_ELEMENT_VALUE_SIG, GET_ITERATOR_SIG, GET_NODE_NAME, GET_NODE_NAME_SIG, GET_NODE_TYPE, GET_NODE_TYPE_SIG, GET_NODE_VALUE, GET_NODE_VALUE_ITERATOR, GET_NODE_VALUE_ITERATOR_SIG, GET_NODE_VALUE_SIG, GET_PARAMETER, GET_PARAMETER_SIG, GET_PARENT, GET_PARENT_SIG, GET_TYPED_CHILDREN, GET_TYPED_CHILDREN_SIG, GET_UNPARSED_ENTITY_URI, GET_UNPARSED_ENTITY_URI_SIG, HAS_ATTRIBUTE, HAS_ATTRIBUTE_SIG, HASIDCALL_INDEX, HASIDCALL_INDEX_SIG, INT_VALUE, INT_VALUE_SIG, INTEGER_CLASS, INTEGER_SIG, INTERNAL, INVOKE_METHOD, ITERATOR_FIELD_SIG, ITERATOR_PNAME, KEY_INDEX_CLASS, KEY_INDEX_ITERATOR_SIG, KEY_INDEX_SIG, LAST_INDEX, LOAD_DOCUMENT_CLASS, LOCALE_CLASS, LOCALE_SIG, LOOKUP_STYLESHEET_QNAME_NS_REF, LOOKUP_STYLESHEET_QNAME_NS_SIG, MAKE_NODE, MAKE_NODE_LIST, MAKE_NODE_LIST_SIG, MAKE_NODE_LIST_SIG2, MAKE_NODE_SIG, MAKE_NODE_SIG2, MATCHING_ITERATOR, MATH_CLASS, MULTI_DOM_CLASS, MULTI_DOM_SIG, NAMES_INDEX, NAMES_INDEX_SIG, NAMESPACE_FEATURE, NAMESPACE_INDEX, NAMESPACE_INDEX_SIG, NEXT, NEXT_SIG, NEXTID, NODE, NODE_COUNTER, NODE_COUNTER_SIG, NODE_FIELD, NODE_FIELD_SIG, NODE_ITERATOR, NODE_ITERATOR_BASE, NODE_ITERATOR_SIG, NODE_PNAME, NODE_SIG, NODE_SORT_FACTORY, NODE_SORT_FACTORY_SIG, NODE_SORT_RECORD, NODE_SORT_RECORD_SIG, NS_ANCESTORS_INDEX_SIG, NTH_ITERATOR_CLASS, OBJECT_CLASS, OBJECT_SIG, ORDER_ITERATOR, ORDER_ITERATOR_SIG, OUTPUT_BASE, OUTPUT_HANDLER, OUTPUT_HANDLER_SIG, POP_PARAM_FRAME, POP_PARAM_FRAME_SIG, POSITION_INDEX, PREFIX_URIS_ARRAY_SIG, PREFIX_URIS_IDX_SIG, PUSH_PARAM_FRAME, PUSH_PARAM_FRAME_SIG, REDIRECT_URI, RESET, RESET_SIG, RTF_INITIAL_SIZE, RUNTIME_NODE_CLASS, RUNTIME_PACKAGE, SAX_IMPL, SAX_IMPL_CLASS, SAX_IMPL_SIG, SET_START_NODE, SET_START_NODE_SIG, SINGLETON_ITERATOR, SORT_ITERATOR, SORT_ITERATOR_SIG, STATIC_CHAR_DATA_FIELD, STATIC_CHAR_DATA_FIELD_SIG, STATIC_NAMES_ARRAY_FIELD, STATIC_NAMESPACE_ARRAY_FIELD, STATIC_NS_ANCESTORS_ARRAY_FIELD, STATIC_PREFIX_URIS_ARRAY_FIELD, STATIC_PREFIX_URIS_IDX_ARRAY_FIELD, STATIC_TYPES_ARRAY_FIELD, STATIC_URIS_ARRAY_FIELD, STEP_ITERATOR_CLASS, STREAM_XML_OUTPUT, STRING, STRING_BUFFER_CLASS, STRING_BUFFER_SIG, STRING_CLASS, STRING_SIG, STRING_TO_INT, STRING_TO_INT_SIG, STRING_TO_REAL, STRING_TO_REAL_SIG, STRING_VALUE_HANDLER, STRING_VALUE_HANDLER_SIG, STRING_WRITER, STRIP_SPACE, STRIP_SPACE_INTF, STRIP_SPACE_PARAMS, STRIP_SPACE_SIG, TRANSLET_CLASS, TRANSLET_FIELD, TRANSLET_FIELD_SIG, TRANSLET_INTF, TRANSLET_INTF_SIG, TRANSLET_OUTPUT_BASE, TRANSLET_OUTPUT_INTERFACE, TRANSLET_OUTPUT_PNAME, TRANSLET_OUTPUT_SIG, TRANSLET_PNAME, TRANSLET_SIG, TRANSLET_URI, TRANSLET_VERSION_INDEX, TRANSLET_VERSION_INDEX_SIG, TYPES_INDEX, TYPES_INDEX_SIG, UNION_ITERATOR_CLASS, UNION_ITERATOR_SIG, UNSUPPORTED, URIS_INDEX, URIS_INDEX_SIG, WARNING, WRITER_SIG, XHTML_URI, XMLNS_PREFIX, XMLNS_STRING, XMLNS_URI, XSLT_PACKAGE, XSLT_URI
 
Constructor Summary
protected ResultTreeType()
           
  ResultTreeType(java.lang.String methodName)
           
 
Method Summary
 java.lang.String getClassName()
          Returns the class name of an internal type's external representation.
 java.lang.String getMethodName()
           
 boolean identicalTo(Type other)
          Returns true if this and other are identical types.
 boolean implementedAsMethod()
          Returns true if this type has no object representaion.
 Instruction LOAD(int slot)
           
 Instruction STORE(int slot)
           
 org.apache.bcel.generic.Type toJCType()
           
 java.lang.String toSignature()
          Returns the signature of an internal type's external representation.
 java.lang.String toString()
          Returns a string representation of this type.
 void translateBox(ClassGenerator classGen, MethodGenerator methodGen)
          Translates an object of this type to its boxed representation.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, BooleanType type)
          Expects an result tree on the stack and pushes a boolean.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, java.lang.Class clazz)
          Translates a result tree to a Java type denoted by clazz.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, NodeSetType type)
          Expects a result tree on the stack and pushes a node-set (iterator).
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ObjectType type)
          Subsume result tree into ObjectType.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, RealType type)
          Expects an result tree on the stack and pushes a real.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, ReferenceType type)
          Expects a result tree on the stack and pushes a boxed result tree.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, StringType type)
          Expects an result tree on the stack and pushes a string.
 void translateTo(ClassGenerator classGen, MethodGenerator methodGen, Type type)
          Translates a result tree to object of internal type type.
 FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, BooleanType type)
          Translates a result tree into a non-synthesized boolean.
 void translateUnBox(ClassGenerator classGen, MethodGenerator methodGen)
          Translates an object of this type to its unboxed representation.
 
Methods inherited from class org.apache.xalan.xsltc.compiler.util.Type
ADD, CMP, distanceTo, DIV, DUP, GE, GT, isNumber, isSimple, LE, LT, MUL, NEG, newObjectType, newObjectType, POP, REM, SUB, translateFrom, translateToDesynthesized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_methodName

private final java.lang.String _methodName
Constructor Detail

ResultTreeType

protected ResultTreeType()

ResultTreeType

public ResultTreeType(java.lang.String methodName)
Method Detail

toString

public java.lang.String toString()
Description copied from class: Type
Returns a string representation of this type.

Specified by:
toString in class Type

identicalTo

public boolean identicalTo(Type other)
Description copied from class: Type
Returns true if this and other are identical types.

Specified by:
identicalTo in class Type

toSignature

public java.lang.String toSignature()
Description copied from class: Type
Returns the signature of an internal type's external representation.

Specified by:
toSignature in class Type

toJCType

public org.apache.bcel.generic.Type toJCType()
Specified by:
toJCType in class Type

getMethodName

public java.lang.String getMethodName()

implementedAsMethod

public boolean implementedAsMethod()
Description copied from class: Type
Returns true if this type has no object representaion. Redefined in ResultTreeType.

Overrides:
implementedAsMethod in class Type

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        Type type)
Translates a result tree to object of internal type type. The translation to int is undefined since result trees are always converted to reals in arithmetic expressions.

Overrides:
translateTo in class Type
Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of the type to translate the result tree to
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        BooleanType type)
Expects an result tree on the stack and pushes a boolean. Translates a result tree to a boolean by first converting it to string.

Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of BooleanType (any)
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        StringType type)
Expects an result tree on the stack and pushes a string.

Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of StringType (any)
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        RealType type)
Expects an result tree on the stack and pushes a real. Translates a result tree into a real by first converting it to string.

Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of RealType (any)
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        ReferenceType type)
Expects a result tree on the stack and pushes a boxed result tree. Result trees are already boxed so the translation is just a NOP.

Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of ReferenceType (any)
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        NodeSetType type)
Expects a result tree on the stack and pushes a node-set (iterator). Note that the produced iterator is an iterator for the DOM that contains the result tree, and not the DOM that is currently in use. This conversion here will therefore not directly work with elements such as and without the DOM parameter/variable being updates as well.

Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of NodeSetType (any)
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        ObjectType type)
Subsume result tree into ObjectType.

See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateToDesynthesized

public FlowList translateToDesynthesized(ClassGenerator classGen,
                                         MethodGenerator methodGen,
                                         BooleanType type)
Translates a result tree into a non-synthesized boolean. It does not push a 0 or a 1 but instead returns branchhandle list to be appended to the false list.

Overrides:
translateToDesynthesized in class Type
Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
type - An instance of BooleanType (any)
See Also:
Type.translateToDesynthesized(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateTo

public void translateTo(ClassGenerator classGen,
                        MethodGenerator methodGen,
                        java.lang.Class clazz)
Translates a result tree to a Java type denoted by clazz. Expects a result tree on the stack and pushes an object of the appropriate type after coercion. Result trees are translated to W3C Node or W3C NodeList and the translation is done via node-set type.

Overrides:
translateTo in class Type
Parameters:
classGen - A BCEL class generator
methodGen - A BCEL method generator
clazz - An reference to the Class to translate to
See Also:
Type.translateTo(org.apache.xalan.xsltc.compiler.util.ClassGenerator, org.apache.xalan.xsltc.compiler.util.MethodGenerator, org.apache.xalan.xsltc.compiler.util.Type)

translateBox

public void translateBox(ClassGenerator classGen,
                         MethodGenerator methodGen)
Translates an object of this type to its boxed representation.

Overrides:
translateBox in class Type

translateUnBox

public void translateUnBox(ClassGenerator classGen,
                           MethodGenerator methodGen)
Translates an object of this type to its unboxed representation.

Overrides:
translateUnBox in class Type

getClassName

public java.lang.String getClassName()
Returns the class name of an internal type's external representation.

Overrides:
getClassName in class Type

LOAD

public Instruction LOAD(int slot)
Overrides:
LOAD in class Type

STORE

public Instruction STORE(int slot)
Overrides:
STORE in class Type