java.lang.Object
org.apache.xalan.xsltc.compiler.util.Type
All Implemented Interfaces:
org.apache.bcel.generic.InstructionConstants, Constants
Direct Known Subclasses:
BooleanType, MethodType, NodeSetType, NodeType, NumberType, ObjectType, ReferenceType, ResultTreeType, StringType, VoidType

public abstract class Type extends Object implements Constants
Author:
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen
  • Field Details

    • Int

      public static final Type Int
    • Real

      public static final Type Real
    • Boolean

      public static final Type Boolean
    • NodeSet

      public static final Type NodeSet
    • String

      public static final Type String
    • ResultTree

      public static final Type ResultTree
    • Reference

      public static final Type Reference
    • Void

      public static final Type Void
    • Object

      public static final Type Object
    • Node

      public static final Type Node
    • Root

      public static final Type Root
    • Element

      public static final Type Element
    • Attribute

      public static final Type Attribute
    • Text

      public static final Type Text
    • Comment

      public static final Type Comment
    • Processing_Instruction

      public static final Type Processing_Instruction
  • Constructor Details

    • Type

      public Type()
  • Method Details

    • newObjectType

      public static Type newObjectType(String javaClassName)
      Factory method to instantiate object types. Returns a pre-defined instance for "java.lang.Object" and "java.lang.String".
    • newObjectType

      public static Type newObjectType(Class clazz)
      Factory method to instantiate object types. Returns a pre-defined instance for java.lang.Object.class and java.lang.String.class.
    • toString

      public abstract String toString()
      Returns a string representation of this type.
      Overrides:
      toString in class Object
    • identicalTo

      public abstract boolean identicalTo(Type other)
      Returns true if this and other are identical types.
    • isNumber

      public boolean isNumber()
      Returns true if this type is a numeric type. Redefined in NumberType.
    • implementedAsMethod

      public boolean implementedAsMethod()
      Returns true if this type has no object representaion. Redefined in ResultTreeType.
    • isSimple

      public boolean isSimple()
      Returns true if this type is a simple type. Redefined in NumberType, BooleanType and StringType.
    • toJCType

      public abstract org.apache.bcel.generic.Type toJCType()
    • distanceTo

      public int distanceTo(Type type)
      Returns the distance between two types. This measure is used to select overloaded functions/operators. This method is typically redefined by the subclasses.
    • toSignature

      public abstract String toSignature()
      Returns the signature of an internal type's external representation.
    • translateTo

      public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, Type type)
      Translates an object of this type to an object of type type. Expects an object of the former type and pushes an object of the latter.
    • translateToDesynthesized

      public FlowList translateToDesynthesized(ClassGenerator classGen, MethodGenerator methodGen, Type type)
      Translates object of this type to an object of type type. Expects an object of the former type and pushes an object of the latter if not boolean. If type type is boolean then a branchhandle list (to be appended to the false list) is returned.
    • translateToDesynthesized

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

      public void translateTo(ClassGenerator classGen, MethodGenerator methodGen, Class clazz)
      Translates an object of this type to the external (Java) type denoted by clazz. This method is used to translate parameters when external functions are called.
    • translateFrom

      public void translateFrom(ClassGenerator classGen, MethodGenerator methodGen, Class clazz)
      Translates an external (Java) type denoted by clazz to an object of this type. This method is used to translate return values when external functions are called.
    • translateBox

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

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

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

      public org.apache.bcel.generic.Instruction ADD()
    • SUB

      public org.apache.bcel.generic.Instruction SUB()
    • MUL

      public org.apache.bcel.generic.Instruction MUL()
    • DIV

      public org.apache.bcel.generic.Instruction DIV()
    • REM

      public org.apache.bcel.generic.Instruction REM()
    • NEG

      public org.apache.bcel.generic.Instruction NEG()
    • LOAD

      public org.apache.bcel.generic.Instruction LOAD(int slot)
    • STORE

      public org.apache.bcel.generic.Instruction STORE(int slot)
    • POP

      public org.apache.bcel.generic.Instruction POP()
    • GT

      public org.apache.bcel.generic.BranchInstruction GT(boolean tozero)
    • GE

      public org.apache.bcel.generic.BranchInstruction GE(boolean tozero)
    • LT

      public org.apache.bcel.generic.BranchInstruction LT(boolean tozero)
    • LE

      public org.apache.bcel.generic.BranchInstruction LE(boolean tozero)
    • CMP

      public org.apache.bcel.generic.Instruction CMP(boolean less)
    • DUP

      public org.apache.bcel.generic.Instruction DUP()