fieldValidator.setMinOccurs(1);
desc.setValidator(fieldValidator);   desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_methodImplementation", "MethodImplementation", NodeType.Element); desc.setImmutable(true); handler = (new XMLFieldHandler() { public Object getValue( Object object ) throws IllegalStateException { ServiceMethodDataType target = (ServiceMethodDataType) object; return target.getMethodImplementation(); } public void setValue( Object object, Object value) throws IllegalStateException, IllegalArgumentException { try { ServiceMethodDataType target = (ServiceMethodDataType) object; target.setMethodImplementation( (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: desc.setMultivalued(false); addFieldDescriptor(desc);   fieldValidator = new FieldValidator(); { StringValidator sv = new StringValidator(); sv.setWhiteSpace("preserve"); fieldValidator.setValidator(sv); }
    public ServiceMethodDataTypeDescriptor() {        super();        nsURI = "http://localhost/Discus/Schema/Treaty.xsd";        xmlName = "ServiceMethodDataType";        XMLFieldDescriptorImpl  desc           = null;        XMLFieldHandler         handler        = null;        FieldValidator          fieldValidator = null;                //-- set grouping compositor        setCompositorAsSequence();        //-- initialize attribute descriptors                //-- initialize element descriptors                //-- _methodName        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_methodName", "MethodName", NodeType.Element);        desc.setImmutable(true);        handler = (new XMLFieldHandler() {            public Object getValue( Object object )                 throws IllegalStateException            {                ServiceMethodDataType target = (ServiceMethodDataType) object;                return target.getMethodName();            }            public void setValue( Object object, Object value)                 throws IllegalStateException, IllegalArgumentException            {                try {                    ServiceMethodDataType target = (ServiceMethodDataType) object;                    target.setMethodName( (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://localhost/Discus/Schema/Treaty.xsd");        desc.setRequired(true);        desc.setMultivalued(false);        addFieldDescriptor(desc);                //-- validation code for: _methodName        fieldValidator = new FieldValidator();        fieldValidator.setMinOccurs(1);        { //-- local scope            StringValidator sv = new StringValidator();            sv.setWhiteSpace("preserve");            fieldValidator.setValidator(sv);        }        desc.setValidator(fieldValidator);                //-- _parameterList        desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_parameterList", "Parameter", NodeType.Element);        desc.setImmutable(true);        handler = (new XMLFieldHandler() {            public Object getValue( Object object )                 throws IllegalStateException            {                ServiceMethodDataType target = (ServiceMethodDataType) object;                return target.getParameter();            }            public void setValue( Object object, Object value)                 throws IllegalStateException, IllegalArgumentException            {                try {                    ServiceMethodDataType target = (ServiceMethodDataType) object;                    target.addParameter( (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://localhost/Discus/Schema/Treaty.xsd");        desc.setMultivalued(true);        addFieldDescriptor(desc);                //-- validation code for: _parameterList        fieldValidator = new FieldValidator();        { //-- local scope            StringValidator sv = new StringValidator();            sv.setWhiteSpace("preserve");            fieldValidator.setValidator(sv);        }        desc.setValidator(fieldValidator);                //-- _numInvokations        desc = new XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_numInvokations", "NumInvokations", NodeType.Element);        handler = (new XMLFieldHandler() {            public Object getValue( Object object )                 throws IllegalStateException            {                ServiceMethodDataType target = (ServiceMethodDataType) object;                if(!target.hasNumInvokations())                    return null;                return new Integer(target.getNumInvokations());            }            public void setValue( Object object, Object value)                 throws IllegalStateException, IllegalArgumentException            {                try {                    ServiceMethodDataType target = (ServiceMethodDataType) object;                    // ignore null values for non optional primitives                    if (value == null) return;                                        target.setNumInvokations( ((Integer)value).intValue());                }                catch (Exception ex) {                    throw new IllegalStateException(ex.toString());                }            }            public Object newInstance( Object parent ) {                return null;            }        } );        desc.setHandler(handler);        desc.setNameSpaceURI("http://localhost/Discus/Schema/Treaty.xsd");        desc.setRequired(true);        desc.setMultivalued(false);        addFieldDescriptor(desc);                //-- validation code for: _numInvokations        fieldValidator = new FieldValidator();        fieldValidator.setMinOccurs(1);        { //-- local scope            IntegerValidator iv = new IntegerValidator();            fieldValidator.setValidator(iv);        }        desc.setValidator(fieldValidator);                //-- _authorized        desc = new XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_authorized", "Authorized", NodeType.Element);        handler = (new XMLFieldHandler() {            public Object getValue( Object object )                 throws IllegalStateException            {                ServiceMethodDataType target = (ServiceMethodDataType) object;                if(!target.hasAuthorized())                    return null;                return new Boolean(target.getAuthorized());            }            public void setValue( Object object, Object value)                 throws IllegalStateException, IllegalArgumentException            {                try {                    ServiceMethodDataType target = (ServiceMethodDataType) object;                    // ignore null values for non optional primitives                    if (value == null) return;                                        target.setAuthorized( ((Boolean)value).booleanValue());                }                catch (Exception ex) {                    throw new IllegalStateException(ex.toString());                }            }            public Object newInstance( Object parent ) {                return null;            }        } );        desc.setHandler(handler);        desc.setNameSpaceURI("http://localhost/Discus/Schema/Treaty.xsd");        desc.setRequired(true);        desc.setMultivalued(false);        addFieldDescriptor(desc);                //-- validation code for: _authorized        fieldValidator = new FieldValidator();        fieldValidator.setMinOccurs(1);        desc.setValidator(fieldValidator);            } //-- psl.discus.javasrc.schemas.treaty.ServiceMethodDataTypeDescriptor()