org.apache.cayenne.access.translator.select

## Class TypeAwareSQLTreeProcessor

- java.lang.Object
- - org.apache.cayenne.access.sqlbuilder.sqltree.SimpleNodeTreeVisitor
  - - org.apache.cayenne.access.translator.select.TypeAwareSQLTreeProcessor

- All Implemented Interfaces:
    NodeTreeVisitor, SQLTreeProcessor
  Direct Known Subclasses:
    MySQLTreeProcessor, PostgreSQLTreeProcessor

      public class TypeAwareSQLTreeProcessor
      extends SimpleNodeTreeVisitor
      implements SQLTreeProcessor

  Since:
    4.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<String,ChildProcessor<ColumnNode>>` | `byColumnTypeProcessors`
    `protected Map<NodeType,ChildProcessor<Node>>` | `byNodeTypeProcessors`
    `protected Map<String,ChildProcessor<ValueNode>>` | `byValueTypeProcessors`
    `protected static Class<?>` | `DEFAULT_TYPE`
    `protected static String` | `DEFAULT_TYPE_NAME`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TypeAwareSQLTreeProcessor()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Optional<Node>` | `defaultProcess(Node parent, Node child, int index)`
    `protected DbAttribute` | `getColumnAttribute(ColumnNode node)`
    `protected ChildProcessor<ColumnNode>` | `getColumnProcessor(DbAttribute attr)`
    `protected static Optional<ObjAttribute>` | `getObjAttributeFor(DbAttribute dbAttribute)`
    `protected DbAttribute` | `getValueAttribute(ValueNode node)`
    `protected ChildProcessor<ValueNode>` | `getValueProcessor(DbAttribute attr)`
    `boolean` | `onChildNodeStart(Node parent, Node child, int index, boolean hasMore)`
    `Node` | `process(Node node)`
    `protected void` | `registerColumnProcessor(Class<?> columnType, ChildProcessor childProcessor)`
    `protected void` | `registerProcessor(NodeType nodeType, ChildProcessor childProcessor)`
    `protected void` | `registerValueProcessor(Class<?> columnType, ChildProcessor childProcessor)`
    `protected static void` | `replaceChild(Node parent, int index, Node newChild)`
    `protected static Node` | `wrapInFunction(Node node, String function)`

    - ### Methods inherited from class org.apache.cayenne.access.sqlbuilder.sqltree.SimpleNodeTreeVisitor

      `onChildNodeEnd, onNodeEnd, onNodeStart`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_TYPE

          protected static final Class<?> DEFAULT_TYPE

    - #### DEFAULT_TYPE_NAME

          protected static final String DEFAULT_TYPE_NAME

    - #### byColumnTypeProcessors

          protected final Map<String,ChildProcessor<ColumnNode>> byColumnTypeProcessors

    - #### byValueTypeProcessors

          protected final Map<String,ChildProcessor<ValueNode>> byValueTypeProcessors

    - #### byNodeTypeProcessors

          protected final Map<NodeType,ChildProcessor<Node>> byNodeTypeProcessors

  - ### Constructor Detail

    - #### TypeAwareSQLTreeProcessor

          public TypeAwareSQLTreeProcessor()

  - ### Method Detail

    - #### process

          public Node process(Node node)

      Specified by:
        `process` in interface `SQLTreeProcessor`

    - #### registerProcessor

          protected void registerProcessor(NodeType nodeType,
                                           ChildProcessor childProcessor)

    - #### registerColumnProcessor

          protected void registerColumnProcessor(Class<?> columnType,
                                                 ChildProcessor childProcessor)

    - #### registerValueProcessor

          protected void registerValueProcessor(Class<?> columnType,
                                                ChildProcessor childProcessor)

    - #### defaultProcess

          protected Optional<Node> defaultProcess(Node parent,
                                                  Node child,
                                                  int index)

    - #### onChildNodeStart

          public boolean onChildNodeStart(Node parent,
                                          Node child,
                                          int index,
                                          boolean hasMore)

      Specified by:
        `onChildNodeStart` in interface `NodeTreeVisitor`
      Overrides:
        `onChildNodeStart` in class `SimpleNodeTreeVisitor`
      Parameters:
        `parent` - node
        `child` - node
        `index` - of this child in parent
        `hasMore` - true if more children after this child
      Returns:
        false if visitor should stop

    - #### getColumnAttribute

          protected DbAttribute getColumnAttribute(ColumnNode node)

    - #### getColumnProcessor

          protected ChildProcessor<ColumnNode> getColumnProcessor(DbAttribute attr)

    - #### getValueAttribute

          protected DbAttribute getValueAttribute(ValueNode node)

    - #### getValueProcessor

          protected ChildProcessor<ValueNode> getValueProcessor(DbAttribute attr)

    - #### replaceChild

          protected static void replaceChild(Node parent,
                                             int index,
                                             Node newChild)

    - #### wrapInFunction

          protected static Node wrapInFunction(Node node,
                                               String function)

    - #### getObjAttributeFor

          protected static Optional<ObjAttribute> getObjAttributeFor(DbAttribute dbAttribute)

Copyright © 2001–2021 Apache Cayenne. All rights reserved.