public class PropertyDefinition
extends java.lang.Object
implements java.io.Externalizable
Modifier and Type | Field and Description |
---|---|
private int |
extent
The extent of this property, or
NO_EXTENT if the property has no extent. |
private java.lang.String |
legacyName
The legacy name of this property.
|
private java.lang.String |
name
The name of this property.
|
private static int |
NO_EXTENT
Default value for no-extent properties.
|
private static java.util.Map<java.lang.String,java.lang.Class<?>> |
primitiveClasses
Map of primitive names to their classes.
|
private java.lang.Class<?> |
type
The P2J wrapper type of this property.
|
Constructor and Description |
---|
PropertyDefinition()
Default c'tor, explicitly added to allow instances of this class to be created on
deserialization.
|
PropertyDefinition(java.lang.String name,
java.lang.Class<?> type)
Create a new, no-extent, property definition.
|
PropertyDefinition(java.lang.String name,
java.lang.Class<?> type,
int extent)
Create a new property definition.
|
PropertyDefinition(java.lang.String name,
java.lang.Class<?> type,
int extent,
java.lang.String legacyName)
Create a new property definition.
|
PropertyDefinition(java.lang.String name,
java.lang.Class<?> type,
java.lang.String legacyName)
Create a new, no-extent, property definition.
|
PropertyDefinition(java.lang.String name,
java.lang.String type)
Create a new, no-extent, property definition.
|
PropertyDefinition(java.lang.String name,
java.lang.String type,
int extent)
Create a new property definition.
|
Modifier and Type | Method and Description |
---|---|
int |
getExtent()
Get the extent of this property.
|
java.lang.String |
getLegacyName()
Get legacy name of this property.
|
java.lang.String |
getName()
Get the name of this property.
|
java.lang.Class<?> |
getType()
Get the type of this property.
|
boolean |
isExtent()
Check if this property is an extent property.
|
void |
readExternal(java.io.ObjectInput in)
Read the property definition from the specified input source.
|
private void |
verifyType(java.lang.Class<?> type)
Verify the given type is not null.
|
void |
writeExternal(java.io.ObjectOutput out)
Send the property definition to the specified output destination.
|
private static final java.util.Map<java.lang.String,java.lang.Class<?>> primitiveClasses
private static final int NO_EXTENT
private java.lang.Class<?> type
private int extent
NO_EXTENT
if the property has no extent.private java.lang.String name
private java.lang.String legacyName
public PropertyDefinition()
public PropertyDefinition(java.lang.String name, java.lang.String type) throws java.lang.ClassNotFoundException
name
- The name of this property.type
- The type of this property.java.lang.ClassNotFoundException
- If the given type
can not be resolved to a valid class.public PropertyDefinition(java.lang.String name, java.lang.String type, int extent) throws java.lang.ClassNotFoundException
name
- The name of this property.type
- The type of this property.extent
- The extent of this property.java.lang.ClassNotFoundException
- If the given type
can not be resolved to a valid class.public PropertyDefinition(java.lang.String name, java.lang.Class<?> type)
name
- The name of this property.type
- A class specifying the type of this property.public PropertyDefinition(java.lang.String name, java.lang.Class<?> type, java.lang.String legacyName)
name
- The name of this property.type
- A class specifying the type of this property.legacyName
- The legacy name of this property.public PropertyDefinition(java.lang.String name, java.lang.Class<?> type, int extent)
name
- The name of this property.type
- A class specifying the type of this property.extent
- The extent of this property.public PropertyDefinition(java.lang.String name, java.lang.Class<?> type, int extent, java.lang.String legacyName)
name
- The name of this property.type
- A class specifying the type of this property.extent
- The extent of this property.legacyName
- The legacy name of this property.public java.lang.Class<?> getType()
public int getExtent()
public java.lang.String getName()
public boolean isExtent()
true
if this property is an extent property.public java.lang.String getLegacyName()
public final void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which the property definition will be sent.java.io.IOException
- In case of I/O errors.public final void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which the property definition will be read.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
private void verifyType(java.lang.Class<?> type)
type
- The type to check.java.lang.NullPointerException
- If type
is null.