public abstract class Type extends java.lang.Object implements NamespaceElement, org.da.protoframework.model.def.DescriptedElement
Modifier and Type | Field and Description |
---|---|
static short |
ANY
The base built-in Any type.
|
static short |
BOOL
The base built-in boolean type.
|
static short |
BYTE
The base built-in byte type.
|
static short |
CHAR
The base built-in char type.
|
static short |
DOUBLE
The base built-in double type.
|
static short |
FLOAT
The base built-in float type.
|
static short |
INT
The base built-in int type.
|
static short |
LONG
The base built-in long type.
|
static short |
NIL
The base built-in Nil type.
|
static short |
SHORT
The base built-in short type.
|
static short |
STRING
The base built-in String type.
|
static short |
UNDEF
Represents an undefined type.
|
static short |
URL
The base built-in URL type.
|
static short |
XML
The base built-in xml type.
|
Constructor and Description |
---|
Type()
Empty Constructor.
|
Type(NamespaceKey key)
Constructor.
|
Type(java.lang.String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract boolean |
areEqual(java.lang.Object value1,
java.lang.Object value2)
Return true if two values are considered as equal for this type.
|
java.lang.Object |
copyValue(java.lang.Object value)
Copy the current value and return it.
|
Data<?> |
createData()
Create a Data for this type.
|
abstract java.lang.Object |
getDefaultValue()
Return the type default value.
|
java.lang.Object |
getDefaultValue(java.lang.String appliName)
Return the type default value.
|
java.lang.String |
getDescription()
Return the type description (may be null).
|
Type |
getExtendedType()
Return the type that this type extends.
|
abstract java.lang.Object |
getInstanceFromValue(java.lang.Object value,
java.lang.Class<?> clazz)
Return a value as an instance of a class.
|
NamespaceKey |
getKey()
Return the Service key.
|
java.lang.String |
getName()
Return the type name.
|
java.net.URI |
getNamespace()
Return the type namespace
|
java.lang.String |
getNamespaceAsString()
Return the element namespace as a String.
|
java.lang.Object |
getNonEmptyDefaultValue()
Return a non empty type default value.
|
Type |
getTerminalType()
Return the terminal non alias type which is referred to by this type.
|
short |
getUnit()
Return the value unit.
|
boolean |
getValueAsBoolean(java.lang.Object value)
Return a value as a boolean.
|
byte |
getValueAsByte(java.lang.Object value)
Return a value as a byte.
|
char |
getValueAsChar(java.lang.Object value)
Return a value as a char.
|
Data<?> |
getValueAsData(java.lang.Object value)
Return a value as a Data.
|
double |
getValueAsDouble(java.lang.Object value)
Return a value as a double.
|
double |
getValueAsDouble(java.lang.Object value,
short unit)
Return a value as a double, in a specified unit.
|
float |
getValueAsFloat(java.lang.Object value)
Return a value as a float.
|
float |
getValueAsFloat(java.lang.Object value,
short unit)
Return a value as a float, in a specified unit.
|
int |
getValueAsInt(java.lang.Object value)
Return a value as an int.
|
int |
getValueAsInt(java.lang.Object value,
short unit)
Return a value as an int.
|
long |
getValueAsLong(java.lang.Object value)
Return a value as a long.
|
long |
getValueAsLong(java.lang.Object value,
short unit)
Return a value as a long.
|
short |
getValueAsShort(java.lang.Object value)
Return a value as a short.
|
abstract java.lang.String |
getValueAsString(java.lang.Object value)
Return a value as a String.
|
abstract java.lang.Object |
getValueFromInstance(java.lang.Object instance)
Return a value as an instance object.
|
boolean |
isAbstract()
Return true if the type is abstract.
|
abstract boolean |
isSupportingValue(java.lang.Object value)
Return true if the type support a specified value.
|
void |
setDescription(java.lang.String desc)
Set the type description.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getFullName
public static final short UNDEF
public static final short BOOL
public static final short CHAR
public static final short BYTE
public static final short SHORT
public static final short INT
public static final short LONG
public static final short FLOAT
public static final short DOUBLE
public static final short STRING
public static final short XML
public static final short URL
public static final short NIL
public static final short ANY
public Type()
public Type(NamespaceKey key)
key
- the type keypublic Type(java.lang.String name)
name
- the type namepublic void setDescription(java.lang.String desc)
setDescription
in interface org.da.protoframework.model.def.DescriptedElement
desc
- the type descriptionpublic java.lang.String getDescription()
getDescription
in interface org.da.protoframework.model.def.DescriptedElement
public java.lang.String getName()
public java.net.URI getNamespace()
getNamespace
in interface NamespaceElement
public boolean isAbstract()
public Type getExtendedType()
public java.lang.String getNamespaceAsString()
getNamespaceAsString
in interface NamespaceElement
public java.lang.String toString()
toString
in class java.lang.Object
public NamespaceKey getKey()
getKey
in interface NamespaceElement
public abstract java.lang.Object getDefaultValue()
public abstract boolean isSupportingValue(java.lang.Object value)
value
- the valuepublic java.lang.Object copyValue(java.lang.Object value)
value
- the value to copypublic Data<?> createData()
public java.lang.Object getNonEmptyDefaultValue()
getDefaultValue()
.public abstract boolean areEqual(java.lang.Object value1, java.lang.Object value2)
value1
- the first valuevalue2
- the second valuepublic java.lang.Object getDefaultValue(java.lang.String appliName)
appliName
- the application namepublic abstract java.lang.Object getValueFromInstance(java.lang.Object instance)
instance
- the instance objectpublic abstract java.lang.Object getInstanceFromValue(java.lang.Object value, java.lang.Class<?> clazz)
value
- the valueclazz
- the classpublic abstract java.lang.String getValueAsString(java.lang.Object value)
value
- the valuepublic Data<?> getValueAsData(java.lang.Object value)
value
- the valuepublic int getValueAsInt(java.lang.Object value)
value
- the valuepublic int getValueAsInt(java.lang.Object value, short unit)
value
- the valueunit
- the unitpublic short getValueAsShort(java.lang.Object value)
value
- the valuepublic byte getValueAsByte(java.lang.Object value)
value
- the valuepublic long getValueAsLong(java.lang.Object value)
value
- the valuepublic long getValueAsLong(java.lang.Object value, short unit)
value
- the valueunit
- the unitpublic char getValueAsChar(java.lang.Object value)
value
- the valuepublic boolean getValueAsBoolean(java.lang.Object value)
value
- the valuepublic float getValueAsFloat(java.lang.Object value)
value
- the valuepublic float getValueAsFloat(java.lang.Object value, short unit)
getValueAsFloat(java.lang.Object)
.value
- the valueunit
- the unitpublic double getValueAsDouble(java.lang.Object value)
value
- the valuepublic double getValueAsDouble(java.lang.Object value, short unit)
getValueAsDouble(java.lang.Object)
.value
- the valueunit
- the unitpublic short getUnit()
public Type getTerminalType()
Copyright ©2017-2023 Dassault Aviation. All Rights Reserved. Documentation and source under the LGPL v3 licence