ws-soap-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@locus.apache.org
Subject cvs commit: xml-soap/java/src/org/apache/soap/util/xml QName.java
Date Mon, 04 Sep 2000 21:19:25 GMT
gdaniels    00/09/04 14:19:25

  Modified:    java/src/org/apache/soap/util/xml QName.java
  Log:
  Add a constructor which takes a QName string.  This enables us to
  serialize/deserialize QNames with the base-type code in SOAPMappingRegistry.
  
  Revision  Changes    Path
  1.3       +28 -0     xml-soap/java/src/org/apache/soap/util/xml/QName.java
  
  Index: QName.java
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/QName.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QName.java	2000/05/30 10:24:44	1.2
  +++ QName.java	2000/09/04 21:19:24	1.3
  @@ -102,6 +102,34 @@
       setNamespaceURI(namespaceURI);
       setLocalPart(localPart);
     }
  +  
  +  public QName(String strQName)
  +  {
  +	if (strQName == null) {
  +		setLocalPart(null);
  +		setNamespaceURI(null);
  +		return;
  +	}
  +	
  +	int idx = strQName.indexOf(":");
  +
  +	String namespaceURI;
  +	if (idx <= 0) {
  +		namespaceURI = "";  // "", or null?
  +	} else {
  +		namespaceURI = strQName.substring(0, idx);
  +	}
  +	setNamespaceURI(namespaceURI);
  +	idx++;
  +	
  +	String localPart;
  +	if (idx == strQName.length()) {
  +		localPart = "";
  +	} else {
  +		localPart = strQName.substring(idx);
  +	}
  +	setLocalPart(localPart);
  +  }
   
     public void setNamespaceURI(String namespaceURI)
     {
  
  
  

Mime
View raw message