View Javadoc

1   /*
2    *  Copyright (c) 2008 Rodrigo Ruiz
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   */
16  package org.apache.axis.message.addressing;
17  
18  import javax.xml.namespace.QName;
19  import javax.xml.soap.SOAPElement;
20  
21  import org.apache.axis.description.TypeDesc;
22  import org.apache.axis.encoding.Deserializer;
23  import org.apache.axis.encoding.Serializer;
24  import org.apache.axis.encoding.ser.BeanDeserializer;
25  import org.apache.axis.encoding.ser.BeanSerializer;
26  import org.w3c.dom.Element;
27  
28  /**
29   * Java content class for ReferencePropertiesType complex type.
30   * <p>
31   * The following schema fragment specifies the expected content contained within
32   * this java content object. (defined at
33   * http://schemas.xmlsoap.org/ws/2004/08/addressing line 62)
34   * <p>
35   *
36   * <pre>
37   * &lt;complexType name=&quot;ReferencePropertiesType&quot;&gt;
38   *   &lt;complexContent&gt;
39   *     &lt;restriction base=&quot;{http://www.w3.org/2001/XMLSchema}anyType&quot;&gt;
40   *       &lt;sequence&gt;
41   *         &lt;any/&gt;
42   *       &lt;/sequence&gt;
43   *     &lt;/restriction&gt;
44   *   &lt;/complexContent&gt;
45   * &lt;/complexType&gt;
46   * </pre>
47   *
48   * @author Davanum Srinivas
49   * @author Rodrigo Ruiz
50   * @version $Revision: 14 $
51   */
52  public class ReferencePropertiesType extends AnyContentTypeList {
53  
54    /**
55     * <code>serialVersionUID</code> attribute.
56     */
57    private static final long serialVersionUID = 5394217943280242975L;
58  
59    /**
60     * Type meta-data.
61     */
62    private static final TypeDesc TYPE_DESC = new TypeDesc(ReferencePropertiesType.class,
63      true);
64  
65    static {
66      String ns = Constants.NS_URI_ADDRESSING_DEFAULT;
67      TYPE_DESC.setXmlType(new QName(ns, "ReferencePropertiesType"));
68    }
69  
70    /**
71     * Parses an XML element node and extracts an instance of this class.
72     *
73     * @param element Element to parse
74     * @return Resulting instance
75     */
76    public static ReferencePropertiesType fromElement(Element element) {
77      ReferencePropertiesType props = new ReferencePropertiesType();
78      fromElement(props, element);
79      return props;
80    }
81  
82    /**
83     * Parses a SOAP element and extracts an instance of this class.
84     *
85     * @param element Element to parse
86     * @return Resulting instance
87     */
88    public static ReferencePropertiesType fromSOAPElement(SOAPElement element) {
89      ReferencePropertiesType props = new ReferencePropertiesType();
90      fromSOAPElement(props, element);
91      return props;
92    }
93  
94    /**
95     * Gets a custom Deserializer.
96     *
97     * @param mType not used
98     * @param jType Java type
99     * @param xType XML type
100    * @return A Deserializer instance
101    */
102   public static Deserializer getDeserializer(String mType, Class<?> jType, QName xType) {
103     return new BeanDeserializer(jType, xType, TYPE_DESC);
104   }
105 
106   /**
107    * Gets a custom Serializer.
108    *
109    * @param mType not used
110    * @param jType Java type
111    * @param xType XML type
112    * @return A Serializer instance
113    */
114   public static Serializer getSerializer(String mType, Class<?> jType, QName xType) {
115     return new BeanSerializer(jType, xType, TYPE_DESC);
116   }
117 
118   /**
119    * Return the type description object.
120    *
121    * @return Type type description for this class
122    */
123   public static TypeDesc getTypeDesc() {
124     return TYPE_DESC;
125   }
126 
127   /**
128    * Constructor ReferenceProperties.
129    */
130   public ReferencePropertiesType() {
131   }
132 
133   /**
134    * Constructor ReferenceProperties.
135    *
136    * @param element Content of this instance
137    */
138   public ReferencePropertiesType(Object element) {
139     super(element);
140   }
141 
142   /**
143    * Constructor ReferenceProperties (performs shallow copy).
144    *
145    * @param properties Properties to copy from
146    */
147   public ReferencePropertiesType(ReferencePropertiesType properties) {
148     super(properties, false);
149   }
150 
151   /**
152    * Constructor ReferenceProperties.
153    *
154    * @param properties Properties to copy from
155    * @param deepCopy Whether to perform a deep or shallow copy
156    */
157   public ReferencePropertiesType(ReferencePropertiesType properties, boolean deepCopy) {
158     super(properties, deepCopy);
159   }
160 
161   /**
162    * {@inheritDoc}
163    */
164   public void append(Element parent) {
165     append(parent, Constants.REFERENCE_PROPERTIES);
166   }
167 
168   /**
169    * {@inheritDoc}
170    */
171   @Override
172   public String toString() {
173     return super.toString("Reference properties");
174   }
175 
176 }