javax.xml.namespace

Class QName

Implemented Interfaces:
Serializable

public class QName
extends Object
implements Serializable

QName class represents the value of a qualified name as specified in XML Schema Part2: Datatypes specification.

The value of a QName contains a namespaceURI, a localPart and a prefix. The localPart provides the local part of the qualified name. The namespaceURI is a URI reference identifying the namespace.

See Also:
Serialized Form

Constructor Summary

QName(String localPart)
Constructor for the QName.
QName(String namespaceURI, String localPart)
Constructor for the QName.
QName(String namespaceURI, String localPart, String prefix)
Constructor for the QName.

Method Summary

boolean
equals(Object obj)
Tests this QName for equality with another object.
String
getLocalPart()
Gets the Local part for this QName
String
getNamespaceURI()
Gets the Namespace URI for this QName
String
getPrefix()
Gets the Prefix for this QName
int
hashCode()
Returns a hash code value for this QName object.
String
toString()
Returns a string representation of this QName
static QName
valueOf(String s)
Returns a QName holding the value of the specified String.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

QName

public QName(String localPart)
Constructor for the QName.
Parameters:
localPart - Local part of the QName
Usages and Demos :

View More Examples of QName(String localPart)
   1:       ServiceFactoryImpl factory = new ServiceFactoryImpl();
   2:       Service service = factory.createService(new QName("ANY_SERVICE_NAME"));
   3: 
   4:         ...
   5:       ServiceFactoryImpl factory = new ServiceFactoryImpl();
   6:       Service service = factory.createService(new QName("ANY_SERVICE_NAME"));
   7: 
   8:       Call call = service.createCall();
   9:       call.setOperationName(new QName(TARGET_NAMESPACE, "echoSimpleUserType"));

View Full Code Here
   1:       ServiceFactoryImpl factory = new ServiceFactoryImpl();
   2:       Service service = factory.createService(new QName("ANY_SERVICE_NAME"));
   3: 
   4:         ...
   5:       ServiceFactoryImpl factory = new ServiceFactoryImpl();
   6:       Service service = factory.createService(new QName("ANY_SERVICE_NAME"));
   7: 
   8:       Call call = service.createCall();
   9:       call.setOperationName(new QName(TARGET_NAMESPACE, "echoSimpleUserType"));

View Full Code Here
   1:                 ServiceFactory.newInstance();
   2:             this.service = factory.createService( new QName( "" ) );
   3:         }
   4:         try{
   5:             _call = (org.act.soap.client.Call) service.createCall();

View Full Code Here
   1:                                             new URL("file:/tmp/foo"), 
   2:                                             new QName(""), 
   3:         ...
   4:                                             new QName(""));
   5:         
   6:         ...
   7:         
   8:         Object o = cf.getConnection(Runnable.class, new URL("file:/tmp/foo"), new QName(""), new QName(""));
   9:         assertNull("got the result (the passed in ConnectionRequestInfo) from out mock manager",

View Full Code Here
   1:    {
   2:       QName xmlName = new QName(paramName);
   3:       addParameter(xmlName, xmlType, javaType, mode, false);
   4:         ...
   5:       OperationMetaData opMetaData = getOperationMetaData();
   6:       QName xmlName = new QName(Constants.DEFAULT_RPC_RETURN_NAME);
   7:       String javaTypeName = javaType.getName();
   8:         ...
   9: 
  10:       return new QName("");
  11:    }

View Full Code Here

QName

public QName(String namespaceURI,
             String localPart)
Constructor for the QName.
Parameters:
namespaceURI - Namespace URI for the QName
localPart - Local part of the QName.
Usages and Demos :

View More Examples of QName(String namespaceURI,String localPart)
   1:     private static final javax.xml.namespace.QName ACTION$0 = 
   2:         new javax.xml.namespace.QName("", "Action");
   3:     
   4:     
   5:     public java.lang.String getAction()

View Full Code Here
   1:     private static final javax.xml.namespace.QName ACTION$0 = 
   2:         new javax.xml.namespace.QName("", "Action");
   3:     
   4:     
   5:     public java.lang.String getAction()

View Full Code Here
   1:         
   2:         port.lookupEndpoint(new javax.xml.namespace.QName("", ""));
   3:             
   4:         port.listEndpoints();

View Full Code Here
   1:         elemField.setFieldName("amount");
   2:         elemField.setXmlName(new javax.xml.namespace.QName("", "Amount"));
   3:         typeDesc.addFieldDesc(elemField);
   4:         ...
   5:         elemField.setFieldName("currencyCode");
   6:         elemField.setXmlName(new javax.xml.namespace.QName("", "CurrencyCode"));
   7:         typeDesc.addFieldDesc(elemField);
   8:     }

