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

pack-priv final Class Text

extends Instruction
Class Inheritance
Imports
com.sun.org.apache.bcel.internal.generic.ConstantPoolGen, .GETSTATIC, .INVOKEINTERFACE, .InstructionList, .PUSH, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .MethodGenerator, .Util

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private String
private boolean

Constructor Summary

AccessConstructor and Description
public
Text()

Create a blank Text syntax tree node.

public
Text(String
is the text to put in the node.
text
)

Create text syntax tree node.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if this Text node can be
canLoadAsArrayOffsetLength
()

Check whether this Text node can be stored in a char[] in the translet.

protected boolean
contextDependent()

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

Returns true if this expression/instruction depends on the context.

public void
display(int indent)

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

Displays the contents of this syntax tree node (to stdout).

protected String

Returns:

The text wrapped inside this node
getText
()

Returns the text wrapped inside this node

public void
public boolean
public boolean
private static boolean
isWhitespace(char c)

public void
loadAsArrayOffsetLength(ClassGenerator classGen, MethodGenerator methodGen)

Generates code that loads the array that will contain the character data represented by this Text node, followed by the offset of the data from the start of the array, and then the length of the data.

public void
parseContents(Parser parser)

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

Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions).

protected void
setText(String
is the text to wrap inside this node.
text
)

Set the text for this node.

public void
translate(ClassGenerator classGen, MethodGenerator methodGen)

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

Translate this node into JVM bytecodes.

Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction:
typeCheck

Field Detail

_escapingback to summary
private boolean _escaping
_ignoreback to summary
private boolean _ignore
_textback to summary
private String _text
_textElementback to summary
private boolean _textElement

Constructor Detail

Textback to summary
public Text()

Create a blank Text syntax tree node.

Textback to summary
public Text(String text)

Create text syntax tree node.

Parameters
text:String

is the text to put in the node.

Method Detail

canLoadAsArrayOffsetLengthback to summary
public boolean canLoadAsArrayOffsetLength()

Check whether this Text node can be stored in a char[] in the translet. Calling this is precondition to calling loadAsArrayOffsetLength.

Returns:boolean

true if this Text node can be

See Also
loadAsArrayOffsetLength(ClassGenerator, MethodGenerator)
contextDependentback to summary
protected boolean contextDependent()

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

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

Returns true if this expression/instruction depends on the context. By default, every expression/instruction depends on the context unless it overrides this method. Currently used to determine if result trees are compiled using procedures or little DOMs (result tree fragments).

displayback to summary
public void display(int indent)

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

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

Displays the contents of this syntax tree node (to stdout). This method is intended for debugging _only_, and should be overridden by all syntax tree node implementations.

getTextback to summary
protected String getText()

Returns the text wrapped inside this node

Returns:String

The text wrapped inside this node

ignoreback to summary
public void ignore()
isIgnoreback to summary
public boolean isIgnore()
isTextElementback to summary
public boolean isTextElement()
isWhitespaceback to summary
private static boolean isWhitespace(char c)
loadAsArrayOffsetLengthback to summary
public void loadAsArrayOffsetLength(ClassGenerator classGen, MethodGenerator methodGen)

Generates code that loads the array that will contain the character data represented by this Text node, followed by the offset of the data from the start of the array, and then the length of the data. The pre-condition to calling this method is that canLoadAsArrayOffsetLength() returns true.

See Also
canLoadArrayOffsetLength()
parseContentsback to summary
public void parseContents(Parser parser)

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

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

Parse the contents of this syntax tree nodes (child nodes, XPath expressions, patterns and functions). The default behaviour is to parser the syntax tree node's children (since there are no common expressions, patterns, etc. that can be handled in this base class.

setTextback to summary
protected void setText(String text)

Set the text for this node. Appends the given text to any already existing text (using string concatenation, so use only when needed).

Parameters
text:String

is the text to wrap inside this node.

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

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

Doc from com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.translate.

Translate this node into JVM bytecodes.