FileDocCategorySizeDatePackage
VoidType.javaAPI DocJava SE 6 API3011Tue Jun 10 00:22:32 BST 2008com.sun.org.apache.xalan.internal.xsltc.compiler.util

VoidType

public final class VoidType extends Type
author
Jacek Ambroziak
author
Santiago Pericas-Geertsen

Fields Summary
Constructors Summary
protected VoidType()

Methods Summary
public com.sun.org.apache.bcel.internal.generic.InstructionPOP()

        return NOP;
    
public booleanidenticalTo(com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type other)

	return this == other;
    
public com.sun.org.apache.bcel.internal.generic.TypetoJCType()

	return null;	// should never be called
    
public java.lang.StringtoSignature()

	return "V";
    
public java.lang.StringtoString()

	return "void";
    
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 (primitive) Java type into a void. Only an external "void" can be converted to this class.

	if (!clazz.getName().equals("void")) {
	    ErrorMsg err = new ErrorMsg(ErrorMsg.DATA_CONVERSION_ERR,
					toString(), clazz.getName());
	    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 a void into an object of internal type type. This translation is needed when calling external functions that return void.

see
com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo

	if (type == Type.String) {
	    translateTo(classGen, methodGen, (StringType) type);
	}
	else {
	    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, com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType type)
Translates a void into a string by pushing the empty string ''.

see
com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type#translateTo

	final InstructionList il = methodGen.getInstructionList();
	il.append(new PUSH(classGen.getConstantPool(), ""));