001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025: package com.sun.tools.internal.ws.processor.model.jaxb;
026:
027: import javax.xml.namespace.QName;
028:
029: import com.sun.tools.internal.ws.processor.model.java.JavaStructureMember;
030:
031: /**
032: * @author Kathy Walsh, Vivek Pandey
033: *
034: *
035: */
036:
037: public class JAXBElementMember {
038: public JAXBElementMember() {
039: }
040:
041: public JAXBElementMember(QName name, JAXBType type) {
042: this (name, type, null);
043: }
044:
045: public JAXBElementMember(QName name, JAXBType type,
046: JavaStructureMember javaStructureMember) {
047: _name = name;
048: _type = type;
049: _javaStructureMember = javaStructureMember;
050: }
051:
052: public QName getName() {
053: return _name;
054: }
055:
056: public void setName(QName n) {
057: _name = n;
058: }
059:
060: public JAXBType getType() {
061: return _type;
062: }
063:
064: public void setType(JAXBType t) {
065: _type = t;
066: }
067:
068: public boolean isRepeated() {
069: return _repeated;
070: }
071:
072: public void setRepeated(boolean b) {
073: _repeated = b;
074: }
075:
076: public JavaStructureMember getJavaStructureMember() {
077: return _javaStructureMember;
078: }
079:
080: public void setJavaStructureMember(
081: JavaStructureMember javaStructureMember) {
082: _javaStructureMember = javaStructureMember;
083: }
084:
085: public boolean isInherited() {
086: return isInherited;
087: }
088:
089: public void setInherited(boolean b) {
090: isInherited = b;
091: }
092:
093: public JAXBProperty getProperty() {
094: if (_prop == null && _type != null) {
095: for (JAXBProperty prop : _type.getWrapperChildren()) {
096: if (prop.getElementName().equals(_name))
097: setProperty(prop);
098: }
099: }
100: return _prop;
101: }
102:
103: public void setProperty(JAXBProperty prop) {
104: _prop = prop;
105: }
106:
107: private QName _name;
108: private JAXBType _type;
109: private JavaStructureMember _javaStructureMember;
110: private boolean _repeated;
111: private boolean isInherited = false;
112: private JAXBProperty _prop;
113: private static final String JAXB_UNIQUE_PARRAM = "__jaxbUniqueParam_";
114: }
|