FileDocCategorySizeDatePackage
Type.javaAPI DocJava SE 5 API9325Fri Aug 26 14:55:38 BST 2005com.sun.org.apache.xalan.internal.xsltc.compiler.util

Type

public abstract class Type extends Object implements Constants
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen
author
Morten Jorgensen

Fields Summary
public static final Type
Int
public static final Type
Real
public static final Type
Boolean
public static final Type
NodeSet
public static final Type
String
public static final Type
ResultTree
public static final Type
Reference
public static final Type
Void
public static final Type
Object
public static final Type
ObjectString
public static final Type
Node
public static final Type
Root
public static final Type
Element
public static final Type
Attribute
public static final Type
Text
public static final Type
Comment
public static final Type
Processing_Instruction
Constructors Summary
Methods Summary
public com.sun.org.apache.bcel.internal.generic.InstructionADD()

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionCMP(boolean less)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionDIV()

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionDUP()

	return DUP;	// default
    
public com.sun.org.apache.bcel.internal.generic.BranchInstructionGE(boolean tozero)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.BranchInstructionGT(boolean tozero)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.BranchInstructionLE(boolean tozero)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionLOAD(int slot)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.BranchInstructionLT(boolean tozero)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionMUL()

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionNEG()

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionPOP()

	return POP;
    
public com.sun.org.apache.bcel.internal.generic.InstructionREM()

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionSTORE(int slot)

	return null;		// should never be called
    
public com.sun.org.apache.bcel.internal.generic.InstructionSUB()

	return null;		// should never be called
    
public intdistanceTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.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.

	return type == this ? 0 : Integer.MAX_VALUE;
    
public java.lang.StringgetClassName()
Returns the class name of an internal type's external representation.

	return(EMPTYSTRING);
    
public abstract booleanidenticalTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type other)
Returns true if this and other are identical types.

public booleanimplementedAsMethod()
Returns true if this type has no object representaion. Redefined in ResultTreeType.

	return false;
    
public booleanisNumber()
Returns true if this type is a numeric type. Redefined in NumberType.

	return false;
    
public booleanisSimple()
Returns true if this type is a simple type. Redefined in NumberType, BooleanType and StringType.

	return false;
    
public static com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypenewObjectType(java.lang.String javaClassName)
Factory method to instantiate object types. Returns a pre-defined instance for "java.lang.Object" and "java.lang.String".


                       
         
        if (javaClassName == "java.lang.Object") {
            return Type.Object;
        }
        else if (javaClassName == "java.lang.String") {
            return Type.ObjectString;
        }
        else {
            return new ObjectType(javaClassName);
        }
    
public static com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypenewObjectType(java.lang.Class clazz)
Factory method to instantiate object types. Returns a pre-defined instance for java.lang.Object.class and java.lang.String.class.

        if (clazz == java.lang.Object.class) {
            return Type.Object;
        }
        else if (clazz == java.lang.String.class) {
            return Type.ObjectString;
        }
        else {
            return new ObjectType(clazz);
        }
    
public abstract com.sun.org.apache.bcel.internal.generic.TypetoJCType()

public abstract java.lang.StringtoSignature()
Returns the signature of an internal type's external representation.

public abstract java.lang.StringtoString()
Returns a string representation of this type.

public voidtranslateBox(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)
Translates an object of this type to its boxed representation.

	ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
				    toString(), "["+toString()+"]");
	classGen.getParser().reportError(Constants.FATAL, err);
    
public voidtranslateFrom(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, java.lang.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.

	ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
				    clazz.getClass().toString(), toString());
	classGen.getParser().reportError(Constants.FATAL, err);
    
public voidtranslateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.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.

	ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
				    toString(), type.toString());
	classGen.getParser().reportError(Constants.FATAL, err);
    
public voidtranslateTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, java.lang.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.

	ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
				    toString(), clazz.getClass().toString());
	classGen.getParser().reportError(Constants.FATAL, err);
    
public com.sun.org.apache.xalan.internal.xsltc.compiler.FlowListtranslateToDesynthesized(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.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.

	FlowList fl = null;
	if (type == Type.Boolean) {
	    fl = translateToDesynthesized(classGen, methodGen,
					  (BooleanType)type);
	}
	else {
	    translateTo(classGen, methodGen, type);
	}
	return fl;
    
public com.sun.org.apache.xalan.internal.xsltc.compiler.FlowListtranslateToDesynthesized(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.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.

	ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
				    toString(), type.toString());
	classGen.getParser().reportError(Constants.FATAL, err);
	return null;
    
public voidtranslateUnBox(com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator classGen, com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator methodGen)
Translates an object of this type to its unboxed representation.

	ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
				    "["+toString()+"]", toString());
	classGen.getParser().reportError(Constants.FATAL, err);