public final class SerializersUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
addRootElementWithAnnotation(InputStream inputStream,
List<org.onosproject.yang.runtime.Annotation> protocolAnnotation)
Appends the XML data with root element.
|
static String |
convertRidToUri(org.onosproject.yang.model.ResourceId rid,
org.onosproject.yang.runtime.YangSerializerContext context)
Converts a resource identifier to URI string.
|
static org.onosproject.yang.model.ResourceId.Builder |
convertUriToRid(String uriString,
org.onosproject.yang.runtime.YangSerializerContext context)
Converts a URI string to resource identifier.
|
static org.onosproject.yang.runtime.AnnotatedNodeInfo |
convertXmlAttributesToAnnotations(org.dom4j.Element element,
org.onosproject.yang.model.ResourceId id)
Converts XML atrtibutes into annotated node info.
|
static String |
getLatterSegment(String path,
String splitChar)
Returns the latter segment of a path which is separated by a split char.
|
static String |
getPreSegment(String path,
String splitChar)
Returns the previous segment of a path which is separated by a split char.
|
static List<String> |
urlPathArgsDecode(Iterable<String> paths)
Converts a list of path from the original format to ISO-8859-1 code.
|
public static org.onosproject.yang.runtime.AnnotatedNodeInfo convertXmlAttributesToAnnotations(org.dom4j.Element element,
org.onosproject.yang.model.ResourceId id)
element - XML elementid - resource id of an elementpublic static String addRootElementWithAnnotation(InputStream inputStream, List<org.onosproject.yang.runtime.Annotation> protocolAnnotation) throws org.dom4j.DocumentException, IOException
inputStream - XML dataprotocolAnnotation - list of annoations for root elementorg.dom4j.DocumentException - if root element cannot be createdIOException - if input data cannot be readpublic static org.onosproject.yang.model.ResourceId.Builder convertUriToRid(String uriString, org.onosproject.yang.runtime.YangSerializerContext context)
uriString - given URIcontext - YANG schema context informationpublic static List<String> urlPathArgsDecode(Iterable<String> paths)
paths - the original pathspublic static String getPreSegment(String path, String splitChar)
"foo:bar", ":" to "foo"
path - the original path stringsplitChar - char used to split the pathpublic static String getLatterSegment(String path, String splitChar)
"foo:bar", ":" to "bar"
path - the original path stringsplitChar - char used to split the pathpublic static String convertRidToUri(org.onosproject.yang.model.ResourceId rid, org.onosproject.yang.runtime.YangSerializerContext context)
rid - resource identifiercontext - YANG serializer contextCopyright © 2017. All rights reserved.