FileDocCategorySizeDatePackage
AddressDescriptor.javaAPI DocExample11299Thu Mar 07 09:58:26 GMT 2002javajaxb.generated.hr

AddressDescriptor

public class AddressDescriptor 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 AddressDescriptor()

        super();
        nsURI = "http://www.oreilly.com/catalog/javajaxb";
        xmlName = "address";
        XMLFieldDescriptorImpl  desc           = null;
        XMLFieldHandler         handler        = null;
        FieldValidator          fieldValidator = null;
        
        //-- set grouping compositor
        setCompositorAsSequence();
        //-- initialize attribute descriptors
        
        //-- initialize element descriptors
        
        //-- _street1
        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_street1", "street1", NodeType.Element);
        desc.setImmutable(true);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Address target = (Address) object;
                return target.getStreet1();
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Address target = (Address) object;
                    target.setStreet1( (java.lang.String) value);
                }
                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");
        desc.setRequired(true);
        desc.setMultivalued(false);
        addFieldDescriptor(desc);
        
        //-- validation code for: _street1
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(1);
        { //-- local scope
            StringValidator sv = new StringValidator();
            sv.setWhiteSpace("preserve");
            fieldValidator.setValidator(sv);
        }
        desc.setValidator(fieldValidator);
        
        //-- _street2
        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_street2", "street2", NodeType.Element);
        desc.setImmutable(true);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Address target = (Address) object;
                return target.getStreet2();
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Address target = (Address) object;
                    target.setStreet2( (java.lang.String) value);
                }
                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");
        desc.setMultivalued(false);
        addFieldDescriptor(desc);
        
        //-- validation code for: _street2
        fieldValidator = new FieldValidator();
        { //-- local scope
            StringValidator sv = new StringValidator();
            sv.setWhiteSpace("preserve");
            fieldValidator.setValidator(sv);
        }
        desc.setValidator(fieldValidator);
        
        //-- _city
        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_city", "city", NodeType.Element);
        desc.setImmutable(true);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Address target = (Address) object;
                return target.getCity();
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Address target = (Address) object;
                    target.setCity( (java.lang.String) value);
                }
                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");
        desc.setRequired(true);
        desc.setMultivalued(false);
        addFieldDescriptor(desc);
        
        //-- validation code for: _city
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(1);
        { //-- local scope
            StringValidator sv = new StringValidator();
            sv.setWhiteSpace("preserve");
            fieldValidator.setValidator(sv);
        }
        desc.setValidator(fieldValidator);
        
        //-- _state
        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_state", "state", NodeType.Element);
        desc.setImmutable(true);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Address target = (Address) object;
                return target.getState();
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Address target = (Address) object;
                    target.setState( (java.lang.String) value);
                }
                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");
        desc.setRequired(true);
        desc.setMultivalued(false);
        addFieldDescriptor(desc);
        
        //-- validation code for: _state
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(1);
        { //-- local scope
            StringValidator sv = new StringValidator();
            sv.setWhiteSpace("preserve");
            sv.setPattern("[A-Z]{2}");
            fieldValidator.setValidator(sv);
        }
        desc.setValidator(fieldValidator);
        
        //-- _zipCode
        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_zipCode", "zip-code", NodeType.Element);
        desc.setImmutable(true);
        handler = (new XMLFieldHandler() {
            public Object getValue( Object object ) 
                throws IllegalStateException
            {
                Address target = (Address) object;
                return target.getZipCode();
            }
            public void setValue( Object object, Object value) 
                throws IllegalStateException, IllegalArgumentException
            {
                try {
                    Address target = (Address) object;
                    target.setZipCode( (java.lang.String) value);
                }
                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");
        desc.setRequired(true);
        desc.setMultivalued(false);
        addFieldDescriptor(desc);
        
        //-- validation code for: _zipCode
        fieldValidator = new FieldValidator();
        fieldValidator.setMinOccurs(1);
        { //-- local scope
            StringValidator sv = new StringValidator();
            sv.setWhiteSpace("preserve");
            sv.setPattern("[0-9]{5}(-[0-9]{4})?");
            fieldValidator.setValidator(sv);
        }
        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.Address.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;