public abstract class YdtNode<T> extends Object implements YdtExtendedContext, Cloneable
| Modifier and Type | Method and Description |
|---|---|
void |
addAppInfo(AppType appType,
Object object)
Sets application stored information.
|
void |
addChild(YdtContext newChild,
boolean isAtomic)
Adds a child node.
|
void |
addValue(String value)
Adds the given value to the non single instance leaf node.
|
void |
addValueSet(Set<String> valueSet)
Adds the given valueSet to the non multi instance leaf node.
|
void |
addValueSetWithoutValidation(Set<String> valueSet)
Adds the given valueSet to the non multi instance leaf node.
|
void |
addValueWithoutValidation(String value,
boolean isKeyLeaf)
Adds the given value to the non single instance leaf node.
|
YdtNode |
clone()
Clones the current node contents and create a new node.
|
void |
createKeyNodeList()
Creates the list of key element's of multi instance node.
|
boolean |
getAppContextSwitch()
Returns the flag for node if context switch.
|
Object |
getAppInfo(AppType appType)
Returns the application stored information.
|
YdtContext |
getClonedNode()
Returns the cloned ydt node.
|
YdtNode |
getCollidingChild(org.onosproject.yangutils.datamodel.YangSchemaNodeIdentifier id)
Returns already existing YdtNode in Ydt tree with same nodeIdentifier.
|
YdtNode |
getFirstChild()
Returns the context of first child.
|
YdtNode |
getLastChild()
Returns the context of last child.
|
String |
getModuleNameAsNameSpace()
Returns module name as namespace.
|
String |
getName()
Returns the node name.
|
String |
getNamespace()
Returns the node namespace.
|
YdtNode |
getNextSibling()
Returns the context of next sibling.
|
YdtNode |
getParent()
Returns the context of parent node.
|
YdtNode |
getPreviousSibling()
Returns the previous sibling of a node.
|
org.onosproject.yangutils.datamodel.YangSchemaNodeContextInfo |
getSchemaNodeContextInfo(org.onosproject.yangutils.datamodel.YangSchemaNodeIdentifier id)
Returns child schema node context information.
|
String |
getValue()
Returns value of node, this is only valid for single instance leaf
node, to obtain the nature of the node protocols need to use
getYdtType().
|
Set<String> |
getValueSet()
Returns set of values of a node, this is only valid for multi instance
leaf node, to obtain the nature of the node protocols need to use
getYdtType().
|
org.onosproject.yangutils.datamodel.YangSchemaNode |
getYangSchemaNode()
Returns schema node from data model for curNode.
|
<T> T |
getYdtContextExtendedInfo()
Returns the YDT node extended context information corresponding to YDT
node.
|
YdtContextOperationType |
getYdtContextOperationType()
Returns YDT current extended context operation type.
|
YdtExtendedInfoType |
getYdtExtendedInfoType()
Returns YANG data tree extended information type.
|
YdtType |
getYdtType()
Returns the type of YDT entity.
|
void |
setAppContextSwitch()
Sets the flag to keep the track of context switch.
|
void |
setChild(YdtNode child)
Sets the first instance of a child node.
|
void |
setClonedNode(YdtContext clonedNode)
Sets the cloned node.
|
void |
setLastChild(YdtNode child)
Sets the last instance of a child node.
|
void |
setNextSibling(YdtNode sibling)
Sets the next sibling of node.
|
void |
setParent(YdtNode parent)
Sets the parent of node.
|
void |
setPreviousSibling(YdtNode previousSibling)
Sets the previous sibling.
|
void |
setYangSchemaNode(org.onosproject.yangutils.datamodel.YangSchemaNode yangSchemaNode)
Sets the data-model node reference for of a given node.
|
void |
setYdtContextOperationType(YdtContextOperationType opType)
Sets type of yang data tree node operation.
|
void |
validateMultiInstanceNode()
Validates all multi Instance nodes inside current context.
|
public YdtContext getClonedNode()
public void setClonedNode(YdtContext clonedNode)
clonedNode - cloned ydt nodepublic String getName()
YdtContextgetName in interface YdtContextpublic String getNamespace()
YdtContextgetNamespace in interface YdtContextpublic String getModuleNameAsNameSpace()
YdtContextgetModuleNameAsNameSpace in interface YdtContextpublic <T> T getYdtContextExtendedInfo()
YdtContextgetYdtContextExtendedInfo in interface YdtContextT - specifies YMS operation specific extended information
associated with YDT context. It will be
YdtContextOperationType in case extended information type
is EDIT_REQUEST and will be YdtContextResponseInfo in case
extended information type is RESPONSE.public YdtExtendedInfoType getYdtExtendedInfoType()
YdtContextgetYdtExtendedInfoType in interface YdtContextpublic YdtType getYdtType()
YdtContextgetYdtType in interface YdtContextpublic YdtNode getParent()
YdtContextgetParent in interface YdtContextpublic YdtNode getFirstChild()
YdtContextgetFirstChild in interface YdtContextpublic YdtNode getNextSibling()
YdtContextgetNextSibling in interface YdtContextpublic org.onosproject.yangutils.datamodel.YangSchemaNode getYangSchemaNode()
YdtExtendedContextgetYangSchemaNode in interface YdtExtendedContextpublic YdtNode getLastChild()
YdtContextgetLastChild in interface YdtContextpublic Object getAppInfo(AppType appType)
YdtExtendedContextgetAppInfo in interface YdtExtendedContextappType - application typepublic void addAppInfo(AppType appType, Object object)
YdtExtendedContextaddAppInfo in interface YdtExtendedContextappType - application typeobject - application information objectpublic org.onosproject.yangutils.datamodel.YangSchemaNodeContextInfo getSchemaNodeContextInfo(org.onosproject.yangutils.datamodel.YangSchemaNodeIdentifier id)
throws YdtException
id - represents a identifier of YANG data tree nodeYdtException - when user requested node schema doesn't existpublic void addValue(String value) throws YdtException
This default implementation throws an exception stating that the value cannot be added. Subclasses may override this method to provide the correct behavior for their specific implementation.
value - value in a single instance nodeYdtException - when fails to add value for non single instance
leaf nodepublic void createKeyNodeList()
throws YdtException
YdtException - when user requested multi instance node is missing
any of the key element in request or requested
node is of type other then multi instance nodepublic void addValueWithoutValidation(String value, boolean isKeyLeaf) throws YdtException
This default implementation throws an exception stating that the value cannot be added. Subclasses may override this method to provide the correct behavior for their specific implementation. This will be applicable in case of call from SBI so no need to validate the value.
value - value in a single instance leaf nodeisKeyLeaf - true, for key leaf; false non key leafYdtException - when fails to add value for non single instance
leaf nodepublic void addValueSet(Set<String> valueSet) throws YdtException
This default implementation throws an exception stating that the value cannot be added. Subclasses may override this method to provide the correct behavior for their specific implementation.
valueSet - valueSet in a multi instance leaf nodeYdtException - when fails to add value set for non multi instance
leaf nodepublic void addValueSetWithoutValidation(Set<String> valueSet) throws YdtException
This default implementation throws an exception stating that the value cannot be added. Subclasses may override this method to provide the correct behavior for their specific implementation. This will be applicable in case of call from SBI so no need to validate the value.
valueSet - valueSet in a multi instance leaf nodeYdtException - when fails to add value set for non multi instance
leaf nodepublic YdtNode getCollidingChild(org.onosproject.yangutils.datamodel.YangSchemaNodeIdentifier id) throws YdtException
id - represents a identifier of YANG data tree nodeYdtException - when user requested node already part of YDT tree.public void setParent(YdtNode parent)
parent - nodepublic void setChild(YdtNode child)
child - is only child to be setpublic void setNextSibling(YdtNode sibling)
sibling - YANG nodepublic YdtNode getPreviousSibling()
getPreviousSibling in interface YdtContextpublic void setPreviousSibling(YdtNode previousSibling)
previousSibling - points to predecessor siblingpublic String getValue() throws YdtException
YdtContextgetValue in interface YdtContextYdtExceptionpublic Set<String> getValueSet() throws YdtException
YdtContextgetValueSet in interface YdtContextYdtExceptionpublic void setYangSchemaNode(org.onosproject.yangutils.datamodel.YangSchemaNode yangSchemaNode)
yangSchemaNode - YANG data nodepublic void setLastChild(YdtNode child)
child - is last child to be setpublic void addChild(YdtContext newChild, boolean isAtomic) throws YdtException
newChild - refers to a new child to be addedisAtomic - boolean flag to maintain atomicity of the current nodeYdtException - in case of violation of any YDT rulepublic YdtContextOperationType getYdtContextOperationType()
YdtExtendedContextgetYdtContextOperationType in interface YdtExtendedContextpublic void setYdtContextOperationType(YdtContextOperationType opType)
opType - type of yang data tree node operationpublic boolean getAppContextSwitch()
public void setAppContextSwitch()
public void validateMultiInstanceNode()
throws YdtException
YdtException - when fails to validate multi instance nodepublic YdtNode clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException - clone is not supported
by the referred node