public class NamespacePrefixMapper extends Object
Maps namespace URI
's to prefixes.
When validating xml documents including namespaces, the issue of prefixes (the short expression before the colon in a universal name) becomes important. DTDs are not namespace aware and so a fixed prefixed must be chosen and used consistently. This class is used to supply consistent, user specified prefixes.
Constructor and Description |
---|
NamespacePrefixMapper() |
Modifier and Type | Method and Description |
---|---|
protected String |
generatePrefix(String namespaceUri)
Generates a prefix for the given namespace Uri.
|
String |
getPrefix(String namespaceUri)
Gets the prefix to be used with the given namespace URI
|
void |
setPrefix(String namespaceUri,
String prefix)
Sets the prefix to be used for the given namespace URI.
|
public String getPrefix(String namespaceUri)
namespaceUri
- public void setPrefix(String namespaceUri, String prefix)
namespaceUri
- prefix
- protected String generatePrefix(String namespaceUri)
namespaceUri
- URI, not nullCopyright © 2002-2013 Apache Software Foundation. All Rights Reserved.