javax.xml.transform.stream.StreamResult#FEATURE源码实例Demo

下面列出了javax.xml.transform.stream.StreamResult#FEATURE 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
源代码3 项目: jdk8u60   文件: SmartTransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
源代码5 项目: j2objc   文件: TransformerFactoryImpl.java
/**
 * Look up the value of a feature.
 * <p>The feature name is any fully-qualified URI.  It is
 * possible for an TransformerFactory to recognize a feature name but
 * to be unable to return its value; this is especially true
 * in the case of an adapter for a SAX1 Parser, which has
 * no way of knowing whether the underlying parser is
 * validating, for example.</p>
 *
 * @param name The feature name, which is a fully-qualified URI.
 * @return The current state of the feature (true or false).
 */
public boolean getFeature(String name) {
	
  // feature name cannot be null
  if (name == null) 
  {
  	throw new NullPointerException(
          XSLMessages.createMessage(
          XSLTErrorResources.ER_GET_FEATURE_NULL_NAME, null));    
  }
 	
  // Try first with identity comparison, which 
  // will be faster.
  if ((DOMResult.FEATURE == name) || (DOMSource.FEATURE == name)
          || (SAXResult.FEATURE == name) || (SAXSource.FEATURE == name)
          || (StreamResult.FEATURE == name)
          || (StreamSource.FEATURE == name)
          || (SAXTransformerFactory.FEATURE == name)
          || (SAXTransformerFactory.FEATURE_XMLFILTER == name))
    return true;
  else if ((DOMResult.FEATURE.equals(name))
           || (DOMSource.FEATURE.equals(name))
           || (SAXResult.FEATURE.equals(name))
           || (SAXSource.FEATURE.equals(name))
           || (StreamResult.FEATURE.equals(name))
           || (StreamSource.FEATURE.equals(name))
           || (SAXTransformerFactory.FEATURE.equals(name))
           || (SAXTransformerFactory.FEATURE_XMLFILTER.equals(name)))
    return true;	      
  // secure processing?
  else if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING))
    return m_isSecureProcessing;
  else      
    // unknown feature
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
源代码8 项目: hottub   文件: SmartTransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
源代码10 项目: openjdk-8   文件: SmartTransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but it really does not matter in a function like this
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i]))
            return true;
    }

    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return featureSecureProcessing;
    }

    // unknown feature
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the security manager **/
    String propertyValue = (_featureManager != null) ?
            _featureManager.getValueAsString(name) : null;
    if (propertyValue != null) {
        return Boolean.parseBoolean(propertyValue);
    }

    // Feature not supported
    return false;
}
 
源代码12 项目: TencentKona-8   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the JdkXmlFeatures **/
    int index = _xmlFeatures.getIndex(name);
    if (index > -1) {
        return _xmlFeatures.getFeature(index);
    }

    // Feature not supported
    return false;
}
 
源代码13 项目: jdk8u60   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the security manager **/
    String propertyValue = (_featureManager != null) ?
            _featureManager.getValueAsString(name) : null;
    if (propertyValue != null) {
        return Boolean.parseBoolean(propertyValue);
    }

    // Feature not supported
    return false;
}
 
源代码14 项目: JDKSourceCode1.8   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the JdkXmlFeatures **/
    int index = _xmlFeatures.getIndex(name);
    if (index > -1) {
        return _xmlFeatures.getFeature(index);
    }

    // Feature not supported
    return false;
}
 
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i = 0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the JdkXmlFeatures **/
    int index = _xmlFeatures.getIndex(name);
    if (index > -1) {
        return _xmlFeatures.getFeature(index);
    }

    // Feature not supported
    return false;
}
 
源代码16 项目: Bytecoder   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }

    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the JdkXmlFeatues **/
    int index = _xmlFeatures.getIndex(name);
    if (index > -1) {
        return _xmlFeatures.getFeature(index);
    }

    // Feature not supported
    return false;
}
 
源代码17 项目: openjdk-jdk9   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }

    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
        return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the JdkXmlFeatues **/
    int index = _xmlFeatures.getIndex(name);
    if (index > -1) {
        return _xmlFeatures.getFeature(index);
    }

    // Feature not supported
    return false;
}
 
源代码18 项目: hottub   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the security manager **/
    String propertyValue = (_featureManager != null) ?
            _featureManager.getValueAsString(name) : null;
    if (propertyValue != null) {
        return Boolean.parseBoolean(propertyValue);
    }

    // Feature not supported
    return false;
}
 
源代码19 项目: openjdk-8-source   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the security manager **/
    String propertyValue = (_featureManager != null) ?
            _featureManager.getValueAsString(name) : null;
    if (propertyValue != null) {
        return Boolean.parseBoolean(propertyValue);
    }

    // Feature not supported
    return false;
}
 
源代码20 项目: openjdk-8   文件: TransformerFactoryImpl.java
/**
 * javax.xml.transform.sax.TransformerFactory implementation.
 * Look up the value of a feature (to see if it is supported).
 * This method must be updated as the various methods and features of this
 * class are implemented.
 *
 * @param name The feature name
 * @return 'true' if feature is supported, 'false' if not
 */
@Override
public boolean getFeature(String name) {
    // All supported features should be listed here
    String[] features = {
        DOMSource.FEATURE,
        DOMResult.FEATURE,
        SAXSource.FEATURE,
        SAXResult.FEATURE,
        StAXSource.FEATURE,
        StAXResult.FEATURE,
        StreamSource.FEATURE,
        StreamResult.FEATURE,
        SAXTransformerFactory.FEATURE,
        SAXTransformerFactory.FEATURE_XMLFILTER,
        XalanConstants.ORACLE_FEATURE_SERVICE_MECHANISM
    };

    // feature name cannot be null
    if (name == null) {
        ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME);
        throw new NullPointerException(err.toString());
    }

    // Inefficient, but array is small
    for (int i =0; i < features.length; i++) {
        if (name.equals(features[i])) {
            return true;
        }
    }
    // secure processing?
    if (name.equals(XMLConstants.FEATURE_SECURE_PROCESSING)) {
            return !_isNotSecureProcessing;
    }

    /** Check to see if the property is managed by the security manager **/
    String propertyValue = (_featureManager != null) ?
            _featureManager.getValueAsString(name) : null;
    if (propertyValue != null) {
        return Boolean.parseBoolean(propertyValue);
    }

    // Feature not supported
    return false;
}