APIdia Launch Partner
Top Inners Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.compiler

pack-priv Class FunctionCall

extends Expression
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.compiler.GenerateIdCall, com.sun.org.apache.xalan.internal.xsltc.compiler.KeyCall, com.sun.org.apache.xalan.internal.xsltc.compiler.LangCall, com.sun.org.apache.xalan.internal.xsltc.compiler.LastCall, com.sun.org.apache.xalan.internal.xsltc.compiler.NameBase, com.sun.org.apache.xalan.internal.xsltc.compiler.NotCall, com.sun.org.apache.xalan.internal.xsltc.compiler.NumberCall, com.sun.org.apache.xalan.internal.xsltc.compiler.PositionCall, com.sun.org.apache.xalan.internal.xsltc.compiler.RoundCall, com.sun.org.apache.xalan.internal.xsltc.compiler.StartsWithCall, com.sun.org.apache.xalan.internal.xsltc.compiler.StringCall, com.sun.org.apache.xalan.internal.xsltc.compiler.StringLengthCall, com.sun.org.apache.xalan.internal.xsltc.compiler.UnparsedEntityUriCall, com.sun.org.apache.xalan.internal.xsltc.compiler.BooleanCall, com.sun.org.apache.xalan.internal.xsltc.compiler.CastCall, com.sun.org.apache.xalan.internal.xsltc.compiler.CeilingCall, com.sun.org.apache.xalan.internal.xsltc.compiler.ConcatCall, com.sun.org.apache.xalan.internal.xsltc.compiler.ContainsCall, com.sun.org.apache.xalan.internal.xsltc.compiler.CurrentCall, com.sun.org.apache.xalan.internal.xsltc.compiler.DocumentCall, com.sun.org.apache.xalan.internal.xsltc.compiler.ElementAvailableCall, com.sun.org.apache.xalan.internal.xsltc.compiler.FloorCall, com.sun.org.apache.xalan.internal.xsltc.compiler.FormatNumberCall, com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionAvailableCall
Imports
com.sun.org.apache.bcel.internal.generic.ConstantPoolGen, .IFEQ, .INVOKEINTERFACE, .INVOKESPECIAL, .INVOKESTATIC, .INVOKEVIRTUAL, .InstructionConst, .InstructionList, .InvokeInstruction, .LDC, .LocalVariableGen, .NEW, .PUSH, com.sun.org.apache.xalan.internal.utils.ObjectFactory, com.sun.org.apache.xalan.internal.xsltc.compiler.util.BooleanType, .ClassGenerator, .ErrorMsg, .IntType, .MethodGenerator, .MethodType, .MultiHashtable, .ObjectType, .ReferenceType, .Type, .TypeCheckError, java.lang.reflect.Constructor, .Method, .Modifier, java.util.ArrayList, .Collections, .HashMap, .List, .Map, .Objects, jdk.xml.internal.JdkXmlFeatures

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen, Erwin Bolwidt , Todd Miller

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
FunctionCall.JavaType

inner class to used in internal2Java mappings, contains the Java type and the distance between the internal type and the Java type.

Field Summary

Modifier and TypeField and Description
private final List<Expression>
private Constructor<?>
private Method
private MethodType
private String
private Class<?>
private QName
private static final MultiHashtable<Type, FunctionCall.JavaType>
private boolean
private boolean
private int
pack-priv Expression
_thisArgument

Stores reference to object for non-static Java calls

private static final List<Expression>
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
private static final Map<String, String>
private static final Map<String, String>
private static final Map<Class<?>, Type>
protected static final String
protected static final String
protected static final String
protected static final int
protected static final int
protected static final int
protected static final int
private boolean
protected static final String
Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.Expression:
_falseList_trueList_type

Constructor Summary

AccessConstructor and Description
public
FunctionCall(QName fname, List<Expression> arguments)

public

Method Summary

Modifier and TypeMethod and Description
protected final Expression
argument(int i)

protected final Expression
protected final int
private List<Constructor<?>>
findConstructors()

Returns a vector with all constructors named _fname after stripping its namespace or null if no such methods exist.

private List<Method>
findMethods()

Returns a vector with all methods named _fname after stripping its namespace or null if no such methods exist.

private void
public String
private String
getMethodSignature(List<Type> argsType)

Return the signature of the current method

public String
pack-priv static final String
getSignature(Class<?> clazz)

Compute the JVM signature for the class.

pack-priv static final String
getSignature(Method meth)

Compute the JVM method descriptor for the method.

pack-priv static final String
getSignature(Constructor<?> cons)

Compute the JVM constructor descriptor for the constructor.

public boolean
public boolean
protected static String
replaceDash(String name)

To support EXSLT extensions, convert names with dash to allowable Java names: e.g., convert abc-xyz to abcXyz.

protected final void
setArgument(int i, Expression exp)

public void
public String
toString()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.toString.

Returns a string representation of the object.

public void
public void
translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.translateDesynthesized.

Compile the function call and treat as an expression Update true/false-lists.

private void
translateUnallowedExtension(ConstantPoolGen cpg, InstructionList il)

Translate code to call the BasisLibrary.unallowed_extensionF(String) method.

public Type
public List<Type>
typeCheckArgs(SymbolTable stable)

Type check the actual arguments of this function call.

public Type
public Type
typeCheckExternal(SymbolTable stable)

Type check a call to an external (Java) method.

public Type
typeCheckStandard(SymbolTable stable)

Type check a call to a standard function.

Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.Expression:
backPatchFalseListbackPatchTrueListcompiledesynthesizeevaluateAtCompileTimegetFalseListgetTrueListgetTypehasLastCallhasPositionCalllookupPrimopstartIteratorsynthesize

Field Detail

_argumentsback to summary
private final List<Expression> _arguments
_chosenConstructorback to summary
private Constructor<?> _chosenConstructor
_chosenMethodback to summary
private Method _chosenMethod
_chosenMethodTypeback to summary
private MethodType _chosenMethodType
_classNameback to summary
private String _className
_clazzback to summary
private Class<?> _clazz
_fnameback to summary
private QName _fname
_internal2Javaback to summary
private static final MultiHashtable<Type, FunctionCall.JavaType> _internal2Java
_isExtConstructorback to summary
private boolean _isExtConstructor
_isStaticback to summary
private boolean _isStatic
_namespace_formatback to summary
private int _namespace_format
_thisArgumentback to summary
pack-priv Expression _thisArgument

Stores reference to object for non-static Java calls

EMPTY_ARG_LISTback to summary
private static final List<Expression> EMPTY_ARG_LIST
EXSLT_COMMONback to summary
protected static final String EXSLT_COMMON
EXSLT_DATETIMEback to summary
protected static final String EXSLT_DATETIME
EXSLT_MATHback to summary
protected static final String EXSLT_MATH
EXSLT_SETSback to summary
protected static final String EXSLT_SETS
EXSLT_STRINGSback to summary
protected static final String EXSLT_STRINGS
EXT_XALANback to summary
protected static final String EXT_XALAN
EXT_XSLTCback to summary
protected static final String EXT_XSLTC
EXTENSIONFUNCTIONback to summary
private static final Map<String, String> EXTENSIONFUNCTION
EXTENSIONNAMESPACEback to summary
private static final Map<String, String> EXTENSIONNAMESPACE
JAVA2INTERNALback to summary
private static final Map<Class<?>, Type> JAVA2INTERNAL
JAVA_EXT_XALANback to summary
protected static final String JAVA_EXT_XALAN
JAVA_EXT_XALAN_OLDback to summary
protected static final String JAVA_EXT_XALAN_OLD
JAVA_EXT_XSLTCback to summary
protected static final String JAVA_EXT_XSLTC
NAMESPACE_FORMAT_CLASSback to summary
protected static final int NAMESPACE_FORMAT_CLASS
NAMESPACE_FORMAT_CLASS_OR_PACKAGEback to summary
protected static final int NAMESPACE_FORMAT_CLASS_OR_PACKAGE
NAMESPACE_FORMAT_JAVAback to summary
protected static final int NAMESPACE_FORMAT_JAVA
NAMESPACE_FORMAT_PACKAGEback to summary
protected static final int NAMESPACE_FORMAT_PACKAGE
unresolvedExternalback to summary
private boolean unresolvedExternal
XALAN_CLASSPACKAGE_NAMESPACEback to summary
protected static final String XALAN_CLASSPACKAGE_NAMESPACE

Constructor Detail