View Full Code Here
   1:         attrField.setFieldName("name");
   2:         attrField.setXmlName(new javax.xml.namespace.QName("", "Name"));
   3:         typeDesc.addFieldDesc(attrField);
   4:         ...
   5:         attrField.setFieldName("alias");
   6:         attrField.setXmlName(new javax.xml.namespace.QName("", "Alias"));
   7:         typeDesc.addFieldDesc(attrField);
   8:     }

View Full Code Here

QName

public QName(String namespaceURI,
             String localPart,
             String prefix)
Constructor for the QName.
Parameters:
namespaceURI - Namespace URI for the QName
localPart - Local part of the QName.
prefix - Prefix of the QName.
Usages and Demos :

View More Examples of QName(String namespaceURI,String localPart,String prefix)
   1: {
   2:    public static final QName faultCode = new QName("UnsupportedSecurityToken", Constants.WSSE_PREFIX, Constants.WSSE_NS);
   3: 
   4:    public static final String faultString = "An unsupported token was provided.";

View Full Code Here
   1: {
   2:    public static final QName faultCode = new QName("UnsupportedAlgorithm", Constants.WSSE_PREFIX, Constants.WSSE_NS);
   3: 
   4:    public static final String faultString = "An unsupported signature or encryption algorithm was used.";

View Full Code Here
   1: {
   2:    QName TERMINATIONTIME = new QName( "", "TerminationTime", "wsrf-rl" );
   3: 
   4:    QName JOB_ORIGINATING_USER_NAME =
   5:                  "job_originating_user_name", "wsrf-pr" );

View Full Code Here

Method Details

equals

public final boolean equals(Object obj)
Tests this QName for equality with another object.

If the given object is not a QName or is null then this method returns false.

For two QNames to be considered equal requires that both localPart and namespaceURI must be equal. This method uses String.equals to check equality of localPart and namespaceURI. Any class that extends QName is required to satisfy this equality contract.

This method satisfies the general contract of the Object.equals method.

Overrides:
equals in interface Object
Parameters:
obj - the reference object with which to compare
Returns:
true if the given object is identical to this QName: false otherwise.
Usages and Demos :

View More Examples of equals(Object obj)
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     public final QName name;
   7: 
   8:         ...
   9:     public SimpleNameClass(QName name) {
  10:         this.name = name;
  11:         ...
  12:     public boolean contains(QName name) {
  13:         return this.name.equals(name);

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:     {
   6:         QName qname = XmlUtils.getElementQName(xml);
   7:         ...
   8:         return qname.equals(SoapConstants.FAULT_QNAME);
   9:     }

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import javax.xml.ws.handler.PortInfo;
   4:         ...
   5:     private String bindingId;
   6:     private QName portName;
   7:         ...
   8:     private QName serviceName;
   9:         
  10:         ...
  11:             PortInfo info = (PortInfo) obj;
  12:             if (bindingId.equals(info.getBindingID()) &&

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import javax.xml.soap.Name;
   4:         ...
   5: {
   6:    private QName qname;
   7: 
   8:         ...
   9:       NameImpl other = (NameImpl)obj;
  10:       return qname.equals(other.qname);
  11:    }

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:     public void testEquals() throws Exception {
   6:         assertTrue("One instance is the same as itself", qn1.equals(qn1));
   7:         ...
   8:         assertTrue("Two equivalent instances are equal qn1=qn2", qn1.equals(qn2));
   9:         ...
  10:         assertTrue("Two equivalent instances are equal qn2=qn1", qn2.equals(qn1));

View Full Code Here

getLocalPart

public String getLocalPart()
Gets the Local part for this QName
Returns:
Local part
Usages and Demos :

View More Examples of getLocalPart()
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     public final QName tagName;
   7: 
   8:         ...
   9: 
  10:     public TypeReference(QName tagName, Type type, Annotation... annotations) {
  11:         if(tagName==null || type==null || annotations==null)
  12:         ...
  13: 
  14:         this.tagName = new QName(tagName.getNamespaceURI().intern(), tagName.getLocalPart().intern(), tagName.getPrefix());

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:         Type elemType = elem.getType();
   6:         QName elemName = elem.getName();
   7: 
   8:         ...
   9:             {
  10:                 elemType.setName(new QName(elemName.getNamespaceURI(), elemName.getLocalPart() + "Type" + (i==0 ? "" : "" + i)));

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import javax.xml.rpc.holders.BigDecimalHolder;
   4:         ...
   5:       log.info("echoQName: " + val.value);
   6:       QName qn = val.value;
   7:         ...
   8:       val.value = new QName(qn.getNamespaceURI(), qn.getLocalPart() + "Response", qn.getPrefix());
   9:    }

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     private HashMap<QName, ElementParser> parsers = new HashMap<QName, ElementParser>();
   7:     
   8:         ...
   9:             if ( name.getNamespaceURI() == null ) {
  10:                 name = new QName( defaultName, name.getLocalPart() );
  11:             }
  12:         ...
  13:             if ( name.getNamespaceURI() == null ) {
  14:                 name = new QName( defaultName, name.getLocalPart() );

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:         register(MethodParser.QNAME, new MethodParser(this));
   7:         ...
   8:         register(RunAsParser.QNAME, new RunAsParser(this));
   9:         register(AuthMethodParser.QNAME, new AuthMethodParser(this));
  10:         ...
  11:         if (runAsType == null) {
  12:             QName methodName = new QName(method.getLocalPart());

View Full Code Here

getNamespaceURI

public String getNamespaceURI()
Gets the Namespace URI for this QName
Returns:
Namespace URI
Usages and Demos :

View More Examples of getNamespaceURI()
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     public final QName tagName;
   7: 
   8:         ...
   9: 
  10:     public TypeReference(QName tagName, Type type, Annotation... annotations) {
  11:         if(tagName==null || type==null || annotations==null)
  12:         ...
  13: 
  14:         this.tagName = new QName(tagName.getNamespaceURI().intern(), tagName.getLocalPart().intern(), tagName.getPrefix());

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:         Type elemType = elem.getType();
   6:         QName elemName = elem.getName();
   7: 
   8:         ...
   9:             {
  10:                 elemType.setName(new QName(elemName.getNamespaceURI(), elemName.getLocalPart() + "Type" + (i==0 ? "" : "" + i)));

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import javax.xml.rpc.holders.BigDecimalHolder;
   4:         ...
   5:       log.info("echoQName: " + val.value);
   6:       QName qn = val.value;
   7:         ...
   8:       val.value = new QName(qn.getNamespaceURI(), qn.getLocalPart() + "Response", qn.getPrefix());
   9:    }

View Full Code Here
   1: import javax.xml.bind.JAXBContext;
   2: import javax.xml.namespace.QName;
   3: import javax.xml.stream.XMLStreamReader;
   4:         ...
   5:     
   6:     protected void common(String wsdl, QName portName, Class... jaxbClasses) throws Exception {
   7:         control = EasyMock.createNiceControl();
   8:         ...
   9:             new WSDLServiceFactory(bus, getClass().getResource(wsdl),
  10:                                    new QName(portName.getNamespaceURI(), "XMLService"));

View Full Code Here
   1: package sk.uniba.euromath.editor.widgets.namelist;
   2: import javax.xml.namespace.QName;
   3: import org.apache.commons.lang.StringUtils;
   4:         ...
   5:     public abstract String getLocal(int i);
   6:     public abstract QName getForeign(int i);
   7:     public abstract String getNamespace(int i);
   8:         ...
   9:             case ITEM_FOREIGN:
  10:                 return getForeign(i).getNamespaceURI();
  11:             case ITEM_NAMESPACE:
  12:         ...
  13:             case ITEM_FOREIGN:
  14:                 return getForeign(i).getNamespaceURI();

View Full Code Here

getPrefix

public String getPrefix()
Gets the Prefix for this QName
Returns:
Prefix
Usages and Demos :

View More Examples of getPrefix()
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     public final QName tagName;
   7: 
   8:         ...
   9: 
  10:     public TypeReference(QName tagName, Type type, Annotation... annotations) {
  11:         if(tagName==null || type==null || annotations==null)
  12:         ...
  13: 
  14:         this.tagName = new QName(tagName.getNamespaceURI().intern(), tagName.getLocalPart().intern(), tagName.getPrefix());

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import javax.xml.soap.Name;
   4:         ...
   5: {
   6:    private QName qname;
   7: 
   8:         ...
   9:    {
  10:       return qname.getPrefix();
  11:    }

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import java.io.IOException;
   4:         ...
   5: public class QAttr extends QNode implements Attr {
   6:   QName _name;
   7:   private String _value;
   8:         ...
   9:   {
  10:     _name = new QName(name);
  11:   }
  12:         ...
  13:   {
  14:     return _name.getPrefix();

View Full Code Here
   1: 
   2:   public void appendFaultSubcode(QName subcode) 
   3:     throws SOAPException
   4:         ...
   5:   {
   6:     if (subcode.getPrefix() == null || 
   7:         ...
   8:         "".equals(subcode.getPrefix()))
   9:       throw new SOAPException("Fault subcodes must have qualified names");
  10:         ...
  11: 
  12:     if (getNamespaceURI(subcode.getPrefix()) == null) {

View Full Code Here
   1: import org.apache.ws.util.i18n.MessagesImpl;
   2: import javax.xml.namespace.QName;
   3: import javax.xml.soap.Name;
   4:         ...
   5: 
   6:    public static Name toName( QName qname )
   7:    throws SOAPException
   8:         ...
   9:       return createName( qname.getLocalPart(  ),
  10:                          qname.getPrefix(  ),
  11:                          qname.getNamespaceURI(  ) );

View Full Code Here

hashCode

public final int hashCode()
Returns a hash code value for this QName object. The hash code is based on both the localPart and namespaceURI parts of the QName. This method satisfies the general contract of the Object.hashCode method.
Overrides:
hashCode in interface Object
Returns:
a hash code value for this Qname object
Usages and Demos :

View More Examples of hashCode()
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     public final QName name;
   7: 
   8:         ...
   9:     public SimpleNameClass(QName name) {
  10:         this.name = name;
  11:         ...
  12:     public int hashCode() {
  13:         return name.hashCode();

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: abstract class XmlItemProp extends Prop {
   6:     private final QName name;
   7:     private final JType type;
   8:         ...
   9: 
  10:     public XmlItemProp(QName name, JType valueType) {
  11:         this.name = name;
  12:         ...
  13:     public final int hashCode() {
  14:         return name.hashCode()*29 + type.hashCode();

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     private final QName qName;
   7:     private final String qNameScope;
   8:         ...
   9:     public int hashCode() {
  10:         return qName.hashCode();
  11:     }

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:    public String string;
   6:    public QName qname;
   7:    public Composite composite;
   8:         ...
   9:       int result;
  10:       result = (integer != null ? integer.hashCode() : 0);
  11:         ...
  12:       result = 29 * result + (dateTime != null ? dateTime.hashCode() : 0);

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: 
   6:     private final QName qName;
   7:     private final String qNameScope;
   8:         ...
   9:     public int hashCode() {
  10:         return qName.hashCode();
  11:     }

View Full Code Here

toString

public String toString()
Returns a string representation of this QName
Overrides:
toString in interface Object
Returns:
a string representation of the QName
Usages and Demos :

View More Examples of toString()
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5: final class GElementImpl extends GElement {
   6:     public final QName tagName;
   7: 
   8:         ...
   9: 
  10:     public GElementImpl(QName tagName, XSElementDecl decl) {
  11:         this.tagName = tagName;
  12:         ...
  13:     public String toString() {
  14:         return tagName.toString();

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:     protected final String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
   6:         QName qName = resolveQName(messageContext);
   7:         ...
   8:         return qName != null ? qName.toString() : null;
   9:     }

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:       
   6:       QName portType = null;
   7:       try
   8:         ...
   9:       
  10:       return portType.toString();
  11:    }

View Full Code Here
   1: import java.lang.reflect.Method;
   2: import javax.xml.namespace.QName;
   3: import javax.xml.transform.TransformerFactory;
   4:         ...
   5:     protected String getLookupKeyForMessage(MessageContext messageContext) throws Exception {
   6:         QName qName = PayloadRootUtils
   7:                 .getPayloadRootQName(messageContext.getRequest().getPayloadSource(), transformerFactory);
   8:         ...
   9:         return qName != null ? qName.toString() : null;
  10:     }
  11:         ...
  12:             }
  13:             return qname.toString();

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import javax.xml.soap.Name;
   4:         ...
   5: {
   6:    private QName qname;
   7: 
   8:         ...
   9:    {
  10:       return qname.toString();
  11:    }

View Full Code Here

valueOf

public static QName valueOf(String s)
Returns a QName holding the value of the specified String.

The string must be in the form returned by the QName.toString() method, i.e. "{namespaceURI}localPart", with the "{namespaceURI}" part being optional.

This method doesn't do a full validation of the resulting QName. In particular, it doesn't check that the resulting namespace URI is a legal URI (per RFC 2396 and RFC 2732), nor that the resulting local part is a legal NCName per the XML Namespaces specification.

Parameters:
s - the string to be parsed
Returns:
QName corresponding to the given String
Throws:
IllegalArgumentException - If the specified String cannot be parsed as a QName
Usages and Demos :

View More Examples of valueOf(String s)
   1: package csoap.deployment;
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:   String name, mode ="IN";
   6:   QName qname;
   7:   public parameterOperation(String Name, QName Qname, String Mode) {
   8:         ...
   9:   {
  10:     qname = QName.valueOf("{"+uri+"}"+Qname.substring(Qname.indexOf(":")+1));
  11:   }
  12:         ...
  13:   else qname = QName.valueOf("{"+uri+"}"+Qname);

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: 
   4:         ...
   5:  }
   6:  public beanMapping(String qname, String uri, String type)
   7:  {
   8:         ...
   9:    if (qname.indexOf(":") != -1)
  10:    {
  11:         ...
  12:  {
  13:    return QName.valueOf("{"+Uri+"}"+Name);

View Full Code Here
   1: 
   2: import javax.xml.namespace.QName;
   3: import java.io.Serializable;
   4:         ...
   5: 
   6:     public QName getServiceName()
   7:     {
   8:         ...
   9: 
  10:     public QName getPortType()
  11:     {

View Full Code Here
   1: import java.lang.reflect.Array;
   2: import javax.xml.namespace.QName;
   3: import javax.xml.rpc.encoding.XMLType;
   4:         ...
   5:   String prefix ="", type ="", uri ="";
   6:   QName xmlType;
   7:   Mapping mapping = new Mapping();
   8:         ...
   9:       JAVATypes.addElement(long.class);
  10:       JAVATypes.addElement(javax.xml.namespace.QName.class);
  11:       JAVATypes.addElement(short.class);
  12:         ...
  13:       }
  14:       xmlType = QName.valueOf("{"+uri+"}"+type);

View Full Code Here
   1: import org.apache.xmlbeans.XmlOptions;
   2: import javax.xml.namespace.QName;
   3: import java.io.InputStream;
   4:         ...
   5: {
   6:    public static final QName SERVICE_NAME =
   7: 
   8:         ...
   9:    public static final QName PORT_TYPE =

View Full Code Here