public abstract class AbstractMetaData<T> extends java.lang.Object implements MetaData<T>
| Modifier and Type | Field and Description |
|---|---|
protected boolean[] |
caseSensitive |
protected boolean[] |
currency |
protected boolean[] |
definitelyWritable |
protected java.lang.Class<T> |
domainClass |
protected java.lang.Class<?>[] |
fieldClass |
protected java.lang.String[] |
fieldClassName |
protected int |
fieldCount |
protected java.lang.String[] |
fieldLabel |
protected java.lang.String[] |
fieldName |
protected static java.util.logging.Logger |
logger |
protected java.util.Map<java.lang.String,java.lang.String> |
mapping |
protected int[] |
nullable |
protected int[] |
precision |
protected java.lang.reflect.Method[] |
readMethod
java.lang.reflect.Method is not serializeable, so after sending this object to another JavaVM writeMethod and readMethod will become null
|
protected boolean[] |
readOnly |
protected int[] |
scale |
protected boolean[] |
searchable |
protected boolean[] |
signed |
protected boolean |
throwMissingFieldException
Throw Exception or ignore if DomainObject has less fields than mappings
|
protected boolean[] |
writable |
protected java.lang.reflect.Method[] |
writeMethod |
| Constructor and Description |
|---|
AbstractMetaData() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Class<T> |
getDomainClass() |
java.lang.Class<?> |
getFieldClass(int fieldIndex) |
java.lang.String |
getFieldClassName(int fieldIndex) |
int |
getFieldCount() |
int |
getFieldIndexByFieldName(java.lang.String searchedFieldName) |
java.lang.String |
getFieldLabel(int fieldIndex) |
java.lang.String |
getFieldName(int fieldIndex) |
java.util.Map<java.lang.String,java.lang.String> |
getMapping() |
int |
getPrecision(int fieldIndex)
Get the designated field's number of decimal digits.
|
java.lang.reflect.Method |
getReadMethod(int fieldIndex) |
int |
getScale(int fieldIndex)
Gets the designated field's number of digits to right of the decimal
point.
|
java.lang.reflect.Method |
getWriteMethod(int fieldIndex) |
boolean |
isCaseSensitive(int fieldIndex)
Indicates whether a field's case matters.
|
boolean |
isCurrency(int fieldIndex)
Indicates whether the designated field is a cash value.
|
boolean |
isDefinitelyWritable(int fieldIndex)
Indicates whether a write on the designated field will definitely
succeed.
|
int |
isNullable(int fieldIndex)
Indicates the nullability of values in the designated field.
|
boolean |
isPopulated() |
boolean |
isReadOnly(int fieldIndex)
Indicates whether the designated field is definitely not writable.
|
boolean |
isSearchable(int fieldIndex)
Indicates whether the designated field can be used in a where clause.
|
boolean |
isSigned(int fieldIndex)
Indicates whether values in the designated field are signed numbers.
|
boolean |
isThrowMissingFieldException() |
boolean |
isWritable(int fieldIndex)
Indicates whether it is possible for a write on the designated field to
succeed.
|
protected void |
populateReadMethod(int fieldIndex,
java.lang.String fieldName) |
protected void |
populateWriteMethod(int fieldIndex,
java.lang.String fieldName) |
void |
setCaseSensitive(int fieldIndex,
boolean property)
Sets whether the designated field is case sensitive.
|
void |
setCurrency(int fieldIndex,
boolean property)
Sets whether the designated field is a cash value.
|
void |
setDefinitelyWritable(int fieldIndex,
boolean definitelyWritable) |
void |
setFieldClass(int fieldIndex,
java.lang.Class<?> fieldClass) |
void |
setFieldClassName(int fieldIndex,
java.lang.String fieldClassName) |
void |
setFieldCount(int fieldCount) |
void |
setFieldLabel(int fieldIndex,
java.lang.String fieldLabel) |
void |
setFieldName(int fieldIndex,
java.lang.String fieldName) |
void |
setNullable(int fieldIndex,
int property)
Sets whether the designated field's value can be set to
NULL. |
void |
setPrecision(int fieldIndex,
int precision)
Sets the designated field's number of decimal digits to the given
int. |
void |
setReadMethod(int fieldIndex,
java.lang.reflect.Method readMethod) |
void |
setReadOnly(int fieldIndex,
boolean readOnly) |
void |
setScale(int fieldIndex,
int scale)
Sets the designated field's number of digits to the right of the decimal
point to the given
int. |
void |
setSearchable(int fieldIndex,
boolean property)
Sets whether the designated field can be used in a where clause.
|
void |
setSigned(int fieldIndex,
boolean property)
Sets whether the designated field is a signed number.
|
void |
setThrowMissingFieldException(boolean throwMissingFieldException) |
void |
setWritable(int fieldIndex,
boolean writable) |
void |
setWriteMethod(int fieldIndex,
java.lang.reflect.Method writeMethod) |
java.lang.String |
toLabel(java.lang.String fieldName) |
protected int[] precision
protected int[] scale
protected boolean[] caseSensitive
protected boolean[] currency
protected boolean[] definitelyWritable
protected boolean[] readOnly
protected boolean[] searchable
protected boolean[] signed
protected boolean[] writable
protected int[] nullable
protected transient java.lang.reflect.Method[] readMethod
protected transient java.lang.reflect.Method[] writeMethod
protected java.lang.String[] fieldClassName
protected java.lang.Class<?>[] fieldClass
protected java.lang.Class<T> domainClass
protected java.lang.String[] fieldName
protected java.lang.String[] fieldLabel
protected int fieldCount
protected java.util.Map<java.lang.String,java.lang.String> mapping
protected boolean throwMissingFieldException
protected static final transient java.util.logging.Logger logger
public boolean isPopulated()
isPopulated in interface MetaData<T>public int getScale(int fieldIndex)
throws DataAccessException
MetaDatagetScale in interface MetaData<T>DataAccessException - if an error occurspublic void setPrecision(int fieldIndex,
int precision)
throws DataAccessException
MetaDataint.setPrecision in interface MetaData<T>precision - the total number of decimal digitsDataAccessException - if an error occurspublic void setScale(int fieldIndex,
int scale)
throws DataAccessException
MetaDataint.setScale in interface MetaData<T>scale - the number of digits to right of decimal pointDataAccessException - if an error occurspublic int getPrecision(int fieldIndex)
throws DataAccessException
MetaDatagetPrecision in interface MetaData<T>DataAccessException - if an error occurspublic boolean isCaseSensitive(int fieldIndex)
throws DataAccessException
MetaDataisCaseSensitive in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic boolean isCurrency(int fieldIndex)
throws DataAccessException
MetaDataisCurrency in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic boolean isDefinitelyWritable(int fieldIndex)
throws DataAccessException
MetaDataisDefinitelyWritable in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic int isNullable(int fieldIndex)
throws DataAccessException
MetaDataisNullable in interface MetaData<T>fieldNoNulls, fieldNullable or
fieldNullableUnknownDataAccessException - if an error occurspublic boolean isReadOnly(int fieldIndex)
throws DataAccessException
MetaDataisReadOnly in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic boolean isSearchable(int fieldIndex)
throws DataAccessException
MetaDataisSearchable in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic boolean isSigned(int fieldIndex)
throws DataAccessException
MetaDataisSigned in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic boolean isWritable(int fieldIndex)
throws DataAccessException
MetaDataisWritable in interface MetaData<T>true if so; false otherwiseDataAccessException - if an error occurspublic void setCaseSensitive(int fieldIndex,
boolean property)
throws DataAccessException
MetaDatafalse.setCaseSensitive in interface MetaData<T>property - true if the field is case sensitive;
false if it is notDataAccessException - if an error occurspublic void setCurrency(int fieldIndex,
boolean property)
throws DataAccessException
MetaDatafalse.setCurrency in interface MetaData<T>property - true if the field is a cash value;
false if it is notDataAccessException - if an error occurspublic void setNullable(int fieldIndex,
int property)
throws DataAccessException
MetaDataNULL. The default is
ResultSetMetaData.fieldNullableUnknownsetNullable in interface MetaData<T>property - one of the following constants:
ResultSetMetaData.fieldNoNulls,
ResultSetMetaData.fieldNullable, or
ResultSetMetaData.fieldNullableUnknownDataAccessException - if an error occurspublic void setSearchable(int fieldIndex,
boolean property)
throws DataAccessException
MetaDatafalse.setSearchable in interface MetaData<T>property - true if the field can be used in a
WHERE clause; false if it cannotDataAccessException - if an error occurspublic void setSigned(int fieldIndex,
boolean property)
throws DataAccessException
MetaDatafalse.setSigned in interface MetaData<T>property - true if the field is a signed number;
false if it is notDataAccessException - if an error occurspublic void setWritable(int fieldIndex,
boolean writable)
setWritable in interface MetaData<T>public void setDefinitelyWritable(int fieldIndex,
boolean definitelyWritable)
setDefinitelyWritable in interface MetaData<T>public void setReadOnly(int fieldIndex,
boolean readOnly)
throws DataAccessException
setReadOnly in interface MetaData<T>DataAccessExceptionpublic java.lang.String getFieldName(int fieldIndex)
throws DataAccessException
getFieldName in interface MetaData<T>DataAccessExceptionpublic void setFieldName(int fieldIndex,
java.lang.String fieldName)
throws DataAccessException
setFieldName in interface MetaData<T>DataAccessExceptionpublic java.lang.String getFieldLabel(int fieldIndex)
throws DataAccessException
getFieldLabel in interface MetaData<T>DataAccessExceptionpublic void setFieldLabel(int fieldIndex,
java.lang.String fieldLabel)
throws DataAccessException
setFieldLabel in interface MetaData<T>DataAccessExceptionpublic java.lang.reflect.Method getWriteMethod(int fieldIndex)
throws DataAccessException
getWriteMethod in interface MetaData<T>DataAccessExceptionpublic void setWriteMethod(int fieldIndex,
java.lang.reflect.Method writeMethod)
setWriteMethod in interface MetaData<T>public java.lang.reflect.Method getReadMethod(int fieldIndex)
throws DataAccessException
getReadMethod in interface MetaData<T>DataAccessExceptionpublic void setReadMethod(int fieldIndex,
java.lang.reflect.Method readMethod)
setReadMethod in interface MetaData<T>public java.lang.String getFieldClassName(int fieldIndex)
throws DataAccessException
getFieldClassName in interface MetaData<T>DataAccessExceptionpublic void setFieldClassName(int fieldIndex,
java.lang.String fieldClassName)
throws DataAccessException
setFieldClassName in interface MetaData<T>DataAccessExceptionpublic java.lang.Class<?> getFieldClass(int fieldIndex)
getFieldClass in interface MetaData<T>public void setFieldClass(int fieldIndex,
java.lang.Class<?> fieldClass)
setFieldClass in interface MetaData<T>protected void populateReadMethod(int fieldIndex,
java.lang.String fieldName)
throws DataAccessException
DataAccessExceptionprotected void populateWriteMethod(int fieldIndex,
java.lang.String fieldName)
throws DataAccessException
DataAccessExceptionpublic boolean isThrowMissingFieldException()
isThrowMissingFieldException in interface MetaData<T>public void setThrowMissingFieldException(boolean throwMissingFieldException)
setThrowMissingFieldException in interface MetaData<T>public java.lang.Class<T> getDomainClass()
getDomainClass in interface MetaData<T>public int getFieldCount()
getFieldCount in interface MetaData<T>public void setFieldCount(int fieldCount)
setFieldCount in interface MetaData<T>public java.lang.String toLabel(java.lang.String fieldName)
public int getFieldIndexByFieldName(java.lang.String searchedFieldName)
getFieldIndexByFieldName in interface MetaData<T>public java.util.Map<java.lang.String,java.lang.String> getMapping()
getMapping in interface MetaData<T>