protected String getStringForQName(QName qName, NamespaceResolver namespaceResolver){ if(null == qName) { return null; } if(null == qName.getNamespaceURI()) { return qName.getLocalPart(); } else { String namespaceURI = qName.getNamespaceURI(); if(namespaceResolver == null){ throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI); } String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if(null == prefix) { return qName.getLocalPart(); } else { return prefix + XMLConstants.COLON + qName.getLocalPart(); } } }
private String getStringForQName(QName qName, NamespaceResolver namespaceResolver){ if(null == qName) { return null; } if(null == qName.getNamespaceURI()) { return qName.getLocalPart(); } else { String namespaceURI = qName.getNamespaceURI(); if(namespaceResolver == null){ throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI); } String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if(null == prefix) { return qName.getLocalPart(); } else { return prefix + Constants.COLON + qName.getLocalPart(); } } }
private String getStringForQName(QName qName, NamespaceResolver namespaceResolver){ if(null == qName) { return null; } if(null == qName.getNamespaceURI()) { return qName.getLocalPart(); } else { String namespaceURI = qName.getNamespaceURI(); if(namespaceResolver == null){ throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI); } String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if(null == prefix) { return qName.getLocalPart(); } else { return prefix + XMLConstants.COLON + qName.getLocalPart(); } } }
private String getStringForQName(QName qName, NamespaceResolver namespaceResolver){ if(null == qName) { return null; } if(null == qName.getNamespaceURI()) { return qName.getLocalPart(); } else { String namespaceURI = qName.getNamespaceURI(); if(namespaceResolver == null){ throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI); } String prefix = namespaceResolver.resolveNamespaceURI(namespaceURI); if(null == prefix) { return qName.getLocalPart(); } else { return prefix + Constants.COLON + qName.getLocalPart(); } } }
/** * INTERNAL: * Return the namespace uri for the prefix of the given local name */ private String resolveNamespace(NamespaceResolver namespaceResolver, String localName) { int colonIndex = localName.indexOf(':'); if (colonIndex < 0) { // handle target/default namespace if (namespaceResolver != null) { return namespaceResolver.resolveNamespacePrefix(Constants.EMPTY_STRING); } return null; } else { if (namespaceResolver == null) { //throw an exception if the name has a : in it but the namespaceresolver is null throw XMLMarshalException.namespaceResolverNotSpecified(localName); } String prefix = localName.substring(0, colonIndex); String uri = namespaceResolver.resolveNamespacePrefix(prefix); if (uri == null) { //throw an exception if the prefix is not found in the namespaceresolver throw XMLMarshalException.namespaceNotFound(prefix); } return uri; } }
/** * INTERNAL: * Return the namespace uri for the prefix of the given local name */ private String resolveNamespace(NamespaceResolver namespaceResolver, String localName) { int colonIndex = localName.indexOf(':'); if (colonIndex < 0) { // handle target/default namespace if (namespaceResolver != null) { return namespaceResolver.resolveNamespacePrefix(XMLConstants.EMPTY_STRING); } return null; } else { if (namespaceResolver == null) { //throw an exception if the name has a : in it but the namespaceresolver is null throw XMLMarshalException.namespaceResolverNotSpecified(localName); } String prefix = localName.substring(0, colonIndex); String uri = namespaceResolver.resolveNamespacePrefix(prefix); if (uri == null) { //throw an exception if the prefix is not found in the namespaceresolver throw XMLMarshalException.namespaceNotFound(prefix); } return uri; } }
/** * INTERNAL: * Return the namespace uri for the prefix of the given local name */ private String resolveNamespace(NamespaceResolver namespaceResolver, String localName) { if(localName == null) { return null; } int colonIndex = localName.indexOf(XMLConstants.COLON); if (colonIndex < 0) { // handle target/default namespace if (namespaceResolver != null) { return namespaceResolver.getDefaultNamespaceURI(); } return null; } else { if (namespaceResolver == null) { //throw an exception if the name has a : in it but the namespaceresolver is null throw XMLMarshalException.namespaceResolverNotSpecified(localName); } String prefix = localName.substring(0, colonIndex); String uri = namespaceResolver.resolveNamespacePrefix(prefix); if (uri == null) { //throw an exception if the prefix is not found in the namespaceresolver throw XMLMarshalException.namespaceNotFound(prefix); } return uri; } }
/** * INTERNAL: * Return the namespace uri for the prefix of the given local name */ private String resolveNamespace(NamespaceResolver namespaceResolver, String localName) { int colonIndex = localName.indexOf(':'); if (colonIndex < 0) { // handle target/default namespace if (namespaceResolver != null) { return namespaceResolver.resolveNamespacePrefix(Constants.EMPTY_STRING); } return null; } else { if (namespaceResolver == null) { //throw an exception if the name has a : in it but the namespaceresolver is null throw XMLMarshalException.namespaceResolverNotSpecified(localName); } String prefix = localName.substring(0, colonIndex); String uri = namespaceResolver.resolveNamespacePrefix(prefix); if (uri == null) { //throw an exception if the prefix is not found in the namespaceresolver throw XMLMarshalException.namespaceNotFound(prefix); } return uri; } }
/** * INTERNAL: * Return the namespace uri for the prefix of the given local name */ private String resolveNamespace(NamespaceResolver namespaceResolver, String localName) { if(localName == null) { return null; } int colonIndex = localName.indexOf(XMLConstants.COLON); if (colonIndex < 0) { // handle target/default namespace if (namespaceResolver != null) { return namespaceResolver.getDefaultNamespaceURI(); } return null; } else { if (namespaceResolver == null) { //throw an exception if the name has a : in it but the namespaceresolver is null throw XMLMarshalException.namespaceResolverNotSpecified(localName); } String prefix = localName.substring(0, colonIndex); String uri = namespaceResolver.resolveNamespacePrefix(prefix); if (uri == null) { //throw an exception if the prefix is not found in the namespaceresolver throw XMLMarshalException.namespaceNotFound(prefix); } return uri; } }
/** * INTERNAL: * Return the namespace uri for the prefix of the given local name */ private String resolveNamespace(NamespaceResolver namespaceResolver, String localName) { if(localName == null) { return null; } int colonIndex = localName.indexOf(XMLConstants.COLON); if (colonIndex < 0) { // handle target/default namespace if (namespaceResolver != null) { return namespaceResolver.getDefaultNamespaceURI(); } return null; } else { if (namespaceResolver == null) { //throw an exception if the name has a : in it but the namespaceresolver is null throw XMLMarshalException.namespaceResolverNotSpecified(localName); } String prefix = localName.substring(0, colonIndex); String uri = namespaceResolver.resolveNamespacePrefix(prefix); if (uri == null) { //throw an exception if the prefix is not found in the namespaceresolver throw XMLMarshalException.namespaceNotFound(prefix); } return uri; } }
NamespaceResolver namespaceResolver = getNamespaceResolver(); if(namespaceResolver == null){ throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
NamespaceResolver namespaceResolver = getNamespaceResolver(); if(namespaceResolver == null){ throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
if (!isXMLRoot && descriptor.getNamespaceResolver() == null && rootFragment.hasNamespace()) { throw XMLMarshalException.namespaceResolverNotSpecified(rootFragment.getShortName());
if (!isXMLRoot && descriptor != null && descriptor.getNamespaceResolver() == null && rootFragment.hasNamespace()) { throw XMLMarshalException.namespaceResolverNotSpecified(rootFragment.getShortName());
if (!isXMLRoot && descriptor != null && descriptor.getNamespaceResolver() == null && rootFragment.hasNamespace()) { throw XMLMarshalException.namespaceResolverNotSpecified(rootFragment.getShortName());