public class DefaultNameSpace extends Object implements NameSpace, Serializable
DefaultNameSpace can be instantiated by any of the following methods:
NameSpace and CharSequence
arguments given to the constructor are also immutable. Subclasses shall make sure that any overridden methods
remain safe to call from multiple threads and do not change any public NameSpace state.DefaultScopedName,
DefaultLocalName,
DefaultTypeName,
DefaultMemberName,
DefaultNameFactory,
Serialized FormDefined in the sis-utility module
| Modifier and Type | Field and Description |
|---|---|
static char |
DEFAULT_SEPARATOR
The default separator, which is
':'. |
| Modifier | Constructor and Description |
|---|---|
protected |
DefaultNameSpace(DefaultNameSpace parent,
CharSequence name,
String headSeparator,
String separator)
Creates a new namespace with the given separator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object object)
Returns
true if this namespace is equal to the given object. |
int |
hashCode()
Returns a hash code value for this namespace.
|
boolean |
isGlobal()
Indicates whether this namespace is a "top level" namespace.
|
GenericName |
name()
Represents the identifier of this namespace.
|
String |
toString()
Returns a JCR-like lexical form representation of this namespace.
|
public static final char DEFAULT_SEPARATOR
':'. The separator is inserted between
the namespace and any generic name in that namespace.protected DefaultNameSpace(DefaultNameSpace parent, CharSequence name, String headSeparator, String separator)
parent - the parent namespace, or null if none.name - the name of the new namespace, usually as a String
or an InternationalString.headSeparator - the separator to insert between the namespace and the
head of any name in that namespace.separator - the separator to insert between the parsed names of any name in that namespace.public boolean isGlobal()
isGlobal in interface NameSpacetrue if this namespace is the global namespace.public GenericName name()
assert name.scope().isGlobal() == true;
name in interface NameSpace@Debug public String toString()
org.apache.sis”,
then this method returns “{org.apache.sis}”.GenericName name = ...; // A name
println("Expanded form = " + name.scope() + name);
However the convention followed by this DefaultNameSpace implementation is not specified in the
NameSpace contract. This implementation follows the JCR convention for debugging convenience,
but applications needing better guarantees should use Names.toExpandedString(GenericName) instead.toString in class ObjectNames.toExpandedString(GenericName)public boolean equals(Object object)
true if this namespace is equal to the given object.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.