Package 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
  Description
  `protected final Map<String,ChildProcessor<ColumnNode>>`
  `byColumnTypeProcessors`
  `protected final Map<NodeType,ChildProcessor<Node>>`
  `byNodeTypeProcessors`
  `protected final Map<String,ChildProcessor<ValueNode>>`
  `byValueTypeProcessors`
  `protected static final Class<?>`
  `DEFAULT_TYPE`
  `protected static final String`
  `DEFAULT_TYPE_NAME`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TypeAwareSQLTreeProcessor()`

- ## Method Summary

  Modifier and Type
  Method
  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 Details

  - ### 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 Details

  - ### TypeAwareSQLTreeProcessor

    public TypeAwareSQLTreeProcessor()

- ## Method Details

  - ### 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)