public class XmlElement extends XmlTag
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.String,org.w3c.dom.Element> |
_cimPrimitiveUris |
(package private) static XmlElement |
Description
The only used XML element.
|
Constructor and Description |
---|
XmlElement(XmlNs ns,
java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private static org.w3c.dom.Element |
createCimPrimitiveClass(org.w3c.dom.Element root,
java.lang.String about)
RDF uses XSD primitive types and completely ignores those present in CIM.
|
static java.util.List<java.lang.String> |
deduceInverseRoleNames(org.w3c.dom.Element parent)
Tries to deduce the name of the UML inverse association end from different child elements, to
suit different RDF dialects.
|
static java.lang.String |
deducePackageName(org.w3c.dom.Element elem)
Tries to deduce the name of the UML package from different child elements.
|
static java.util.List<java.lang.String> |
deduceRangeNames(org.w3c.dom.Element elem)
Tries to deduce the name of the UML class that is range for a property from different child
elements, to suit different RDF dialects.
|
private static void |
doPrepend(XmlNs ns,
org.w3c.dom.Element elem,
XmlAttribute attr) |
private static void |
doReplace(org.w3c.dom.Element elem,
XmlAttribute attr,
java.lang.String toReplace,
java.lang.String replacement) |
static java.util.List<org.w3c.dom.Element> |
getChildrenWithResource(org.w3c.dom.Element parent,
XmlNs ns)
Returns all child elements of
parent that have 'resource' attribute. |
private static boolean |
hasChildren(org.w3c.dom.Element parent,
XmlChildElement chi) |
private static boolean |
hasChildWithResourceValue(org.w3c.dom.Element parent,
XmlChildElement chi,
XmlResourceValue val) |
static boolean |
isClass(org.w3c.dom.Element parent) |
static boolean |
isCompoundClass(org.w3c.dom.Element parent)
Returns whether
parent is a UML compound class. |
static boolean |
isDatatypeClass(org.w3c.dom.Element parent)
Returns whether
parent is a UML datatype class. |
static boolean |
isEnumClass(org.w3c.dom.Element parent)
Returns whether
parent is a UML enumerated class. |
static boolean |
isEnumLiteral(org.w3c.dom.Element parent) |
static boolean |
isPackage(org.w3c.dom.Element parent) |
static boolean |
isPrimitiveClass(org.w3c.dom.Element parent)
Returns whether
parent is a UML enumerated class. |
static boolean |
isProperty(org.w3c.dom.Element parent) |
static void |
normaliseToRdf(XmlNs ns,
org.w3c.dom.Element parent)
Peforms several potential modifications:
removes "Package_" substring from 'about' attribute of
parent and 'resource'
attribute of its child, when applicable
prepends the URI of ns to 'about' attribute of parent and
'resource' attribute of all its children, if they use default namespace syntax (i.e., start
with "#")
replaces XML primitive types in children with CIM primitive types
|
private static void |
replaceXmlPrimitiveWithCimPrimitiveAndAddItToRoot(XmlNs ns,
org.w3c.dom.Element chi,
org.w3c.dom.Element root) |
static final XmlElement Description
private static java.util.Map<java.lang.String,org.w3c.dom.Element> _cimPrimitiveUris
XmlElement(XmlNs ns, java.lang.String name)
public static java.util.List<org.w3c.dom.Element> getChildrenWithResource(org.w3c.dom.Element parent, XmlNs ns)
parent
that have 'resource' attribute.parent
- parent
that have resource attribute.public static void normaliseToRdf(XmlNs ns, org.w3c.dom.Element parent)
parent
and 'resource'
attribute of its child, when applicablens
to 'about' attribute of parent
and
'resource' attribute of all its children, if they use default namespace syntax (i.e., start
with "#")ns
- namespace, used to prepend its URI.parent
- private static void doReplace(org.w3c.dom.Element elem, XmlAttribute attr, java.lang.String toReplace, java.lang.String replacement)
private static void doPrepend(XmlNs ns, org.w3c.dom.Element elem, XmlAttribute attr)
private static void replaceXmlPrimitiveWithCimPrimitiveAndAddItToRoot(XmlNs ns, org.w3c.dom.Element chi, org.w3c.dom.Element root)
private static org.w3c.dom.Element createCimPrimitiveClass(org.w3c.dom.Element root, java.lang.String about)
about
- about attribute of the primitivepublic static boolean isPackage(org.w3c.dom.Element parent)
public static boolean isClass(org.w3c.dom.Element parent)
public static boolean isProperty(org.w3c.dom.Element parent)
public static boolean isEnumLiteral(org.w3c.dom.Element parent)
private static boolean hasChildWithResourceValue(org.w3c.dom.Element parent, XmlChildElement chi, XmlResourceValue val)
private static boolean hasChildren(org.w3c.dom.Element parent, XmlChildElement chi)
public static boolean isPrimitiveClass(org.w3c.dom.Element parent)
parent
is a UML enumerated class.public static boolean isEnumClass(org.w3c.dom.Element parent)
parent
is a UML enumerated class.public static boolean isCompoundClass(org.w3c.dom.Element parent)
parent
is a UML compound class.public static boolean isDatatypeClass(org.w3c.dom.Element parent)
parent
is a UML datatype class.public static java.util.List<java.lang.String> deduceInverseRoleNames(org.w3c.dom.Element parent)
parent
- Parent element under whose child elements to search for inverse association end
name.public static java.util.List<java.lang.String> deduceRangeNames(org.w3c.dom.Element elem)
elem
- Parent element under whose child elements to search for range name.public static java.lang.String deducePackageName(org.w3c.dom.Element elem)
elem
- Parent element under whose child elements to search for package name.Copyright 2009-2015 Tatjana (Tanja) Kostic