Class AbstractEncapsulatedExpressionStateObject

java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractStateObject
org.eclipse.persistence.jpa.jpql.tools.model.query.AbstractEncapsulatedExpressionStateObject
All Implemented Interfaces:
StateObject
Direct Known Subclasses:
AbstractDoubleEncapsulatedExpressionStateObject, AbstractSingleEncapsulatedExpressionStateObject, AbstractTripleEncapsulatedExpressionStateObject, CoalesceExpressionStateObject

public abstract class AbstractEncapsulatedExpressionStateObject extends AbstractStateObject
This expression handles parsing the identifier followed by an expression encapsulated within parenthesis.

BNF: expression ::= <identifier>(expression)

Since:
2.4
Version:
2.4
See Also:
  • Constructor Details

    • AbstractEncapsulatedExpressionStateObject

      protected AbstractEncapsulatedExpressionStateObject(StateObject parent)
      Creates a new AbstractEncapsulatedExpressionStateObject.
      Parameters:
      parent - The parent of this state object, which cannot be null
      Throws:
      NullPointerException - The given parent cannot be null
  • Method Details

    • getExpression

      public AbstractEncapsulatedExpression getExpression()
      Description copied from interface: StateObject
      Returns the actual parsed object if this StateObject representation of the JPQL query was created by parsing an existing JPQL query.
      Specified by:
      getExpression in interface StateObject
      Overrides:
      getExpression in class AbstractStateObject
      Returns:
      The parsed object when a JPQL query is parsed and converted into a StateObject or null when the JPQL query is manually created (i.e. not from a string)
    • getIdentifier

      public abstract String getIdentifier()
      Returns the JPQL identifier of the expression represented by this AbstractSingleEncapsulatedExpressionStateObject.
      Returns:
      The JPQL identifier that is shown before the left parenthesis
    • toTextEncapsulatedExpression

      protected abstract void toTextEncapsulatedExpression(Appendable writer) throws IOException
      Prints out a string representation of this encapsulated information, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
      Parameters:
      writer - The writer used to print out the string representation of the encapsulated information
      Throws:
      IOException - This should never happens, only required because Appendable is used instead of StringBuilder for instance
    • toTextInternal

      protected void toTextInternal(Appendable writer) throws IOException
      Description copied from class: AbstractStateObject
      Prints out a string representation of this StateObject, which should not be used to define a true string representation of a JPQL query but should be used for debugging purposes.
      Specified by:
      toTextInternal in class AbstractStateObject
      Parameters:
      writer - The writer used to print out the string representation
      Throws:
      IOException - This should never happens, it is only required because Appendable is used instead of any concrete class