{
@Override
public java.lang.Object getValue(java.lang.Object object)
throws IllegalStateException
{
Trx target = (Trx) object;
return target.getId();
}
@Override
public void setValue(java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try
{
Trx target = (Trx) object;
target.setId((java.lang.String) value);
}
catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
}
}
@Override
public java.lang.Object newInstance(java.lang.Object parent)
{
return null;
}
};
desc.setSchemaType("string");
desc.setHandler(handler);
desc.setRequired(true);
desc.setMultivalued(false);
addFieldDescriptor(desc);
//-- validation code for: _id
fieldValidator = new org.exolab.castor.xml.FieldValidator();
fieldValidator.setMinOccurs(1);
{ //-- local scope
org.exolab.castor.xml.validators.StringValidator typeValidator;
typeValidator = new org.exolab.castor.xml.validators.StringValidator();
fieldValidator.setValidator(typeValidator);
typeValidator.setWhiteSpace("preserve");
typeValidator.setMaxLength(40);
typeValidator.setMinLength(1);
}
desc.setValidator(fieldValidator);
//-- _key
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
java.lang.String.class, "_key", "key",
org.exolab.castor.xml.NodeType.Attribute);
desc.setImmutable(true);
handler = new org.exolab.castor.xml.XMLFieldHandler()
{
@Override
public java.lang.Object getValue(java.lang.Object object)
throws IllegalStateException
{
Trx target = (Trx) object;
return target.getKey();
}
@Override
public void setValue(java.lang.Object object, java.lang.Object value)
throws IllegalStateException, IllegalArgumentException
{
try
{
Trx target = (Trx) object;
target.setKey((java.lang.String) value);
}
catch (java.lang.Exception ex)
{
throw new IllegalStateException(ex.toString());
}