Package org.openprovenance.prov.model
Class DOMProcessing
- java.lang.Object
-
- org.openprovenance.prov.model.DOMProcessing
-
-
Field Summary
Fields Modifier and Type Field Description static DocumentBuilderbuilderstatic StringXSD_NS_FOR_XML
-
Constructor Summary
Constructors Constructor Description DOMProcessing(ProvFactory pFactory)
-
Method Summary
Modifier and Type Method Description StringconvertNsFromXml(String uri)static StringconvertNsToXml(String uri)static ElementmarshalAttribute(Attribute attribute)static ElementmarshalTypedValue(TypedValue attribute, QualifiedName elementName)static ElementnewElement(QualifiedName elementName, String value, QualifiedName type)Creates a DOMElementfor aQualifiedNameand content given by value and typestatic ElementnewElement(QualifiedName qualifiedName, String value, QualifiedName type, String lang)static ElementnewElement(QualifiedName elementName, QualifiedName value)Creates a DOMElementfor aQualifiedNameand content given by valuestatic ElementnewElement(QualifiedName name, Element value)static StringqualifiedNameToString(QName name)static StringqualifiedNameToString(QualifiedName name)QualifiedNamestringToQualifiedName(String str, Element el)Converts a string to a QualifiedName, extracting namespace from the DOM.static voidtrimNode(Node node)AttributeunmarshallAttribute(Element el, ProvFactory pFactory, ValueConverter vconv)static voidwriteDOMToPrinter(Node document, Writer out, boolean formatted)static voidwriteDOMToPrinter(Node document, StreamResult result, boolean formatted)static StringwriteToString(Node toWrite)
-
-
-
Field Detail
-
XSD_NS_FOR_XML
public static final String XSD_NS_FOR_XML
- See Also:
- Constant Field Values
-
builder
public static DocumentBuilder builder
-
-
Constructor Detail
-
DOMProcessing
public DOMProcessing(ProvFactory pFactory)
-
-
Method Detail
-
qualifiedNameToString
public static String qualifiedNameToString(QualifiedName name)
-
stringToQualifiedName
public final QualifiedName stringToQualifiedName(String str, Element el)
Converts a string to a QualifiedName, extracting namespace from the DOM. Ensures that the generated qualified name is properly escaped, according to PROV-N syntax.- Parameters:
str- string to convert to QualifiedNameel- current Element in which this string was found (as attribute or attribute value)- Returns:
- a qualified name
QualifiedName
-
newElement
public static final Element newElement(QualifiedName elementName, QualifiedName value)
Creates a DOMElementfor aQualifiedNameand content given by value- Parameters:
elementName- aQualifiedNameto denote the element namevalue- for the createdElement- Returns:
- a new
Element
-
newElement
public static final Element newElement(QualifiedName elementName, String value, QualifiedName type)
Creates a DOMElementfor aQualifiedNameand content given by value and type- Parameters:
elementName- aQualifiedNameto denote the element namevalue- for the createdElementtype- of the value- Returns:
- a new
Element
-
newElement
public static final Element newElement(QualifiedName qualifiedName, String value, QualifiedName type, String lang)
-
newElement
public static final Element newElement(QualifiedName name, Element value)
-
writeDOMToPrinter
public static void writeDOMToPrinter(Node document, StreamResult result, boolean formatted) throws TransformerConfigurationException, TransformerException
-
writeDOMToPrinter
public static void writeDOMToPrinter(Node document, Writer out, boolean formatted) throws TransformerConfigurationException, TransformerException
-
writeToString
public static String writeToString(Node toWrite) throws TransformerConfigurationException, TransformerException
-
trimNode
public static void trimNode(Node node)
-
marshalTypedValue
public static final Element marshalTypedValue(TypedValue attribute, QualifiedName elementName)
-
unmarshallAttribute
public final Attribute unmarshallAttribute(Element el, ProvFactory pFactory, ValueConverter vconv)
-
-