001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */package org.apache.cxf.service.model;
019:
020: import javax.xml.namespace.QName;
021:
022: import org.apache.ws.commons.schema.XmlSchemaAnnotated;
023:
024: public final class MessagePartInfo extends AbstractPropertiesHolder {
025:
026: private QName pname;
027: private AbstractMessageContainer mInfo;
028:
029: private boolean isElement;
030: private QName typeName;
031: private QName elementName;
032: private QName concreteName;
033: private XmlSchemaAnnotated xmlSchema;
034: private Class<?> typeClass;
035: private int index;
036:
037: public MessagePartInfo(QName n, AbstractMessageContainer info) {
038: mInfo = info;
039: pname = n;
040: }
041:
042: /**
043: * @return Returns the name.
044: */
045: public QName getName() {
046: return pname;
047: }
048:
049: /**
050: * @param n The name to set.
051: */
052: public void setName(QName n) {
053: pname = n;
054: }
055:
056: public QName getConcreteName() {
057: return concreteName;
058: }
059:
060: public void setConcreteName(QName concreteName) {
061: this .concreteName = concreteName;
062: }
063:
064: public boolean isElement() {
065: return isElement;
066: }
067:
068: public void setElement(boolean b) {
069: isElement = b;
070: }
071:
072: public QName getElementQName() {
073: if (isElement) {
074: return elementName;
075: }
076: return null;
077: }
078:
079: public QName getTypeQName() {
080: if (!isElement) {
081: return typeName;
082: }
083: return null;
084: }
085:
086: public void setTypeQName(QName qn) {
087: isElement = false;
088: if (concreteName == null) {
089: concreteName = new QName(null, pname.getLocalPart());
090: }
091: typeName = qn;
092: }
093:
094: public void setElementQName(QName qn) {
095: isElement = true;
096: elementName = qn;
097: concreteName = qn;
098: }
099:
100: public AbstractMessageContainer getMessageInfo() {
101: return mInfo;
102: }
103:
104: public XmlSchemaAnnotated getXmlSchema() {
105: return xmlSchema;
106: }
107:
108: public void setXmlSchema(XmlSchemaAnnotated xmlSchema) {
109: this .xmlSchema = xmlSchema;
110: }
111:
112: public Class<?> getTypeClass() {
113: return typeClass;
114: }
115:
116: public void setTypeClass(Class<?> typeClass) {
117: this .typeClass = typeClass;
118: }
119:
120: public int getIndex() {
121: return index;
122: }
123:
124: public void setIndex(int index) {
125: this .index = index;
126: }
127:
128: @Override
129: public String toString() {
130: return new StringBuilder().append("[MessagePartInfo name=")
131: .append(getName()).append(", ConcreteName=").append(
132: getConcreteName()).toString();
133: }
134:
135: }
|