FileDocCategorySizeDatePackage
OfficeDescriptor.javaAPI DocExample6330Thu Mar 07 09:58:26 GMT 2002javajaxb.generated.hr

OfficeDescriptor

public class OfficeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
version
$Revision$ $Date$

Fields Summary
private String
nsPrefix
private String
nsURI
private String
xmlName
private org.exolab.castor.xml.XMLFieldDescriptor
identity
Constructors Summary
public OfficeDescriptor()

        super();
        nsURI = "http://www.oreilly.com/catalog/javajaxb";
        xmlName = "office";
        XMLFieldDescriptorImpl  desc           = null;
        XMLFieldHandler         handler        = null;
        FieldValidator          fieldValidator = null;
        
        //-- set grouping compositor
        setCompositorAsSequence();
        //-- initialize attribute descriptors
        
        //-- _id
        desc = new XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_id", "id", NodeType.Attribute);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Office target = (Office) object;
                if(!target.hasId())
                    return null;
                return new Integer(target.getId());
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Office target = (Office) object;
                    // if null, use delete method for optional primitives 
                    if (value == null) {
                        target.deleteId();
                        return;
                    }
                    target.setId( ((Integer)value).intValue());
                }
                catch (Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public Object newInstance( Object parent ) {
                return null;
            }
        } );
        desc.setHandler(handler);
        desc.setNameSpaceURI("http://www.oreilly.com/catalog/javajaxb");
        addFieldDescriptor(desc);
        
        //-- validation code for: _id
        fieldValidator = new FieldValidator();
        { //-- local scope
            IntegerValidator iv = new IntegerValidator();
            fieldValidator.setValidator(iv);
        }
        desc.setValidator(fieldValidator);
        
        //-- initialize element descriptors
        
        //-- _address
        desc = new XMLFieldDescriptorImpl(Address.class, "_address", "address", NodeType.Element);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Office target = (Office) object;
                return target.getAddress();
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Office target = (Office) object;
                    target.setAddress( (Address) value);
                }
                catch (Exception ex) {
                    throw new IllegalStateException(ex.toString());
                }
            }
            public Object newInstance( Object parent ) {
                return new Address();
            }
        } );
        desc.setHandler(handler);
        desc.setNameSpaceURI("http://www.oreilly.com/catalog/javajaxb");
        desc.setRequired(true);
        desc.setMultivalued(false);
        addFieldDescriptor(desc);
        
        //-- validation code for: _address
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(1);
        desc.setValidator(fieldValidator);
        
    
Methods Summary
public org.exolab.castor.mapping.AccessModegetAccessMode()

        return null;
    
public org.exolab.castor.mapping.ClassDescriptorgetExtends()

        return null;
    
public org.exolab.castor.mapping.FieldDescriptorgetIdentity()

        return identity;
    
public java.lang.ClassgetJavaClass()

        return javajaxb.generated.hr.Office.class;
    
public java.lang.StringgetNameSpacePrefix()

        return nsPrefix;
    
public java.lang.StringgetNameSpaceURI()

        return nsURI;
    
public org.exolab.castor.xml.TypeValidatorgetValidator()

        return this;
    
public java.lang.StringgetXMLName()

        return xmlName;