geronimo-jaxws_2.1.1_spec/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java [65:228]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@XmlRootElement(name = "EndpointReference", namespace = W3CEndpointReference.NS)
@XmlType(name = "EndpointReferenceType", namespace = W3CEndpointReference.NS)
public final class W3CEndpointReference extends EndpointReference {
    protected static final String NS = "http://www.w3.org/2005/08/addressing";
    private static JAXBContext jaxbContext;
    
    @XmlElement(name = "Address", namespace = NS, required = true)
    private AttributedURIType address;
    @XmlElement(name = "ReferenceParameters", namespace = NS)
    private ReferenceParametersType referenceParameters;
    @XmlElement(name = "Metadata", namespace = NS)
    private MetadataType metadata;
    @XmlAnyElement(lax = true)
    private List<Object> any;
    @XmlAnyAttribute
    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
    
    static {
        try { 
            jaxbContext = JAXBContext.newInstance(W3CEndpointReference.class);
        }
        catch (Exception e) {
            //TODO NLS enable
            throw new WebServiceException("JAXBContext creation failed.", e);
        }
    }

    protected W3CEndpointReference() {
    }
    
    public W3CEndpointReference(Source eprInfoset) {
        super();
        
        try {
            Unmarshaller um = jaxbContext.createUnmarshaller();
            W3CEndpointReference w3cEPR = (W3CEndpointReference) um.unmarshal(eprInfoset);
            
            address = w3cEPR.address;
            referenceParameters = w3cEPR.referenceParameters;
            metadata = w3cEPR.metadata;
            any = w3cEPR.any;
            otherAttributes.putAll(w3cEPR.otherAttributes);
        }
        catch (Exception e) {
            //TODO NLS enable.
            throw new WebServiceException("Unable to create W3C endpoint reference.", e);
        }
    }
    
    @Override
    public void writeTo(Result result) {
        if (result == null) {
            //TODO NLS enable
            throw new IllegalArgumentException("Null is not allowed.");
        }
        
        try {
            Marshaller m = jaxbContext.createMarshaller();
            m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
            m.marshal(this, result);
        }
        catch (Exception e) {
            //TODO NLS enable
            throw new WebServiceException("writeTo failure.", e);
        }
    }

    /**
     * <p>Java class for AttributedURIType complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType name="AttributedURIType">
     *   &lt;simpleContent>
     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>anyURI">
     *     &lt;/extension>
     *   &lt;/simpleContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "AttributedURIType", propOrder = {
        "value"
    })
    private static class AttributedURIType {

        @XmlValue
        @XmlSchemaType(name = "anyURI")
        protected String value;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
        
        public AttributedURIType() {
        }
    }

    /**
     * <p>Java class for ReferenceParametersType complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType name="ReferenceParametersType">
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;any/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "ReferenceParametersType", propOrder = {
        "any"
    })
    private static class ReferenceParametersType {

        @XmlAnyElement(lax = true)
        protected List<Object> any;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
        
        public ReferenceParametersType() {
        }
    }

    /**
     * <p>Java class for MetadataType complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType name="MetadataType">
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;any/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "MetadataType", propOrder = {
        "any"
    })
    private static class MetadataType {

        @XmlAnyElement(lax = true)
        protected List<Object> any;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
        
        public MetadataType() {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



geronimo-jaxws_2.1_spec/src/main/java/javax/xml/ws/wsaddressing/W3CEndpointReference.java [65:228]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@XmlRootElement(name = "EndpointReference", namespace = W3CEndpointReference.NS)
@XmlType(name = "EndpointReferenceType", namespace = W3CEndpointReference.NS)
public final class W3CEndpointReference extends EndpointReference {
    protected static final String NS = "http://www.w3.org/2005/08/addressing";
    private static JAXBContext jaxbContext;
    
    @XmlElement(name = "Address", namespace = NS, required = true)
    private AttributedURIType address;
    @XmlElement(name = "ReferenceParameters", namespace = NS)
    private ReferenceParametersType referenceParameters;
    @XmlElement(name = "Metadata", namespace = NS)
    private MetadataType metadata;
    @XmlAnyElement(lax = true)
    private List<Object> any;
    @XmlAnyAttribute
    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
    
    static {
        try { 
            jaxbContext = JAXBContext.newInstance(W3CEndpointReference.class);
        }
        catch (Exception e) {
            //TODO NLS enable
            throw new WebServiceException("JAXBContext creation failed.", e);
        }
    }

    protected W3CEndpointReference() {
    }
    
    public W3CEndpointReference(Source eprInfoset) {
        super();
        
        try {
            Unmarshaller um = jaxbContext.createUnmarshaller();
            W3CEndpointReference w3cEPR = (W3CEndpointReference) um.unmarshal(eprInfoset);
            
            address = w3cEPR.address;
            referenceParameters = w3cEPR.referenceParameters;
            metadata = w3cEPR.metadata;
            any = w3cEPR.any;
            otherAttributes.putAll(w3cEPR.otherAttributes);
        }
        catch (Exception e) {
            //TODO NLS enable.
            throw new WebServiceException("Unable to create W3C endpoint reference.", e);
        }
    }
    
    @Override
    public void writeTo(Result result) {
        if (result == null) {
            //TODO NLS enable
            throw new IllegalArgumentException("Null is not allowed.");
        }
        
        try {
            Marshaller m = jaxbContext.createMarshaller();
            m.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
            m.marshal(this, result);
        }
        catch (Exception e) {
            //TODO NLS enable
            throw new WebServiceException("writeTo failure.", e);
        }
    }

    /**
     * <p>Java class for AttributedURIType complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType name="AttributedURIType">
     *   &lt;simpleContent>
     *     &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>anyURI">
     *     &lt;/extension>
     *   &lt;/simpleContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "AttributedURIType", propOrder = {
        "value"
    })
    private static class AttributedURIType {

        @XmlValue
        @XmlSchemaType(name = "anyURI")
        protected String value;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
        
        public AttributedURIType() {
        }
    }

    /**
     * <p>Java class for ReferenceParametersType complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType name="ReferenceParametersType">
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;any/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "ReferenceParametersType", propOrder = {
        "any"
    })
    private static class ReferenceParametersType {

        @XmlAnyElement(lax = true)
        protected List<Object> any;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
        
        public ReferenceParametersType() {
        }
    }

    /**
     * <p>Java class for MetadataType complex type.
     * 
     * <p>The following schema fragment specifies the expected content contained within this class.
     * 
     * <pre>
     * &lt;complexType name="MetadataType">
     *   &lt;complexContent>
     *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       &lt;sequence>
     *         &lt;any/>
     *       &lt;/sequence>
     *     &lt;/restriction>
     *   &lt;/complexContent>
     * &lt;/complexType>
     * </pre>
     * 
     * 
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "MetadataType", propOrder = {
        "any"
    })
    private static class MetadataType {

        @XmlAnyElement(lax = true)
        protected List<Object> any;
        @XmlAnyAttribute
        private Map<QName, String> otherAttributes = new HashMap<QName, String>();
        
        public MetadataType() {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



