public final class YtbUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PERIOD
Static attribute for a dot string.
|
static String |
STR_NULL
Static attribute for string value having null.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
emptyObjErrMsg(String objName)
Returns string for throwing error when empty object is given as input
to YTB.
|
static Object |
getAttributeFromInheritance(Object childClass,
String methodName)
Returns the object of the declared method in parent class by invoking
through the child class object.
|
static Object |
getAttributeOfObject(Object nodeObj,
String fieldName)
Returns the value of an attribute, in a class object.
|
static Class<?> |
getClassLoaderForAugment(org.onosproject.yangutils.datamodel.YangNode curNode,
YangSchemaRegistry registry)
Returns the registered class from the YSR of the module node where
augment is present.
|
static Class<?> |
getInterfaceClassFromImplClass(Object obj)
Returns interface class from an implementation class object.
|
static String |
getJavaName(Object node)
Returns the java name for the nodes, leaf/leaf-list.
|
static YdtContextOperationType |
getNodeOpType(Object nodeObj,
String typeName)
Returns the operation type value for a class object.
|
static String |
getOpTypeName(org.onosproject.yangutils.datamodel.YangNode curNode)
Returns the name of the operation type variable from the yang name.
|
static Object |
getParentObjectOfNode(YtbNodeInfo nodeInfo,
org.onosproject.yangutils.datamodel.YangNode yangNode)
Returns the object of the node from the node info.
|
static String |
getStringFromType(org.onosproject.yangutils.datamodel.YangSchemaNode holder,
Object holderObj,
String name,
Object fieldObj,
org.onosproject.yangutils.datamodel.YangType dataType)
Returns the string value from the respective data types of the
leaf/leaf-list.
|
static boolean |
isAugmentNode(org.onosproject.yangutils.datamodel.YangNode yangNode)
Returns true, if augment node; false otherwise.
|
static boolean |
isMultiInstanceNode(org.onosproject.yangutils.datamodel.YangNode yangNode)
Returns true, if multi instance node; false otherwise.
|
static boolean |
isNodeProcessCompleted(org.onosproject.yangutils.datamodel.YangNode curNode,
TraversalType curTraversal)
Returns true when the node processing of RPC and notification is
completed; false otherwise.
|
static boolean |
isNonProcessableNode(org.onosproject.yangutils.datamodel.YangNode yangNode)
Returns true, if processing of the node is not required; false otherwise.
|
static boolean |
isTypePrimitive(org.onosproject.yangutils.datamodel.YangType yangType)
Returns true, if data type of leaf is primitive data type; false
otherwise.
|
static String |
isValueOrSelectLeafSet(org.onosproject.yangutils.datamodel.YangSchemaNode holder,
Object nodeObj,
String javaName,
String methodName)
Returns the string true, if the leaf data is actually set; false
otherwise.
|
static boolean |
nonEmpty(Collection<?> c)
Returns true, if the list is not null and non-empty; false otherwise.
|
static boolean |
nonEmpty(String str)
Returns true, if the string is not null and non-empty; false otherwise.
|
public static final String STR_NULL
public static final String PERIOD
public static Object getParentObjectOfNode(YtbNodeInfo nodeInfo, org.onosproject.yangutils.datamodel.YangNode yangNode)
nodeInfo - node info of the holderyangNode - YANG node of the holderpublic static Object getAttributeOfObject(Object nodeObj, String fieldName) throws NoSuchMethodException
nodeObj - object of the nodefieldName - name of the attributeNoSuchMethodException - method not found exceptionpublic static Object getAttributeFromInheritance(Object childClass, String methodName)
childClass - child class which inherits the parent classmethodName - name of the declared methodpublic static Class<?> getInterfaceClassFromImplClass(Object obj)
obj - implementation class objectpublic static YdtContextOperationType getNodeOpType(Object nodeObj, String typeName)
nodeObj - node objecttypeName - data type namepublic static boolean isTypePrimitive(org.onosproject.yangutils.datamodel.YangType yangType)
yangType - leaf typepublic static Class<?> getClassLoaderForAugment(org.onosproject.yangutils.datamodel.YangNode curNode, YangSchemaRegistry registry)
curNode - current augment noderegistry - schema registrypublic static String isValueOrSelectLeafSet(org.onosproject.yangutils.datamodel.YangSchemaNode holder, Object nodeObj, String javaName, String methodName) throws NoSuchMethodException
holder - leaf holdernodeObj - object if the nodejavaName - java name of the leafmethodName - getter method nameNoSuchMethodException - if the method is not presentpublic static String getStringFromType(org.onosproject.yangutils.datamodel.YangSchemaNode holder, Object holderObj, String name, Object fieldObj, org.onosproject.yangutils.datamodel.YangType dataType)
holder - leaf/leaf-list holderholderObj - leaf/leaf-list holder objectname - leaf/leaf-list namefieldObj - object of the leaf/leaf-list fielddataType - type of the leaf/leaf-listpublic static boolean isNonProcessableNode(org.onosproject.yangutils.datamodel.YangNode yangNode)
yangNode - node to be checkedpublic static boolean isMultiInstanceNode(org.onosproject.yangutils.datamodel.YangNode yangNode)
yangNode - YANG nodepublic static boolean isAugmentNode(org.onosproject.yangutils.datamodel.YangNode yangNode)
yangNode - YANG nodepublic static String emptyObjErrMsg(String objName)
objName - name of the objectpublic static String getJavaName(Object node)
node - YANG nodepublic static boolean nonEmpty(Collection<?> c)
c - collection objectpublic static boolean nonEmpty(String str)
str - string valuepublic static boolean isNodeProcessCompleted(org.onosproject.yangutils.datamodel.YangNode curNode,
TraversalType curTraversal)
curNode - current nodecurTraversal - current traversal of the nodepublic static String getOpTypeName(org.onosproject.yangutils.datamodel.YangNode curNode)
curNode - YANG node