java.lang.Object
org.openprovenance.prov.model.Namespace
A class to manipulate Namespaces when creating, serializing and converting prov documents.
- Author:
- Luc Moreau
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanvoidextendWith(Namespace ns) Extends this Namespace with all the prefix/namespace registration of the Namespace received as argument.static NamespacegatherNamespaces(Bundle bundle) static NamespacegatherNamespaces(Bundle bundle, ProvFactory pFactory) static NamespacegatherNamespaces(Document doc) static NamespacelookupPrefix(String prefix) voidqualifiedName(String prefix, String local, ProvFactory pFactory) Creates a qualified name, with given prefix and local name.qualifiedNameToString(QName name) qualifiedNameToString(QName name, Namespace child) qualifiedNameToString(QualifiedName name, Namespace child) static StringvoidvoidregisterDefault(String namespace) voidsetDefaultNamespace(String defaultNamespace) voidstringToQualifiedName(String id, ProvFactory pFactory) stringToQualifiedName(String id, ProvFactory pFactory, boolean isEscaped) toString()voidunregister(String prefix, String namespace) voidunregisterDeafult(String namespace) static Namespace
-
Field Details
-
prefixes
-
namespaces
-
xmlns
- See Also:
-
-
Constructor Details
-
Namespace
public Namespace() -
Namespace
-
Namespace
-
-
Method Details
-
getThreadNamespace
-
withThreadNamespace
-
extendWith
-
setParent
-
getParent
-
addKnownNamespaces
public void addKnownNamespaces() -
getDefaultNamespace
-
setDefaultNamespace
-
getPrefixes
-
getNamespaces
-
check
-
registerDefault
-
register
-
newPrefix
-
unregister
-
unregisterDeafult
-
gatherNamespaces
-
gatherNamespaces
-
gatherNamespaces
-
stringToQualifiedName
-
stringToQualifiedName
-
qualifiedName
Creates a qualified name, with given prefix and local name. The prefix needs to have been pre-registered. Prefix is allowed to be null: in that case, the intended namespace is the default namespace (seegetDefaultNamespace()) which must have been pre-registered.- Parameters:
prefix- the prefix for theQualifiedNamelocal- the local name for theQualifiedNamepFactory- the factory method used to construct theQualifiedName- Returns:
- a
QualifiedName - Throws:
QualifiedNameException- if prefix is not pre-registered.NullPointerException- if prefix is null and defaultnamespace has not been registered.
-
qualifiedNameToStringWithNamespace
-
qualifiedNameToString
-
qualifiedNameToString
-
qualifiedNameToString
- Parameters:
name- the QualifiedName to convert to stringchild- argument used just for the purpose of debugging when throwing an exception- Returns:
- a string representation of the QualifiedName
-
qualifiedNameToString
-
toString
-
lookupPrefix
-