|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nees.metadata.util.IdFactory
org.nees.metadata.util.EncodedIdFactory
org.nees.metadata.util.HexIdFactory
Generates ID's whose local parts are hex-encoded. This is to facilitate using arbitrary octet strings as local parts even if they do not conform to the subset of XML nmtoken supported by NMDS. Also provides the optional convenience of encoding a character string into an octet string.
For instance this code:
HexIdFactory hif = new HexIdFactory();
hif.setPrefix("x");
Identifier id = hif.newId("/C=US/O=National Computational Science Alliance/CN=Joseph M. Futrelle");");
System.out.println(id.getLocalPart());
Will produce the following output:
x... FIXME
| Field Summary |
| Fields inherited from class org.nees.metadata.util.EncodedIdFactory |
DEFAULT_STRING_ENCODING |
| Constructor Summary | |
HexIdFactory()
|
|
HexIdFactory(java.lang.String namespaceURI)
Creates a factory that produces Identifiers in a given namespace. |
|
HexIdFactory(java.lang.String namespaceURI,
java.lang.String prefix)
|
|
| Method Summary | |
byte[] |
decode(java.lang.String encoded)
Subclasses implement this for specific decoding behavior. |
java.lang.String |
encode(byte[] octets)
Subclasses implement this for specific encoding behavior. |
java.lang.String |
getDefaultPrefix()
|
| Methods inherited from class org.nees.metadata.util.EncodedIdFactory |
decodeToOctets, decodeToString, decodeToString, getPrefix, getStringEncoding, newId, newId, newId, newId, setPrefix, setStringEncoding |
| Methods inherited from class org.nees.metadata.util.IdFactory |
getFactory, getFactory, getNamespaceURI, newId, newIdPromise, setNamespaceURI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HexIdFactory()
public HexIdFactory(java.lang.String namespaceURI)
namespaceURI - the namespace URI
public HexIdFactory(java.lang.String namespaceURI,
java.lang.String prefix)
namespaceURI - the namespace URIprefix - the prefix to append to the local part| Method Detail |
public java.lang.String getDefaultPrefix()
getDefaultPrefix in class EncodedIdFactorypublic java.lang.String encode(byte[] octets)
EncodedIdFactory
encode in class EncodedIdFactoryoctets - the binary data to encode
public byte[] decode(java.lang.String encoded)
throws EncodingException
EncodedIdFactory
decode in class EncodedIdFactoryEncodingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||