EclipseLink 2.4.2, build 'v20130514-5956486' API Reference

org.eclipse.persistence.jpa.jpql.model
Class BaseJPQLQueryFormatter

java.lang.Object
  extended by org.eclipse.persistence.jpa.jpql.model.BaseJPQLQueryFormatter
All Implemented Interfaces:
IJPQLQueryFormatter, StateObjectVisitor
Direct Known Subclasses:
AbstractActualJPQLQueryFormatter, AbstractJPQLQueryFormatter

public abstract class BaseJPQLQueryFormatter
extends java.lang.Object
implements StateObjectVisitor, IJPQLQueryFormatter

An abstract implementation of a IJPQLQueryFormatter.

Version:
2.4
Author:
Pascal Filion
Since:
2.4

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.eclipse.persistence.jpa.jpql.model.IJPQLQueryFormatter
IJPQLQueryFormatter.IdentifierStyle
 
Field Summary
protected static java.lang.String COMMA
          The constant for a comma: ','.
protected static java.lang.String COMMA_SPACE
          The constant for a comma followed by a space: ', '.
protected static java.lang.String LEFT_PARENTHESIS
          The constant for the left parenthesis: '('.
protected static java.lang.String RIGHT_PARENTHESIS
          The constant for the right parenthesis: ')'.
protected static java.lang.String SPACE
          The constant for a space: '  '.
protected  IJPQLQueryFormatter.IdentifierStyle style
          Determines how the JPQL identifiers are written out.
protected  java.lang.StringBuilder writer
          The holder of the string representation of the JPQL query.
 
Constructor Summary
protected BaseJPQLQueryFormatter(IJPQLQueryFormatter.IdentifierStyle style)
          Creates a new BaseJPQLQueryFormatter.
 
Method Summary
protected  java.lang.String formatIdentifier(java.lang.String identifier)
          Formats the given JPQL identifier, if it needs to be decorated with more information.
 IJPQLQueryFormatter.IdentifierStyle getIdentifierStyle()
          Returns the style to use when formatting the JPQL identifiers.
 java.lang.String toString()
          
 java.lang.String toString(StateObject stateObject)
          Creates a string representation of the given StateObject.
protected  void toText(StateObject stateObject)
          Visits the given StateObject and prevents its decorator to be called, which will prevent any possible recursion when the decorator is outputting the information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.persistence.jpa.jpql.model.query.StateObjectVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 

Field Detail

style

protected final IJPQLQueryFormatter.IdentifierStyle style
Determines how the JPQL identifiers are written out.


writer

protected final java.lang.StringBuilder writer
The holder of the string representation of the JPQL query.


COMMA

protected static final java.lang.String COMMA
The constant for a comma: ','.

See Also:
Constant Field Values

COMMA_SPACE

protected static final java.lang.String COMMA_SPACE
The constant for a comma followed by a space: ', '.

See Also:
Constant Field Values

LEFT_PARENTHESIS

protected static final java.lang.String LEFT_PARENTHESIS
The constant for the left parenthesis: '('.

See Also:
Constant Field Values

RIGHT_PARENTHESIS

protected static final java.lang.String RIGHT_PARENTHESIS
The constant for the right parenthesis: ')'.

See Also:
Constant Field Values

SPACE

protected static final java.lang.String SPACE
The constant for a space: '  '.

See Also:
Constant Field Values
Constructor Detail

BaseJPQLQueryFormatter

protected BaseJPQLQueryFormatter(IJPQLQueryFormatter.IdentifierStyle style)
Creates a new BaseJPQLQueryFormatter.

Parameters:
style - Determines how the JPQL identifiers are written out, which is used if the StateObject was modified after its creation
Throws:
java.lang.NullPointerException - The IdentifierStyle cannot be null
Method Detail

formatIdentifier

protected java.lang.String formatIdentifier(java.lang.String identifier)
Formats the given JPQL identifier, if it needs to be decorated with more information. Which depends on how the string is created.

Parameters:
identifier - JPQL identifier to format
Returns:
By default the given identifier is returned

getIdentifierStyle

public IJPQLQueryFormatter.IdentifierStyle getIdentifierStyle()
Returns the style to use when formatting the JPQL identifiers.

Returns:
One of the possible ways to format the JPQL identifiers

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(StateObject stateObject)
Creates a string representation of the given StateObject.

Specified by:
toString in interface IJPQLQueryFormatter
Parameters:
stateObject - The StateObject that represents a complete or incomplete JPQL query
Returns:
The string representation of the given StateObject

toText

protected void toText(StateObject stateObject)
Visits the given StateObject and prevents its decorator to be called, which will prevent any possible recursion when the decorator is outputting the information.

Parameters:
stateObject - The decorated stateObject to traverse without going through the decorator

EclipseLink 2.4.2, build 'v20130514-5956486' API Reference