|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jplate.foundation.node.impl.AbstractNode<BC,LC>
org.jplate.foundation.node.impl.defaults.DefaultLeafNode<BC,LC>
BC
- The branch context representing data type stored in branches.LC
- The leaf context representing data type stored in leaves.public class DefaultLeafNode<BC,LC>
Default implementation of LeafNodeIfc. Is not thread-safe with regards to setting and retrieving the context.
Specifying the branch and leaf context defines what object types can be expected for all branches and leaves for self, siblings, parents, etc.Modifications: $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $ $Revision: 479 $ $Author: sfloess $ $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/foundation/node/impl/defaults/DefaultLeafNode.java $
Field Summary | |
---|---|
private LC |
_context
Self's context. |
private org.apache.commons.logging.Log |
_log
Used for logging. |
private static java.lang.String |
PARENT_IS_NULL_MSG
Denotes the parent presented on construction is null. |
private static long |
serialVersionUID
For serialization purposes. |
Constructor Summary | |
---|---|
private |
DefaultLeafNode()
Default constructor not allowed. |
|
DefaultLeafNode(BranchNodeIfc<BC,LC> parent)
Constructor to set the parent. |
|
DefaultLeafNode(BranchNodeIfc<BC,LC> parent,
LC context)
Constructor to set the parent and context. |
Method Summary | |
---|---|
void |
accept(NodeVisitorIfc<BC,LC> nodeVisitor)
Allows visitor to perform operations on self. |
LC |
getContext()
Returns self's context. |
void |
setContext(LC context)
Sets the context of self. |
java.lang.String |
toString()
Returns a stringified version of self. |
java.lang.String |
toString(java.lang.String prepend)
Returns a string representation of self prepending prepend to
each line. |
Methods inherited from class org.jplate.foundation.node.impl.AbstractNode |
---|
getParent, getSource, setSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jplate.foundation.node.NodeIfc |
---|
getParent, getSource, setSource |
Field Detail |
---|
private static final long serialVersionUID
private static final java.lang.String PARENT_IS_NULL_MSG
private final transient org.apache.commons.logging.Log _log
private LC _context
Constructor Detail |
---|
public DefaultLeafNode(BranchNodeIfc<BC,LC> parent, LC context)
parent
- The parent of self.context
- The data associated with self.
java.lang.IllegalArgumentException
- if parent is null.public DefaultLeafNode(BranchNodeIfc<BC,LC> parent)
parent
- The parent of self.
java.lang.IllegalArgumentException
- if parent is null.private DefaultLeafNode()
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String prepend)
prepend
to
each line.
toString
in interface FormattableIfc
prepend
- The text to prepend to each line as defined in the return
value.
prepend
prepended to each line.public void accept(NodeVisitorIfc<BC,LC> nodeVisitor) throws VisitException
visitor
to perform operations on self.
accept
in interface VisitableIfc<NodeVisitorIfc<BC,LC>>
nodeVisitor
- The object who will perform an operation on self.
VisitException
- If any problems arise performing an operation on self.public void setContext(LC context)
setContext
in interface LeafNodeIfc<BC,LC>
context
- The new context.public LC getContext()
getContext
in interface LeafNodeIfc<BC,LC>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |