axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sam Ruby" <ru...@us.ibm.com>
Subject RE: [jsr110-eg-disc] Re: QNames
Date Thu, 04 Oct 2001 19:10:56 GMT
Roberto Chinnici wrote:
>
> How about making QName a concrete, final class with *immutable*
> instances much like java.net.URI in JDK 1.4.0? It doesn't make
> much sense to me to modify a QName after it's been created.
>
> Here's what it would look like (basically, it's Rahul's version,
> made concrete, final and with setters removed):
>
> public final class QName implements Serializable {
>     public QName(String localPart) { this("", localPart); }
>     public QName(String namespaceURI, String localPart) {...}
>     public String getNamespaceURI() {...}
>     public String getLocalPart() {...}
>     public int hashCode() {...}
>     public boolean equals(Object obj) {...}
>
>     private String namespaceURI;
>     private String localPart;
> }

If these are immutable, it would be nice if there was a built in mechanism
for them to be pooled.  A factory or a static interface to retrieve (or
create) a QName given a localPart and an optional namespace URI would be
handy...


Mime
View raw message