xtc.tree
Class Formatting

java.lang.Object
  extended by xtc.tree.Node
      extended by xtc.tree.Annotation
          extended by xtc.tree.Formatting
All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>, Locatable

public abstract class Formatting
extends Annotation

An annotation capturing source code formatting.

Version:
$Revision: 1.2 $
Author:
Robert Grimm

Method Summary
static Formatting after1(Node node, java.lang.Object after)
          Create a formatting annotation.
static Formatting before1(java.lang.Object before, Node node)
          Create a formatting annotation.
 boolean hasTraversal()
          Determine whether this node supports generic traversal of its children.
static Formatting round1(java.lang.Object before, Node node, java.lang.Object after)
          Create a formatting annotation.
static Formatting variable()
          Create a formatting annotation.
 
Methods inherited from class xtc.tree.Annotation
getNode, getTokenText, innerMost, isAnnotation, setNode, strip, toAnnotation
 
Methods inherited from class xtc.tree.Node
add, add, addAll, addAll, addAll, addAll, addAllTo, addNode, contains, get, getBoolean, getBooleanProperty, getGeneric, getList, getLocation, getName, getNode, getProperty, getString, getStringProperty, hasLocation, hasName, hasProperty, hasVariable, indexOf, isEmpty, isGeneric, isList, isToken, iterator, lastIndexOf, properties, remove, removeProperty, set, setLocation, setLocation, setProperty, size, toList, toString, toToken, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

hasTraversal

public boolean hasTraversal()
Description copied from class: Node
Determine whether this node supports generic traversal of its children. The default implementation returns false.

Overrides:
hasTraversal in class Node
Returns:
true if this node supports generic traversal of its children.

before1

public static Formatting before1(java.lang.Object before,
                                 Node node)
Create a formatting annotation. This method returns an annotation supporting generic traversal.

Parameters:
before - The object before the node.
node - The annotated node.
Returns:
The formatting annotation.

after1

public static Formatting after1(Node node,
                                java.lang.Object after)
Create a formatting annotation. This method returns an annotation supporting generic traversal.

Parameters:
node - The annotated node.
after - The object after the node.
Returns:
The formatting annotation.

round1

public static Formatting round1(java.lang.Object before,
                                Node node,
                                java.lang.Object after)
Create a formatting annotation. This method returns an annotation supporting generic traversal.

Parameters:
before - The object before the node.
node - The annotated node.
after - The object after the node.
Returns:
The formatting annotation.

variable

public static Formatting variable()
Create a formatting annotation. This method returns an annotation supporting generic traversal and adding/removing children. All children added before a call to Node.addNode(Node) or Annotation.setNode(Node) are treated as nodes preceding the annotated node, and all children added after such a call are treated as nodes succeeding the annotated node.

Returns:
The formatting annotation.


Copyright © 2012. All Rights Reserved.