- public QName(final URI namespace, final String localName) {
- this(QNameModule.create(namespace, null), localName);
- }
-
- private static String checkLocalName(final String localName) {
- if (localName == null) {
- throw new IllegalArgumentException("Parameter 'localName' may not be null.");
- }
- if (localName.length() == 0) {
- throw new IllegalArgumentException("Parameter 'localName' must be a non-empty string.");
- }
-
- for (char c : ILLEGAL_CHARACTERS) {
- if (localName.indexOf(c) != -1) {
- throw new IllegalArgumentException(String.format(
- "Parameter 'localName':'%s' contains illegal character '%s'", localName, c));
- }
- }
- return localName;
+ private QName(final URI namespace, final String localName) {
+ this(QNameModule.create(namespace), checkLocalName(localName));