public abstract class AbstractGeospatialType<T extends Geospatial> extends SingletonPrimitiveType
| Modifier and Type | Field and Description |
|---|---|
protected Geospatial.Dimension |
dimension |
protected FullQualifiedName |
fqn |
protected Geospatial.Type |
type |
protected String |
uriPrefix |
protected String |
uriSuffix |
nameEDM_NAMESPACE| Modifier | Constructor and Description |
|---|---|
protected |
AbstractGeospatialType(Class<T> reference,
Geospatial.Dimension dimension,
Geospatial.Type type) |
| Modifier and Type | Method and Description |
|---|---|
String |
fromUriLiteral(String literal)
Converts URI literal representation to default literal representation.
|
Class<?> |
getDefaultType()
Returns the default Java type for this EDM primitive type as described in the documentation of
EdmPrimitiveType. |
FullQualifiedName |
getFullQualifiedName() |
protected abstract <T> T |
internalValueOfString(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode,
Class<T> returnType) |
protected abstract <T> String |
internalValueToString(T value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
boolean |
isCompatible(EdmPrimitiveType primitiveType)
Checks type compatibility.
|
protected GeospatialCollection |
stringToCollection(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected LineString |
stringToLineString(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected MultiLineString |
stringToMultiLineString(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected MultiPoint |
stringToMultiPoint(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected MultiPolygon |
stringToMultiPolygon(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected Point |
stringToPoint(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected Polygon |
stringToPolygon(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
String |
toString() |
protected String |
toString(GeospatialCollection collection,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected String |
toString(LineString lineString,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected String |
toString(MultiLineString multiLineString,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected String |
toString(MultiPoint multiPoint,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected String |
toString(MultiPolygon multiPolygon,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected String |
toString(Point point,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
protected String |
toString(Polygon polygon,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode) |
String |
toUriLiteral(String literal)
Converts default literal representation to URI literal representation.
|
boolean |
validate(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode)
Validates literal value.
|
<T> T |
valueOfString(String value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode,
Class<T> returnType)
Converts literal representation of value to system data type.
|
String |
valueToString(Object value,
Boolean isNullable,
Integer maxLength,
Integer precision,
Integer scale,
Boolean isUnicode)
Converts system data type to literal representation of value.
|
equals, getKind, getName, getNamespace, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitvalidateDecimalsprotected final Geospatial.Dimension dimension
protected final Geospatial.Type type
protected String uriPrefix
protected String uriSuffix
protected FullQualifiedName fqn
protected AbstractGeospatialType(Class<T> reference, Geospatial.Dimension dimension, Geospatial.Type type)
public Class<?> getDefaultType()
EdmPrimitiveTypeEdmPrimitiveType.protected Point stringToPoint(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected MultiPoint stringToMultiPoint(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected LineString stringToLineString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected MultiLineString stringToMultiLineString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected Polygon stringToPolygon(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected MultiPolygon stringToMultiPolygon(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected GeospatialCollection stringToCollection(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(Point point, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(MultiPoint multiPoint, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(LineString lineString, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(MultiLineString multiLineString, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(Polygon polygon, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(MultiPolygon multiPolygon, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionprotected String toString(GeospatialCollection collection, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionpublic FullQualifiedName getFullQualifiedName()
getFullQualifiedName in interface EdmTypepublic boolean isCompatible(EdmPrimitiveType primitiveType)
EdmPrimitiveTypeisCompatible in interface EdmPrimitiveTypeprimitiveType - the EdmPrimitiveType to be tested for compatibilitytrue if the provided type is compatible to this typepublic boolean validate(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode)
EdmPrimitiveTypevalidate in interface EdmPrimitiveTypevalue - the literal valueisNullable - whether the null value is allowedmaxLength - the maximum lengthprecision - the precisionscale - the scaleisUnicode - whether non-ASCII characters are allowed (relevant only for Edm.String)true if the validation is successfulpublic final <T> T valueOfString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode, Class<T> returnType) throws EdmPrimitiveTypeException
EdmPrimitiveTypevalueOfString in interface EdmPrimitiveTypevalue - the literal representation of valueisNullable - whether the null value is allowedmaxLength - the maximum lengthprecision - the precisionscale - the scaleisUnicode - whether non-ASCII characters are allowed (relevant only for Edm.String)returnType - the class of the returned value; it must be one of the list in the documentation of
EdmPrimitiveTypereturnType indicatesEdmPrimitiveTypeExceptionprotected abstract <T> T internalValueOfString(String value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode, Class<T> returnType) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionpublic final String valueToString(Object value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveType
Returns null if value is null and null is an allowed value.
valueToString in interface EdmPrimitiveTypevalue - the Java value as Object; its type must be one of the list in the documentation of
EdmPrimitiveTypeisNullable - whether the null value is allowedmaxLength - the maximum lengthprecision - the precisionscale - the scaleisUnicode - whether non-ASCII characters are allowed (relevant only for Edm.String)EdmPrimitiveTypeExceptionprotected abstract <T> String internalValueToString(T value, Boolean isNullable, Integer maxLength, Integer precision, Integer scale, Boolean isUnicode) throws EdmPrimitiveTypeException
EdmPrimitiveTypeExceptionpublic String toUriLiteral(String literal)
EdmPrimitiveType
Returns null if the literal is null. Does not perform any validation.
toUriLiteral in interface EdmPrimitiveTypeliteral - the literal in default representationpublic String fromUriLiteral(String literal) throws EdmPrimitiveTypeException
EdmPrimitiveType
Returns null if the literal is null. Checks the presence of a required prefix and of
required surrounding quotation marks but does not perform any further validation.
fromUriLiteral in interface EdmPrimitiveTypeliteral - the literal in URI representationEdmPrimitiveTypeException - if a required prefix or required surrounding quotation marks are missingCopyright © 2023. All rights reserved.