public class DefaultTypeName extends DefaultLocalName implements TypeName
DefaultTypeName
can be instantiated by any of the following methods:
Class
and TypeName
.
When an UML identifier from an OGC standard exists for a given Class
, Apache SIS
uses that identifier prefixed by the "OGC"
namespace.
Note that this is not a standard practice.
A more standard practice would be to use the definition identifiers in OGC namespace
(last column in the table below), but the set of data type identifiers defined by OGC is currently
small and is sometime not an exact match.
Java class | Type name (unofficial) | Definition identifier in OGC namespace |
---|---|---|
InternationalString | OGC:FreeText | |
String | OGC:CharacterString | urn:ogc:def:dataType:OGC::string |
URI | OGC:URI | urn:ogc:def:dataType:OGC::anyURI |
Boolean | OGC:Boolean | urn:ogc:def:dataType:OGC::boolean |
Integer | OGC:Integer | urn:ogc:def:dataType:OGC::nonNegativeInteger |
Double | OGC:Real | |
Date | OGC:DateTime | |
Locale | OGC:PT_Locale | |
Metadata | OGC:MD_Metadata | |
Unknown Java class | class: <the class name> |
DefaultNameFactory.toTypeName(Class)
or toClass()
instead than parsing the name.
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 TypeName
state.DefaultMemberName
,
DefaultNameFactory
,
Serialized FormDefined in the sis-utility
module
Modifier | Constructor and Description |
---|---|
protected |
DefaultTypeName(NameSpace scope,
CharSequence name)
Constructs a type name from the given character sequence.
|
Modifier and Type | Method and Description |
---|---|
static DefaultTypeName |
castOrCopy(TypeName object)
Returns a SIS type name implementation with the values of the given arbitrary implementation.
|
Class<?> |
toClass()
Returns the Java class associated to this type name.
|
castOrCopy, compareTo, depth, equals, getParsedNames, head, scope, tip, toInternationalString, toString
castOrCopy, hashCode, push, toFullyQualifiedName
push, scope, toFullyQualifiedName, toInternationalString
compareTo
protected DefaultTypeName(NameSpace scope, CharSequence name)
scope
- The scope of this name, or null
for a global scope.name
- The local name (never null
).DefaultNameFactory.createTypeName(NameSpace, CharSequence)
public static DefaultTypeName castOrCopy(TypeName object)
null
, then this method returns null
.DefaultTypeName
,
then it is returned unchanged.DefaultTypeName
instance is created
with the same values than the given name.object
- The object to get as a SIS implementation, or null
if none.null
if the argument was null.public Class<?> toClass() throws UnknownNameException
"OGC"
, then:
"CharacterString"
, "Integer"
, "Real"
or other recognized names
(see class javadoc), then the corresponding class is returned.UnknownNameException
is thrown."class"
, then:
Class.forName(String)
, then that class is returned.UnknownNameException
is thrown."OGC"
scope (see above),
then the corresponding class is returned.null
is returned. No exception is thrown because names in the global namespace
could be anything, so we can not be sure that the given name was wrong.null
is returned, since this method can not check the validity of names in other
namespaces.TypeName
,
or null
if there is no mapping from this name to a Java class.UnknownNameException
- if a mapping from this name to a Java class was expected to exist
(typically because of the scope) but the operation failed.Names.toClass(TypeName)
,
DefaultNameFactory.toTypeName(Class)
Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.