Class AbstractExprNode
- java.lang.Object
-
- org.apache.directory.api.ldap.model.filter.AbstractExprNode
-
- Direct Known Subclasses:
AssertionNode,BranchNode,LeafNode,ObjectClassNode,ScopeNode,UndefinedNode
public abstract class AbstractExprNode extends Object implements ExprNode
Abstract implementation of a expression node.- Author:
- Apache Directory Project
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,Object>annotationsThe map of annotationsprotected AssertionTypeassertionTypeThe node type
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractExprNode(AssertionType assertionType)Creates a node by setting abstract node type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExprNodeclone()Clone the objectbooleanequals(Object o)Objectget(Object key)Gets an annotation on the tree by key.protected Map<String,Object>getAnnotations()Gets the annotations as a Map.AssertionTypegetAssertionType()Gets the assertion type of this node.inthashCode()StringBuilderprintRefinementToBuffer(StringBuilder buf)Default implementation for this method : just throw an exception.voidset(String key, Object value)Sets a annotation key to a value.StringtoString()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.directory.api.ldap.model.filter.ExprNode
accept, isLeaf, isSchemaAware
-
-
-
-
Field Detail
-
assertionType
protected final AssertionType assertionType
The node type
-
-
Constructor Detail
-
AbstractExprNode
protected AbstractExprNode(AssertionType assertionType)
Creates a node by setting abstract node type.- Parameters:
assertionType- The node's type
-
-
Method Detail
-
getAssertionType
public AssertionType getAssertionType()
Description copied from interface:ExprNodeGets the assertion type of this node. Make it possible to use switch statements on the node type.- Specified by:
getAssertionTypein interfaceExprNode- Returns:
- the node's type
- See Also:
ExprNode.getAssertionType()
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classObject- Returns:
trueif both objects are equal- See Also:
Object.equals(Object)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classObject- Returns:
- the instance's hash code
- See Also:
Object.hashCode()
-
get
public Object get(Object key)
Description copied from interface:ExprNodeGets an annotation on the tree by key.- Specified by:
getin interfaceExprNode- Parameters:
key- the annotation key.- Returns:
- the annotation value.
- See Also:
ExprNode.get(java.lang.Object)
-
set
public void set(String key, Object value)
Description copied from interface:ExprNodeSets a annotation key to a value.- Specified by:
setin interfaceExprNode- Parameters:
key- the annotation key.value- the annotation value.- See Also:
ExprNode.set(String, Object)
-
getAnnotations
protected Map<String,Object> getAnnotations()
Gets the annotations as a Map.- Returns:
- the annotation map.
-
printRefinementToBuffer
public StringBuilder printRefinementToBuffer(StringBuilder buf)
Default implementation for this method : just throw an exception.- Specified by:
printRefinementToBufferin interfaceExprNode- Parameters:
buf- the buffer to append to.- Returns:
- The buffer in which the refinement has been appended
- Throws:
UnsupportedOperationException- if this node isn't a part of a refinement.
-
clone
public ExprNode clone()
Clone the object
-
toString
public String toString()
- Overrides:
toStringin classObject- See Also:
Object.toString()
-
-