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

pack-priv final Class Sort

extends Instruction
implements Closure
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xalan.internal.xsltc.compiler.Closure
Imports
com.sun.org.apache.bcel.internal.classfile.Field, com.sun.org.apache.bcel.internal.generic.ALOAD, .ANEWARRAY, .ASTORE, .CHECKCAST, .ConstantPoolGen, .GETFIELD, .ILOAD, .INVOKEINTERFACE, .INVOKESPECIAL, .InstructionHandle, .InstructionList, .LocalVariableGen, .NEW, .NOP, .PUSH, .PUTFIELD, .TABLESWITCH, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .CompareGenerator, .ErrorMsg, .IntType, .MethodGenerator, .NodeSortRecordFactGenerator, .NodeSortRecordGenerator, .StringType, .Type, .TypeCheckError, .Util, com.sun.org.apache.xml.internal.dtm.Axis, java.util.ArrayList, .List

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen

Field Summary

Modifier and TypeField and Description
private AttributeValue
private String
private List<VariableRefBase>
private AttributeValue
private AttributeValue
private boolean
private AttributeValue
private Expression

Constructor Summary

AccessConstructor and Description
pack-priv
Sort()

Method Summary

Modifier and TypeMethod and Description
public void
private static MethodGenerator
compileExtract(List<Sort> sortObjects, NodeSortRecordGenerator sortRecord, ConstantPoolGen cpg, String className)

Compiles a method that overloads NodeSortRecord.extractValueFromDOM()

private static MethodGenerator
compileInit(NodeSortRecordGenerator sortRecord, ConstantPoolGen cpg, String className)

Create a constructor for the new class.

private static String
compileSortRecord(List<Sort> sortObjects, ClassGenerator classGen, MethodGenerator methodGen)

Create a new auxillary class extending NodeSortRecord.

public static void
compileSortRecordFactory(List<Sort> sortObjects, ClassGenerator classGen, MethodGenerator methodGen)

Compiles code that instantiates a NodeSortRecordFactory object which will produce NodeSortRecord objects of a specific type.

public static String
compileSortRecordFactory(List<Sort> sortObjects, ClassGenerator classGen, MethodGenerator methodGen, String sortRecordClass)

public String
getInnerClassName()

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.getInnerClassName.

Returns the name of the auxiliary class or null if this predicate is compiled inside the Translet.

public Closure
getParentClosure()

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.getParentClosure.

Returns a reference to its parent closure or null if outermost.

public boolean
inInnerClass()

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.inInnerClass.

Returns true if this closure is compiled in an inner class (i.e. if this is a real closure).

public void
parseContents(Parser parser)

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

Parse the attributes of the xsl:sort element

private void
public void
translate(ClassGenerator classGen, MethodGenerator methodGen)

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

This method should not produce any code

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

This method compiles code for the select expression for this xsl:sort element.

public static void
translateSortIterator(ClassGenerator classGen, MethodGenerator methodGen, Expression nodeSet, List<Sort> sortObjects)

Compiles code that instantiates a SortingIterator object.

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

These two methods are needed in the static methods that compile the overloaded NodeSortRecord.compareType() and NodeSortRecord.sortOrder()

public Type
typeCheck(SymbolTable stable)

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

Run type checks on the attributes; expression must return a string which we will use as a sort key

Field Detail

_caseOrderback to summary
private AttributeValue _caseOrder
_classNameback to summary
private String _className
_closureVarsback to summary
private List<VariableRefBase> _closureVars
_dataTypeback to summary
private AttributeValue _dataType
_langback to summary
private AttributeValue _lang
_needsSortRecordFactoryback to summary
private boolean _needsSortRecordFactory
_orderback to summary
private AttributeValue _order
_selectback to summary
private Expression _select

Constructor Detail

Sortback to summary
pack-priv Sort()

Method Detail

addVariableback to summary
public void addVariable(VariableRefBase variableRef)

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.addVariable.

Add new variable to the closure.

compileExtractback to summary
private static MethodGenerator compileExtract(List<Sort> sortObjects, NodeSortRecordGenerator sortRecord, ConstantPoolGen cpg, String className)

Compiles a method that overloads NodeSortRecord.extractValueFromDOM()

compileInitback to summary
private static MethodGenerator compileInit(NodeSortRecordGenerator sortRecord, ConstantPoolGen cpg, String className)

Create a constructor for the new class. Updates the reference to the collator in the super calls only when the stylesheet specifies a new language in xsl:sort.

compileSortRecordback to summary
private static String compileSortRecord(List<Sort> sortObjects, ClassGenerator classGen, MethodGenerator methodGen)

Create a new auxillary class extending NodeSortRecord.

compileSortRecordFactoryback to summary
public static void compileSortRecordFactory(List<Sort> sortObjects, ClassGenerator classGen, MethodGenerator methodGen)

Compiles code that instantiates a NodeSortRecordFactory object which will produce NodeSortRecord objects of a specific type.

compileSortRecordFactoryback to summary
public static String compileSortRecordFactory(List<Sort> sortObjects, ClassGenerator classGen, MethodGenerator methodGen, String sortRecordClass)
getInnerClassNameback to summary
public String getInnerClassName()

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.getInnerClassName.

Returns the name of the auxiliary class or null if this predicate is compiled inside the Translet.

getParentClosureback to summary
public Closure getParentClosure()

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.getParentClosure.

Returns a reference to its parent closure or null if outermost.

inInnerClassback to summary
public boolean inInnerClass()

Implements com.sun.org.apache.xalan.internal.xsltc.compiler.Closure.inInnerClass.

Returns true if this closure is compiled in an inner class (i.e. if this is a real closure).

parseContentsback to summary
public void parseContents(Parser parser)

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

Parse the attributes of the xsl:sort element

setInnerClassNameback to summary
private void setInnerClassName(String className)
translateback to summary
public void translate(ClassGenerator classGen, MethodGenerator methodGen)

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

This method should not produce any code

translateCaseOrderback to summary
public void translateCaseOrder(ClassGenerator classGen, MethodGenerator methodGen)
translateLangback to summary
public void translateLang(ClassGenerator classGen, MethodGenerator methodGen)
translateSelectback to summary
public void translateSelect(ClassGenerator classGen, MethodGenerator methodGen)

This method compiles code for the select expression for this xsl:sort element. The method is called from the static code-generating methods in this class.

translateSortIteratorback to summary
public static void translateSortIterator(ClassGenerator classGen, MethodGenerator methodGen, Expression nodeSet, List<Sort> sortObjects)

Compiles code that instantiates a SortingIterator object. This object's constructor needs referencdes to the current iterator and a node sort record producing objects as its parameters.

translateSortOrderback to summary
public void translateSortOrder(ClassGenerator classGen, MethodGenerator methodGen)
translateSortTypeback to summary
public void translateSortType(ClassGenerator classGen, MethodGenerator methodGen)

These two methods are needed in the static methods that compile the overloaded NodeSortRecord.compareType() and NodeSortRecord.sortOrder()

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

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

Run type checks on the attributes; expression must return a string which we will use as a sort key