blob: 5da73a677cb0817a97c3cd5e501574f040d25f5a [file] [log] [blame]
/*
* Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Sun designates this
* particular file as subject to the "Classpath" exception as provided
* by Sun in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
package com.sun.tools.internal.ws.wsdl.document.schema;
import javax.xml.namespace.QName;
import com.sun.tools.internal.ws.wsdl.framework.WriterContext;
/**
*
* @author WS Development Team
*/
public class SchemaAttribute {
public SchemaAttribute() {
}
public SchemaAttribute(String localName) {
_localName = localName;
}
public String getNamespaceURI() {
return _nsURI;
}
public void setNamespaceURI(String s) {
_nsURI = s;
}
public String getLocalName() {
return _localName;
}
public void setLocalName(String s) {
_localName = s;
}
public QName getQName() {
return new QName(_nsURI, _localName);
}
public String getValue() {
if (_qnameValue != null) {
if (_parent == null) {
throw new IllegalStateException();
} else {
return _parent.asString(_qnameValue);
}
} else {
return _value;
}
}
public String getValue(WriterContext context) {
if (_qnameValue != null) {
return context.getQNameString(_qnameValue);
} else {
return _value;
}
}
public void setValue(String s) {
_value = s;
}
public void setValue(QName name) {
_qnameValue = name;
}
public SchemaElement getParent() {
return _parent;
}
public void setParent(SchemaElement e) {
_parent = e;
}
private String _nsURI;
private String _localName;
private String _value;
private QName _qnameValue;
private SchemaElement _parent;
}