本文整理汇总了Java中com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException.getIdentifier方法的典型用法代码示例。如果您正苦于以下问题:Java XMLConfigurationException.getIdentifier方法的具体用法?Java XMLConfigurationException.getIdentifier怎么用?Java XMLConfigurationException.getIdentifier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException
的用法示例。
在下文中一共展示了XMLConfigurationException.getIdentifier方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setProperty0
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public void setProperty0(String propertyId, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException {
try {
fConfiguration.setProperty(propertyId, value);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"property-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"property-not-supported", new Object [] {identifier}));
}
}
}
示例2: getFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public boolean getFeature(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException();
}
try {
return fComponentManager.getFeature(name);
}
catch (XMLConfigurationException e) {
final String identifier = e.getIdentifier();
final String key = e.getType() == Status.NOT_RECOGNIZED ?
"feature-not-recognized" : "feature-not-supported";
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
key, new Object [] {identifier}));
}
}
示例3: getProperty
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException();
}
try {
return fComponentManager.getProperty(name);
}
catch (XMLConfigurationException e) {
final String identifier = e.getIdentifier();
final String key = e.getType() == Status.NOT_RECOGNIZED ?
"property-not-recognized" : "property-not-supported";
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
key, new Object [] {identifier}));
}
}
示例4: getProperty
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
@Override
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException();
}
//Support current-element-node; return current node if DOMSource is used.
if (CURRENT_ELEMENT_NODE.equals(name)) {
return (fDOMValidatorHelper != null) ? fDOMValidatorHelper.getCurrentElement() : null;
}
try {
return fComponentManager.getProperty(name);
}
catch (XMLConfigurationException e) {
final String identifier = e.getIdentifier();
final String key = e.getType() == Status.NOT_RECOGNIZED ?
"property-not-recognized" : "property-not-supported";
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
key, new Object [] {identifier}));
}
}
示例5: getFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public boolean getFeature(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"FeatureNameNull", null));
}
if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
return (fSecurityManager != null && fSecurityManager.isSecureProcessing());
}
try {
return fXMLSchemaLoader.getFeature(name);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}
示例6: setProperty
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public void setProperty(String name, Object object)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException();
}
try {
fComponentManager.setProperty(name, object);
}
catch (XMLConfigurationException e) {
final String identifier = e.getIdentifier();
final String key = e.getType() == Status.NOT_RECOGNIZED ?
"property-not-recognized" : "property-not-supported";
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
key, new Object [] {identifier}));
}
}
示例7: setSchemaValidatorFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
private void setSchemaValidatorFeature(String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException {
try {
fSAXParser.fSchemaValidator.setFeature(name, value);
}
// This should never be thrown from the schema validator.
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}
示例8: setFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
/**
* Set the state of any feature in a SAX2 parser. The parser
* might not recognize the feature, and if it does recognize
* it, it might not be able to fulfill the request.
*
* @param featureId The unique identifier (URI) of the feature.
* @param state The requested state of the feature (true or false).
*
* @exception SAXNotRecognizedException If the
* requested feature is not known.
* @exception SAXNotSupportedException If the
* requested feature is known, but the requested
* state is not supported.
*/
public void setFeature(String featureId, boolean state)
throws SAXNotRecognizedException, SAXNotSupportedException {
try {
// http://xml.org/sax/features/use-entity-resolver2
// controls whether the methods of an object implementing
// org.xml.sax.ext.EntityResolver2 will be used by the parser.
//
if (featureId.equals(USE_ENTITY_RESOLVER2)) {
if (state != fUseEntityResolver2) {
fUseEntityResolver2 = state;
// Refresh EntityResolver wrapper.
setEntityResolver(getEntityResolver());
}
return;
}
//
// Default handling
//
fConfiguration.setFeature(featureId, state);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}
示例9: getFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
/**
* Query the state of a feature.
*
* Query the current state of any feature in a SAX2 parser. The
* parser might not recognize the feature.
*
* @param featureId The unique identifier (URI) of the feature
* being set.
* @return The current state of the feature.
* @exception org.xml.sax.SAXNotRecognizedException If the
* requested feature is not known.
* @exception SAXNotSupportedException If the
* requested feature is known but not supported.
*/
public boolean getFeature(String featureId)
throws SAXNotRecognizedException, SAXNotSupportedException {
try {
// http://xml.org/sax/features/use-entity-resolver2
// controls whether the methods of an object implementing
// org.xml.sax.ext.EntityResolver2 will be used by the parser.
//
if (featureId.equals(USE_ENTITY_RESOLVER2)) {
return fUseEntityResolver2;
}
//
// Default handling
//
return fConfiguration.getFeature(featureId);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fConfiguration.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}
示例10: getProperty
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public Object getProperty(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"ProperyNameNull", null));
}
if (name.equals(SECURITY_MANAGER)) {
return fSecurityManager;
}
else if (name.equals(XMLGRAMMAR_POOL)) {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"property-not-supported", new Object [] {name}));
}
try {
return fXMLSchemaLoader.getProperty(name);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"property-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"property-not-supported", new Object [] {identifier}));
}
}
}
示例11: setFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
@Override
public void setFeature(String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException();
}
try {
fComponentManager.setFeature(name, value);
}
catch (XMLConfigurationException e) {
final String identifier = e.getIdentifier();
final String key;
if (e.getType() == Status.NOT_ALLOWED) {
//for now, the identifier can only be (XMLConstants.FEATURE_SECURE_PROCESSING)
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
"jaxp-secureprocessing-feature", null));
} else if (e.getType() == Status.NOT_RECOGNIZED) {
key = "feature-not-recognized";
} else {
key = "feature-not-supported";
}
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fComponentManager.getLocale(),
key, new Object [] {identifier}));
}
fConfigurationChanged = true;
}
示例12: getFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public boolean getFeature(String name)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"FeatureNameNull", null));
}
if (name.startsWith(JAXP_SOURCE_FEATURE_PREFIX)) {
// Indicates to the caller that this SchemaFactory supports a specific JAXP Source.
if (name.equals(StreamSource.FEATURE) ||
name.equals(SAXSource.FEATURE) ||
name.equals(DOMSource.FEATURE) ||
name.equals(StAXSource.FEATURE)) {
return true;
}
}
if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
return (fSecurityManager != null && fSecurityManager.isSecureProcessing());
}
else if (name.equals(USE_GRAMMAR_POOL_ONLY)) {
return fUseGrammarPoolOnly;
}
try {
return fXMLSchemaLoader.getFeature(name);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}
示例13: setFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public void setFeature(String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"FeatureNameNull", null));
}
if (name.startsWith(JAXP_SOURCE_FEATURE_PREFIX)) {
if (name.equals(StreamSource.FEATURE) ||
name.equals(SAXSource.FEATURE) ||
name.equals(DOMSource.FEATURE) ||
name.equals(StAXSource.FEATURE)) {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-read-only", new Object [] {name}));
}
}
if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
if (System.getSecurityManager() != null && (!value)) {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(null,
"jaxp-secureprocessing-feature", null));
}
fSecurityManager.setSecureProcessing(value);
if (value) {
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
return;
}
else if (name.equals(USE_GRAMMAR_POOL_ONLY)) {
fUseGrammarPoolOnly = value;
return;
}
else if (name.equals(Constants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
//in secure mode, let _useServicesMechanism be determined by the constructor
if (System.getSecurityManager() != null)
return;
}
try {
fXMLSchemaLoader.setFeature(name, value);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}
示例14: setFeature
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; //导入方法依赖的package包/类
public void setFeature(String name, boolean value)
throws SAXNotRecognizedException, SAXNotSupportedException {
if (name == null) {
throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"FeatureNameNull", null));
}
if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
if (System.getSecurityManager() != null && (!value)) {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(null,
"jaxp-secureprocessing-feature", null));
}
fSecurityManager.setSecureProcessing(value);
if (value) {
if (Constants.IS_JDK8_OR_ABOVE) {
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_DTD,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
fSecurityPropertyMgr.setValue(XMLSecurityPropertyManager.Property.ACCESS_EXTERNAL_SCHEMA,
XMLSecurityPropertyManager.State.FSP, Constants.EXTERNAL_ACCESS_DEFAULT_FSP);
}
}
fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager);
return;
} else if (name.equals(Constants.ORACLE_FEATURE_SERVICE_MECHANISM)) {
//in secure mode, let _useServicesMechanism be determined by the constructor
if (System.getSecurityManager() != null)
return;
}
try {
fXMLSchemaLoader.setFeature(name, value);
}
catch (XMLConfigurationException e) {
String identifier = e.getIdentifier();
if (e.getType() == Status.NOT_RECOGNIZED) {
throw new SAXNotRecognizedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-recognized", new Object [] {identifier}));
}
else {
throw new SAXNotSupportedException(
SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(),
"feature-not-supported", new Object [] {identifier}));
}
}
}