jd.xml.xslt.parser
Class TextContentBuilder

java.lang.Object
  extended byjd.xml.xslt.parser.TextContentBuilder
All Implemented Interfaces:
TemplateVisitor

public class TextContentBuilder
extends Object
implements TemplateVisitor

A template visitor used to retrieve the text content of a template.


Constructor Summary
TextContentBuilder()
           
 
Method Summary
 void applyImports(TemplateRuleList rules, Variable[] params, int maxImportPrecedence)
           
 void applyTemplates(TemplateRuleList rules, Expression select, Sort sort, Variable[] params)
           
 void attribute(AttributeValue computedName, AttributeValue computedUri, NamespaceContext namespaceContext, String stringValue, Template templateValue)
           
 void attribute(String name, String prefix, String uri, AttributeValue value)
           
 void buildText(Template template)
           
 void callTemplate(TemplateRule templateRule, Variable[] params, int suppliedParamCount, boolean isTailRecursive)
           
 void choose(Condition[] when, Template otherwise)
           
 void comment(Template content)
           
 void condition(Expression test, Template content)
           
 void copy(AttributeSet[] attributeSets, Template content)
           
 void copyOf(Expression select)
           
 void document(String xslUri, AttributeValue href, OutputFormatTemplate format, Template template)
           
 void endElement()
           
 void fallback(Template content)
           
 void forEach(Expression select, Sort sort, Template content)
           
 String getText()
          Return the text content
 Expression getTextExpression()
          Return the text expression
 boolean hasCompleteText()
          Return if the Builder has collected the complete text.
 boolean hasNonTextContent()
          Return if other nodes than text were encountered.
 boolean hasTextExpression()
          Return if the content only consists of a value-of expression.
 void message(Template content, boolean terminate)
           
 void number(Numbering numbering)
           
 void processingInstruction(AttributeValue name, Template content)
           
 void startElement(AttributeValue computedName, AttributeValue computedUri, NamespaceContext namespaceContext, AttributeSet[] attributeSets)
           
 void startElement(NodeName nodeName, NamespaceContext namespaceContext, AttributeSet[] attributeSets, LiteralAttribute attribute)
          Start a literal element.
 void text(String text, boolean disableOutputEscaping)
           
 void tryCatch(Template tryTemplate, Template catchTemplate)
           
 void unknown(String name, Template content)
           
 void valueOf(Expression expr, boolean disableOutputEscaping)
           
 void variableBind(Variable variable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextContentBuilder

public TextContentBuilder()
Method Detail

buildText

public void buildText(Template template)

hasCompleteText

public boolean hasCompleteText()
Return if the Builder has collected the complete text. The text can be retrieved with getText()

See Also:
getText()

getText

public String getText()
Return the text content


hasNonTextContent

public boolean hasNonTextContent()
Return if other nodes than text were encountered.


hasTextExpression

public boolean hasTextExpression()
Return if the content only consists of a value-of expression.

See Also:
getTextExpression()

getTextExpression

public Expression getTextExpression()
Return the text expression


applyImports

public void applyImports(TemplateRuleList rules,
                         Variable[] params,
                         int maxImportPrecedence)
Specified by:
applyImports in interface TemplateVisitor

applyTemplates

public void applyTemplates(TemplateRuleList rules,
                           Expression select,
                           Sort sort,
                           Variable[] params)
Specified by:
applyTemplates in interface TemplateVisitor

attribute

public void attribute(String name,
                      String prefix,
                      String uri,
                      AttributeValue value)
Specified by:
attribute in interface TemplateVisitor

attribute

public void attribute(AttributeValue computedName,
                      AttributeValue computedUri,
                      NamespaceContext namespaceContext,
                      String stringValue,
                      Template templateValue)
Specified by:
attribute in interface TemplateVisitor

callTemplate

public void callTemplate(TemplateRule templateRule,
                         Variable[] params,
                         int suppliedParamCount,
                         boolean isTailRecursive)
Specified by:
callTemplate in interface TemplateVisitor

choose

public void choose(Condition[] when,
                   Template otherwise)
Specified by:
choose in interface TemplateVisitor

comment

public void comment(Template content)
Specified by:
comment in interface TemplateVisitor

condition

public void condition(Expression test,
                      Template content)
Specified by:
condition in interface TemplateVisitor

copy

public void copy(AttributeSet[] attributeSets,
                 Template content)
Specified by:
copy in interface TemplateVisitor

copyOf

public void copyOf(Expression select)
Specified by:
copyOf in interface TemplateVisitor

document

public void document(String xslUri,
                     AttributeValue href,
                     OutputFormatTemplate format,
                     Template template)
Specified by:
document in interface TemplateVisitor

endElement

public void endElement()
Specified by:
endElement in interface TemplateVisitor

fallback

public void fallback(Template content)
Specified by:
fallback in interface TemplateVisitor

forEach

public void forEach(Expression select,
                    Sort sort,
                    Template content)
Specified by:
forEach in interface TemplateVisitor

message

public void message(Template content,
                    boolean terminate)
Specified by:
message in interface TemplateVisitor

number

public void number(Numbering numbering)
Specified by:
number in interface TemplateVisitor

processingInstruction

public void processingInstruction(AttributeValue name,
                                  Template content)
Specified by:
processingInstruction in interface TemplateVisitor

startElement

public void startElement(AttributeValue computedName,
                         AttributeValue computedUri,
                         NamespaceContext namespaceContext,
                         AttributeSet[] attributeSets)
Specified by:
startElement in interface TemplateVisitor

startElement

public void startElement(NodeName nodeName,
                         NamespaceContext namespaceContext,
                         AttributeSet[] attributeSets,
                         LiteralAttribute attribute)
Start a literal element.

Specified by:
startElement in interface TemplateVisitor

text

public void text(String text,
                 boolean disableOutputEscaping)
Specified by:
text in interface TemplateVisitor

tryCatch

public void tryCatch(Template tryTemplate,
                     Template catchTemplate)
Specified by:
tryCatch in interface TemplateVisitor

unknown

public void unknown(String name,
                    Template content)
Specified by:
unknown in interface TemplateVisitor

valueOf

public void valueOf(Expression expr,
                    boolean disableOutputEscaping)
Specified by:
valueOf in interface TemplateVisitor

variableBind

public void variableBind(Variable variable)
Specified by:
variableBind in interface TemplateVisitor