本文整理了Java中org.eclipse.persistence.exceptions.XMLMarshalException.namespaceResolverNotSpecified()
方法的一些代码示例,展示了XMLMarshalException.namespaceResolverNotSpecified()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMLMarshalException.namespaceResolverNotSpecified()
方法的具体详情如下:
包路径:org.eclipse.persistence.exceptions.XMLMarshalException
类名称:XMLMarshalException
方法名:namespaceResolverNotSpecified
暂无
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
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();
}
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
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();
}
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
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();
}
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
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();
}
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* 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;
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* 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;
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* 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;
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
/**
* 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;
}
}
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
/**
* 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;
}
}
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
/**
* 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;
}
}
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
NamespaceResolver namespaceResolver = getNamespaceResolver();
if(namespaceResolver == null){
throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
NamespaceResolver namespaceResolver = getNamespaceResolver();
if(namespaceResolver == null){
throw XMLMarshalException.namespaceResolverNotSpecified(namespaceURI);
代码示例来源:origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence
if (!isXMLRoot && descriptor.getNamespaceResolver() == null && rootFragment.hasNamespace()) {
throw XMLMarshalException.namespaceResolverNotSpecified(rootFragment.getShortName());
代码示例来源:origin: org.eclipse.persistence/org.eclipse.persistence.core
if (!isXMLRoot && descriptor != null && descriptor.getNamespaceResolver() == null && rootFragment.hasNamespace()) {
throw XMLMarshalException.namespaceResolverNotSpecified(rootFragment.getShortName());
代码示例来源:origin: com.haulmont.thirdparty/eclipselink
if (!isXMLRoot && descriptor != null && descriptor.getNamespaceResolver() == null && rootFragment.hasNamespace()) {
throw XMLMarshalException.namespaceResolverNotSpecified(rootFragment.getShortName());
内容来源于网络,如有侵权,请联系作者删除!