com.sun.org.apache.xalan.internal.XalanConstants Java Examples
The following examples show how to use
com.sun.org.apache.xalan.internal.XalanConstants.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TransformerImpl.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected TransformerImpl(Translet translet, Properties outputProperties, int indentNumber, TransformerFactoryImpl tfactory) { _translet = (AbstractTranslet) translet; _properties = createOutputProperties(outputProperties); _propertiesClone = (Properties) _properties.clone(); _indentNumber = indentNumber; _tfactory = tfactory; _useServicesMechanism = _tfactory.useServicesMechnism(); _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET); _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD); _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER); _readerManager = XMLReaderManager.getInstance(_useServicesMechanism); _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager); //_isIncremental = tfactory._incremental; }
Example #2
Source File: Parser.java From JDKSourceCode1.8 with MIT License | 6 votes |
/** * Parses a stylesheet and builds the internal abstract syntax tree * @param input A SAX2 InputSource can be passed to a SAX reader * @return The root of the abstract syntax tree */ public SyntaxTreeNode parse(InputSource input) { final XMLReader reader = JdkXmlUtils.getXMLReader(_overrideDefaultParser, _xsltc.isSecureProcessing()); JdkXmlUtils.setXMLReaderPropertyIfSupport(reader, XMLConstants.ACCESS_EXTERNAL_DTD, _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD), true); String lastProperty = ""; try { XMLSecurityManager securityManager = (XMLSecurityManager) _xsltc.getProperty(XalanConstants.SECURITY_MANAGER); for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { lastProperty = limit.apiProperty(); reader.setProperty(lastProperty, securityManager.getLimitValueAsString(limit)); } if (securityManager.printEntityCountInfo()) { lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO; reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); } } catch (SAXException se) { XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se); } return (parse(reader, input)); }
Example #3
Source File: XSLTC.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Return allowed protocols for accessing external stylesheet. * @param name the name of the property * @return the value of the property */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { return _accessExternalStylesheet; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) { return _extensionClassLoader; } else if (JdkXmlFeatures.CATALOG_FEATURES.equals(name)) { return _catalogFeatures; } else if (JdkXmlUtils.CDATA_CHUNK_SIZE.equals(name)) { return _cdataChunkSize; } return null; }
Example #4
Source File: TransformerImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
protected TransformerImpl(Translet translet, Properties outputProperties, int indentNumber, TransformerFactoryImpl tfactory) { _translet = (AbstractTranslet) translet; _properties = createOutputProperties(outputProperties); _propertiesClone = (Properties) _properties.clone(); _indentNumber = indentNumber; _tfactory = tfactory; _useServicesMechanism = _tfactory.useServicesMechnism(); _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET); _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD); _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER); _readerManager = XMLReaderManager.getInstance(_useServicesMechanism); _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager); //_isIncremental = tfactory._incremental; }
Example #5
Source File: Parser.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * Parses a stylesheet and builds the internal abstract syntax tree * @param input A SAX2 InputSource can be passed to a SAX reader * @return The root of the abstract syntax tree */ public SyntaxTreeNode parse(InputSource input) { final XMLReader reader = JdkXmlUtils.getXMLReader(_overrideDefaultParser, _xsltc.isSecureProcessing()); JdkXmlUtils.setXMLReaderPropertyIfSupport(reader, XMLConstants.ACCESS_EXTERNAL_DTD, _xsltc.getProperty(XMLConstants.ACCESS_EXTERNAL_DTD), true); String lastProperty = ""; try { XMLSecurityManager securityManager = (XMLSecurityManager) _xsltc.getProperty(XalanConstants.SECURITY_MANAGER); for (XMLSecurityManager.Limit limit : XMLSecurityManager.Limit.values()) { lastProperty = limit.apiProperty(); reader.setProperty(lastProperty, securityManager.getLimitValueAsString(limit)); } if (securityManager.printEntityCountInfo()) { lastProperty = XalanConstants.JDK_ENTITY_COUNT_INFO; reader.setProperty(XalanConstants.JDK_ENTITY_COUNT_INFO, XalanConstants.JDK_YES); } } catch (SAXException se) { XMLSecurityManager.printWarning(reader.getClass().getName(), lastProperty, se); } return (parse(reader, input)); }
Example #6
Source File: XSLTC.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
/** * Set allowed protocols for accessing external stylesheet. */ public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { _accessExternalStylesheet = (String)value; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { _xmlSecurityManager = (XMLSecurityManager)value; } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) { _extensionClassLoader = (ClassLoader) value; /* Clear the external extension functions HashMap if extension class loader was changed */ _externalExtensionFunctions.clear(); } }
Example #7
Source File: XSLTC.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * Set allowed protocols for accessing external stylesheet. * @param name the name of the property * @param value the value of the property */ public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { _accessExternalStylesheet = (String)value; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { _xmlSecurityManager = (XMLSecurityManager)value; } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) { _extensionClassLoader = (ClassLoader) value; /* Clear the external extension functions HashMap if extension class loader was changed */ _externalExtensionFunctions.clear(); } else if (JdkXmlFeatures.CATALOG_FEATURES.equals(name)) { _catalogFeatures = (CatalogFeatures)value; } else if (JdkXmlUtils.CDATA_CHUNK_SIZE.equals(name)) { _cdataChunkSize = Integer.parseInt((String)value); } }
Example #8
Source File: TransformerImpl.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
protected TransformerImpl(Translet translet, Properties outputProperties, int indentNumber, TransformerFactoryImpl tfactory) { _translet = (AbstractTranslet) translet; _properties = createOutputProperties(outputProperties); _propertiesClone = (Properties) _properties.clone(); _indentNumber = indentNumber; _tfactory = tfactory; _useServicesMechanism = _tfactory.useServicesMechnism(); _accessExternalStylesheet = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET); _accessExternalDTD = (String)_tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD); _securityManager = (XMLSecurityManager)_tfactory.getAttribute(XalanConstants.SECURITY_MANAGER); _readerManager = XMLReaderManager.getInstance(_useServicesMechanism); _readerManager.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, _accessExternalDTD); _readerManager.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, _isSecureProcessing); _readerManager.setProperty(XalanConstants.SECURITY_MANAGER, _securityManager); //_isIncremental = tfactory._incremental; }
Example #9
Source File: TransformerFactoryImpl.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
private TransformerFactoryImpl(boolean useServicesMechanism) { this._useServicesMechanism = useServicesMechanism; _featureManager = new FeatureManager(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); } _xmlSecurityPropertyMgr = new XMLSecurityPropertyManager(); _accessExternalDTD = _xmlSecurityPropertyMgr.getValue( Property.ACCESS_EXTERNAL_DTD); _accessExternalStylesheet = _xmlSecurityPropertyMgr.getValue( Property.ACCESS_EXTERNAL_STYLESHEET); //Parser's security manager _xmlSecurityManager = new XMLSecurityManager(true); }
Example #10
Source File: XMLReaderManager.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Set property. */ public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { _xmlSecurityManager = (XMLSecurityManager)value; } }
Example #11
Source File: XMLSecurityPropertyManager.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Read from system properties, or those in jaxp.properties */ private void readSystemProperties() { getSystemProperty(Property.ACCESS_EXTERNAL_DTD, XalanConstants.SP_ACCESS_EXTERNAL_DTD); getSystemProperty(Property.ACCESS_EXTERNAL_STYLESHEET, XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET); }
Example #12
Source File: XMLSecurityPropertyManager.java From jdk1.8-source-analysis with Apache License 2.0 | 5 votes |
/** * Read from system properties, or those in jaxp.properties */ private void readSystemProperties() { getSystemProperty(Property.ACCESS_EXTERNAL_DTD, XalanConstants.SP_ACCESS_EXTERNAL_DTD); getSystemProperty(Property.ACCESS_EXTERNAL_STYLESHEET, XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET); }
Example #13
Source File: XMLReaderManager.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Get property value */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } return null; }
Example #14
Source File: XMLReaderManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Get property value */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } return null; }
Example #15
Source File: XMLReaderManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Set property. */ public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { _xmlSecurityManager = (XMLSecurityManager)value; } }
Example #16
Source File: TemplatesHandlerImpl.java From Bytecoder with Apache License 2.0 | 5 votes |
/** * Default constructor */ protected TemplatesHandlerImpl(int indentNumber, TransformerFactoryImpl tfactory, boolean hasUserErrListener) { _indentNumber = indentNumber; _tfactory = tfactory; // Instantiate XSLTC and get reference to parser object XSLTC xsltc = new XSLTC(tfactory.getJdkXmlFeatures(), hasUserErrListener); if (tfactory.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING)) xsltc.setSecureProcessing(true); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)); xsltc.setProperty(XMLConstants.ACCESS_EXTERNAL_DTD, (String)tfactory.getAttribute(XMLConstants.ACCESS_EXTERNAL_DTD)); xsltc.setProperty(XalanConstants.SECURITY_MANAGER, tfactory.getAttribute(XalanConstants.SECURITY_MANAGER)); if ("true".equals(tfactory.getAttribute(TransformerFactoryImpl.ENABLE_INLINING))) xsltc.setTemplateInlining(true); else xsltc.setTemplateInlining(false); _useCatalog = tfactory.getFeature(XMLConstants.USE_CATALOG); _catalogFeatures = (CatalogFeatures)tfactory.getAttribute(JdkXmlFeatures.CATALOG_FEATURES); xsltc.setProperty(JdkXmlFeatures.CATALOG_FEATURES, _catalogFeatures); _parser = xsltc.getParser(); }
Example #17
Source File: XMLSecurityManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Set the value of a property by its index * * @param index the index of the property * @param state the state of the property * @param value the value of the property */ public void setLimit(int index, State state, int value) { if (index == indexEntityCountInfo) { //if it's explicitly set, it's treated as yes no matter the value printEntityCountInfo = XalanConstants.JDK_YES; } else { //only update if it shall override if (state.compareTo(states[index]) >= 0) { values[index] = value; states[index] = state; isSet[index] = true; } } }
Example #18
Source File: XMLSecurityManager.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Get the index by property name * * @param propertyName property name * @return the index of the property if found; return -1 if not */ public int getIndex(String propertyName) { for (Limit limit : Limit.values()) { if (limit.equalsAPIPropertyName(propertyName)) { //internally, ordinal is used as index return limit.ordinal(); } } //special property to return entity count info if (propertyName.equals(XalanConstants.JDK_ENTITY_COUNT_INFO)) { return indexEntityCountInfo; } return -1; }
Example #19
Source File: FeaturePropertyBase.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Set value by property name and state * @param propertyName property name * @param state the state of the property * @param value the value of the property * @return true if the property is managed by the security property manager; * false if otherwise. */ public boolean setValue(String propertyName, State state, boolean value) { int index = getIndex(propertyName); if (index > -1) { if (value) { setValue(index, state, XalanConstants.FEATURE_TRUE); } else { setValue(index, state, XalanConstants.FEATURE_FALSE); } return true; } return false; }
Example #20
Source File: XSLTC.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Return allowed protocols for accessing external stylesheet. */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { return _accessExternalStylesheet; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) { return _extensionClassLoader; } return null; }
Example #21
Source File: XMLSecurityPropertyManager.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Read from system properties, or those in jaxp.properties */ private void readSystemProperties() { getSystemProperty(Property.ACCESS_EXTERNAL_DTD, XalanConstants.SP_ACCESS_EXTERNAL_DTD); getSystemProperty(Property.ACCESS_EXTERNAL_STYLESHEET, XalanConstants.SP_ACCESS_EXTERNAL_STYLESHEET); }
Example #22
Source File: XSLTC.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Return allowed protocols for accessing external stylesheet. */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { return _accessExternalStylesheet; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } else if (name.equals(XalanConstants.JDK_EXTENSION_CLASSLOADER)) { return _extensionClassLoader; } return null; }
Example #23
Source File: FeaturePropertyBase.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Set value by property name and state * @param propertyName property name * @param state the state of the property * @param value the value of the property * @return true if the property is managed by the security property manager; * false if otherwise. */ public boolean setValue(String propertyName, State state, boolean value) { int index = getIndex(propertyName); if (index > -1) { if (value) { setValue(index, state, XalanConstants.FEATURE_TRUE); } else { setValue(index, state, XalanConstants.FEATURE_FALSE); } return true; } return false; }
Example #24
Source File: XMLSecurityManager.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Get the index by property name * * @param propertyName property name * @return the index of the property if found; return -1 if not */ public int getIndex(String propertyName) { for (Limit limit : Limit.values()) { if (limit.equalsAPIPropertyName(propertyName)) { //internally, ordinal is used as index return limit.ordinal(); } } //special property to return entity count info if (propertyName.equals(XalanConstants.JDK_ENTITY_COUNT_INFO)) { return indexEntityCountInfo; } return -1; }
Example #25
Source File: XMLSecurityManager.java From JDKSourceCode1.8 with MIT License | 5 votes |
/** * Set the value of a property by its index * * @param index the index of the property * @param state the state of the property * @param value the value of the property */ public void setLimit(int index, State state, int value) { if (index == indexEntityCountInfo) { //if it's explicitly set, it's treated as yes no matter the value printEntityCountInfo = XalanConstants.JDK_YES; } else { //only update if it shall override if (state.compareTo(states[index]) >= 0) { values[index] = value; states[index] = state; isSet[index] = true; } } }
Example #26
Source File: XMLReaderManager.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Get property value */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } return null; }
Example #27
Source File: XSLTC.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Return allowed protocols for accessing external stylesheet. */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_STYLESHEET)) { return _accessExternalStylesheet; } else if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } return null; }
Example #28
Source File: XPathFactoryImpl.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public XPathFactoryImpl(boolean useServicesMechanism) { _featureManager = new FeatureManager(); if (System.getSecurityManager() != null) { _isSecureMode = true; _isNotSecureProcessing = false; _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION, FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE); } this._useServicesMechanism = useServicesMechanism; }
Example #29
Source File: XMLReaderManager.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Set property. */ public void setProperty(String name, Object value) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { _accessExternalDTD = (String)value; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { _xmlSecurityManager = (XMLSecurityManager)value; } }
Example #30
Source File: XMLReaderManager.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Get property value */ public Object getProperty(String name) { if (name.equals(XMLConstants.ACCESS_EXTERNAL_DTD)) { return _accessExternalDTD; } else if (name.equals(XalanConstants.SECURITY_MANAGER)) { return _xmlSecurityManager; } return null; }