lux.xpath
Class LiteralExpression

java.lang.Object
  extended by lux.xpath.AbstractExpression
      extended by lux.xpath.LiteralExpression
All Implemented Interfaces:
Visitable

public class LiteralExpression
extends AbstractExpression


Nested Class Summary
 
Nested classes/interfaces inherited from class lux.xpath.AbstractExpression
AbstractExpression.Type
 
Field Summary
static LiteralExpression EMPTY
           
static LiteralExpression ONE
           
 
Fields inherited from class lux.xpath.AbstractExpression
subs, sup
 
Constructor Summary
LiteralExpression(Object value)
           
LiteralExpression(Object value, ValueType valueType)
           
 
Method Summary
 AbstractExpression accept(ExpressionVisitor visitor)
           
 boolean equals(Object other)
           
static void escapeText(String s, StringBuilder buf)
          Append the string to the buffer, with characters escaped appropriately for XML (and XQuery) text.
 int getPrecedence()
           
 Object getValue()
           
 ValueType getValueType()
           
 int hashCode()
           
static void quoteString(String s, StringBuilder buf)
          Append the string to the buffer, escaped as in escapeText(String, StringBuilder), surrounded by double quotes (").
 void toString(StringBuilder buf)
          renders the literal as parseable XQuery.
 
Methods inherited from class lux.xpath.AbstractExpression
acceptSubs, appendSub, getBindingContext, getLastContextStep, getRoot, getSubs, getSuper, getTail, getType, isAbsolute, isDocumentOrdered, replaceRoot, setSubs, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY

public static final LiteralExpression EMPTY

ONE

public static final LiteralExpression ONE
Constructor Detail

LiteralExpression

public LiteralExpression(Object value,
                         ValueType valueType)

LiteralExpression

public LiteralExpression(Object value)
Method Detail

getPrecedence

public int getPrecedence()
Specified by:
getPrecedence in class AbstractExpression
Returns:
100

getValueType

public ValueType getValueType()

getValue

public Object getValue()

toString

public void toString(StringBuilder buf)
renders the literal as parseable XQuery. Note that

Specified by:
toString in class AbstractExpression

escapeText

public static void escapeText(String s,
                              StringBuilder buf)
Append the string to the buffer, with characters escaped appropriately for XML (and XQuery) text. The characters ", &, <, >, {, }, and \r are replaced with character entities or numeric character references.

Parameters:
s - the appended string
buf - the buffer appended to

quoteString

public static void quoteString(String s,
                               StringBuilder buf)
Append the string to the buffer, escaped as in escapeText(String, StringBuilder), surrounded by double quotes (").

Parameters:
s - the appended string
buf - the buffer appended to

accept

public AbstractExpression accept(ExpressionVisitor visitor)

equals

public boolean equals(Object other)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013. All Rights Reserved.