FunctionCallback to summary
public FunctionCall(QName fname, List<Expression> arguments)
FunctionCallback to summary
public FunctionCall(QName fname)

Method Detail

argumentback to summary
protected final Expression argument(int i)
argumentback to summary
protected final Expression argument()
argumentCountback to summary
protected final int argumentCount()
findConstructorsback to summary
private List<Constructor<?>> findConstructors()

Returns a vector with all constructors named _fname after stripping its namespace or null if no such methods exist.

findMethodsback to summary
private List<Method> findMethods() throws TypeCheckError

Returns a vector with all methods named _fname after stripping its namespace or null if no such methods exist.

generateAddReadsback to summary
private void generateAddReads(ClassGenerator classGen, MethodGenerator methodGen, String clazz)
getClassNameFromUriback to summary
public String getClassNameFromUri(String uri)
getMethodSignatureback to summary
private String getMethodSignature(List<Type> argsType)

Return the signature of the current method

getNameback to summary
public String getName()
getSignatureback to summary
pack-priv static final String getSignature(Class<?> clazz)

Compute the JVM signature for the class.

getSignatureback to summary
pack-priv static final String getSignature(Method meth)

Compute the JVM method descriptor for the method.

getSignatureback to summary
pack-priv static final String getSignature(Constructor<?> cons)

Compute the JVM constructor descriptor for the constructor.

isExtensionback to summary
public boolean isExtension()
isStandardback to summary
public boolean isStandard()
replaceDashback to summary
protected static String replaceDash(String name)

To support EXSLT extensions, convert names with dash to allowable Java names: e.g., convert abc-xyz to abcXyz.

Note

dashes only appear in middle of an EXSLT function or element name.

setArgumentback to summary
protected final void setArgument(int i, Expression exp)
setParserback to summary
public void setParser(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.setParser.

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.setParser.

Set this node's parser. The parser (the XSLT parser) gives this syntax tree node access to the symbol table and XPath parser.

Annotations
@Override
toStringback to summary
public String toString()

Implements abstract com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
translateback to summary
public void translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.translate.

Translate a function call. The compiled code will leave the function's return value on the JVM's stack.

Annotations
@Override
translateDesynthesizedback to summary
public void translateDesynthesized(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.translateDesynthesized.

Compile the function call and treat as an expression Update true/false-lists.

Annotations
@Override
translateUnallowedExtensionback to summary
private void translateUnallowedExtension(ConstantPoolGen cpg, InstructionList il)

Translate code to call the BasisLibrary.unallowed_extensionF(String) method.

typeCheckback to summary
public Type typeCheck(SymbolTable stable) throws TypeCheckError

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Expression.typeCheck.

Type check a function call. Since different type conversions apply, type checking is different for standard and external (Java) functions.

Annotations
@Override
typeCheckArgsback to summary
public List<Type> typeCheckArgs(SymbolTable stable) throws TypeCheckError

Type check the actual arguments of this function call.

typeCheckConstructorback to summary
public Type typeCheckConstructor(SymbolTable stable) throws TypeCheckError
typeCheckExternalback to summary
public Type typeCheckExternal(SymbolTable stable) throws TypeCheckError

Type check a call to an external (Java) method. The method must be static an public, and a legal type conversion must exist for all its arguments and its return type. Every method of name _fname is inspected as a possible candidate.

typeCheckStandardback to summary
public Type typeCheckStandard(SymbolTable stable) throws TypeCheckError

Type check a call to a standard function. Insert CastExprs when needed. If as a result of the insertion of a CastExpr a type check error is thrown, then catch it and re-throw it with a new "this".

com.sun.org.apache.xalan.internal.xsltc.compiler back to summary

pack-priv Class FunctionCall.JavaType

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall.JavaType

inner class to used in internal2Java mappings, contains the Java type and the distance between the internal type and the Java type.

Field Summary

Modifier and TypeField and Description
public int
public Class<?>

Constructor Summary

AccessConstructor and Description
public
JavaType(Class<?> type, int distance)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object query)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

distanceback to summary
public int distance
typeback to summary
public Class<?> type

Constructor Detail

JavaTypeback to summary
public JavaType(Class<?> type, int distance)

Method Detail

equalsback to summary
public boolean equals(Object query)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Annotations
@Override