001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common Development
008: * and Distribution License("CDDL") (collectively, the "License"). You
009: * may not use this file except in compliance with the License. You can obtain
010: * a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011: * or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific
012: * language governing permissions and limitations under the License.
013: *
014: * When distributing the software, include this License Header Notice in each
015: * file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016: * Sun designates this particular file as subject to the "Classpath" exception
017: * as provided by Sun in the GPL Version 2 section of the License file that
018: * accompanied this code. If applicable, add the following below the License
019: * Header, with the fields enclosed by brackets [] replaced by your own
020: * identifying information: "Portions Copyrighted [year]
021: * [name of copyright owner]"
022: *
023: * Contributor(s):
024: *
025: * If you wish your version of this file to be governed by only the CDDL or
026: * only the GPL Version 2, indicate your decision by adding "[Contributor]
027: * elects to include this software in this distribution under the [CDDL or GPL
028: * Version 2] license." If you don't indicate a single choice of license, a
029: * recipient has the option to distribute your version of this file under
030: * either the CDDL, the GPL Version 2 or to extend the choice of license to
031: * its licensees as provided above. However, if you add GPL Version 2 code
032: * and therefore, elected the GPL Version 2 license, then the option applies
033: * only if the new code is made subject to such option by the copyright
034: * holder.
035: */
036:
037: /*
038: * SequenceElement.java
039: *
040: * @author Mike Grogan
041: * Created on October 23, 2005, 9:34 AM
042: *
043: */
044:
045: package com.sun.xml.ws.rm.v200502;
046:
047: import com.sun.xml.ws.rm.protocol.*;
048:
049: import javax.xml.bind.annotation.*;
050: import javax.xml.namespace.QName;
051: import java.util.ArrayList;
052: import java.util.HashMap;
053: import java.util.List;
054: import java.util.Map;
055:
056: /**
057: * SequenceElement is based on a JAXB Schema Compiler generated class that serializes
058: * and deserialized the <code>SequenceType</code> defined in the WS-RM schema.
059: */
060: @XmlAccessorType(XmlAccessType.FIELD)
061: @XmlType(name="SequenceType")
062: @XmlRootElement(name="Sequence",namespace="http://schemas.xmlsoap.org/ws/2005/02/rm")
063: public class SequenceElement extends AbstractSequence {
064:
065: @XmlElement(name="Identifier",namespace="http://schemas.xmlsoap.org/ws/2005/02/rm")
066: protected Identifier identifier;
067:
068: @XmlElement(name="MessageNumber",namespace="http://schemas.xmlsoap.org/ws/2005/02/rm")
069: protected Integer messageNumber;
070:
071: @XmlElement(name="LastMessage",namespace="http://schemas.xmlsoap.org/ws/2005/02/rm")
072: protected LastMessage lastMessage;
073:
074: @XmlAnyElement(lax=true)
075: protected List<Object> any;
076:
077: @XmlAnyAttribute
078: private Map<QName, String> otherAttributes = new HashMap<QName, String>();
079:
080: public SequenceElement() {
081:
082: }
083:
084: public String getLocalPart() {
085: return new String("Sequence");
086: }
087:
088: /**
089: * Mutator for the Id property. Maps to the Identifier property in the underlying
090: * JAXB class.
091: *
092: * @param id The new value.
093: */
094: public void setId(String id) {
095: Identifier identifier = new Identifier();
096: identifier.setValue(id);
097: setIdentifier(identifier);
098: }
099:
100: /**
101: * Accessor for the Id property. Maps to the Identifier property in the underlying
102: * JAXB class
103: * @return The sequence id
104: */
105: public String getId() {
106: return getIdentifier().getValue();
107: }
108:
109: /**
110: * Mutator for the Number property which maps to the MessageNumber property in
111: * the underlying JAXB class.
112: *
113: * @param l The Message number.
114: */
115: public void setNumber(int l) {
116: setMessageNumber(l);
117: }
118:
119: /**
120: * Accessor for the Number property which maps to the MessageNumber property in
121: * the underlying JAXB class.
122: *
123: * @return The Message number.
124: */
125: public int getNumber() {
126: return getMessageNumber();
127: }
128:
129: /**
130: * Mutator for the Last property that maps to the LastMessage property in the
131: * underlying JAXB class
132: *
133: * @param last The value of the property.
134: */
135: public void setLast(boolean last) {
136: if (last) {
137: setLastMessage(new LastMessage());
138: } else {
139: setLastMessage(null);
140: }
141: }
142:
143: /**
144: * Accessor for the Last property that maps to the LastMessage property in the
145: * underlying JAXB class
146: *
147: * @return The value of the property.
148: */
149: public boolean getLast() {
150: return getLastMessage() != null;
151: }
152:
153: /**
154: * Gets the value of the identifier property.
155: *
156: * @return The property value
157: */
158: public Identifier getIdentifier() {
159: return identifier;
160: }
161:
162: /**
163: * Sets the value of the identifier property.
164: *
165: * @param value The new value.
166: */
167: public void setIdentifier(Identifier value) {
168: this .identifier = value;
169: }
170:
171: /**
172: * Gets the value of the messageNumber property.
173: *
174: * @return The value of the property.
175: *
176: */
177: public Integer getMessageNumber() {
178: return messageNumber;
179: }
180:
181: /**
182: * Sets the value of the messageNumber property.
183: *
184: * @param value The new value.
185: *
186: */
187: public void setMessageNumber(Integer value) {
188: this .messageNumber = value;
189: }
190:
191: /**
192: * Gets the value of the lastMessage property.
193: *
194: * @return The value of the property
195: * non-null indicates that a Last child will be serialized on
196: * the Sequence element.
197: *
198: */
199: public LastMessage getLastMessage() {
200: return lastMessage;
201: }
202:
203: /**
204: * Sets the value of the lastMessage property.
205: *
206: * @param value The new value. Either null or a member
207: * of the placeholder inner LastMessage class.
208: *
209: *
210: */
211: public void setLastMessage(LastMessage value) {
212: this .lastMessage = value;
213: }
214:
215: /**
216: * Gets the value of the any property.
217: *
218: * @return The value of the property.
219: *
220: *
221: */
222: public List<Object> getAny() {
223: if (any == null) {
224: any = new ArrayList<Object>();
225: }
226: return this .any;
227: }
228:
229: /**
230: * Gets a map that contains attributes that aren't bound to any typed property on this class.
231: *
232: * @return The map of attributes.
233: */
234: public Map<QName, String> getOtherAttributes() {
235: return otherAttributes;
236: }
237:
238: /**
239: * <p>Java class for anonymous complex type. That acts as a
240: * placeholder in the <code>lastMessage</code> field.
241: *
242: */
243: @XmlAccessorType(XmlAccessType.FIELD)
244: @XmlType(name="")
245: public static class LastMessage {
246: }
247:
248: public String toString() {
249:
250: return com.sun.xml.ws.rm.protocol.Messages.SEQUENCE_TOSTRING_STRING
251: .format(getId(), getNumber(), getLast() ? "true"
252: : "false");
253: }
254:
255: }
|