Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
JRE 8 rt.jar - com.* Package Source Code
JRE 8 rt.jar is the JAR file for JRE 8 RT (Runtime) libraries. JRE (Java Runtime) 8 is the runtime environment included in JDK 8. JRE 8 rt.jar libraries are divided into 6 packages:
com.* - Internal Oracle and Sun Microsystems libraries java.* - Standard Java API libraries. javax.* - Extended Java API libraries. jdk.* - JDK supporting libraries. org.* - Third party libraries. sun.* - Old libraries developed by Sun Microsystems.
JAR File Information:
Directory of C:\fyicenter\jdk-1.8.0_191\jre\lib 63,596,151 rt.jar
Here is the list of Java classes of the com.* package in JRE 1.8.0_191 rt.jar. Java source codes are also provided.
✍: FYIcenter
⏎ com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
/* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */ /* * Copyright 2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.sun.org.apache.xerces.internal.jaxp.validation; import java.io.IOException; import java.io.InputStream; import java.io.Reader; import javax.xml.XMLConstants; import javax.xml.stream.XMLEventReader; import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stax.StAXSource; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; import jdk.xml.internal.JdkXmlFeatures; import jdk.xml.internal.JdkXmlUtils; import com.sun.org.apache.xerces.internal.impl.Constants; import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader; import com.sun.org.apache.xerces.internal.util.DOMEntityResolverWrapper; import com.sun.org.apache.xerces.internal.util.DOMInputSource; import com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper; import com.sun.org.apache.xerces.internal.util.SAXInputSource; import com.sun.org.apache.xerces.internal.util.SAXMessageFormatter; import com.sun.org.apache.xerces.internal.util.StAXInputSource; import com.sun.org.apache.xerces.internal.util.Status; import com.sun.org.apache.xerces.internal.util.XMLGrammarPoolImpl; import com.sun.org.apache.xerces.internal.utils.XMLSecurityManager; import com.sun.org.apache.xerces.internal.utils.XMLSecurityPropertyManager; import com.sun.org.apache.xerces.internal.xni.XNIException; import com.sun.org.apache.xerces.internal.xni.grammars.Grammar; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarDescription; import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; import org.w3c.dom.Node; import org.w3c.dom.ls.LSResourceResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXParseException; /** * {@link SchemaFactory} for XML Schema. * * @author Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com) * @version $Id: XMLSchemaFactory.java,v 1.11 2010-11-01 04:40:08 joehw Exp $ */ public final class XMLSchemaFactory extends SchemaFactory { // property identifiers /** Feature identifier: schema full checking. */ private static final String SCHEMA_FULL_CHECKING = Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_FULL_CHECKING; /** Property identifier: grammar pool. */ private static final String XMLGRAMMAR_POOL = Constants.XERCES_PROPERTY_PREFIX + Constants.XMLGRAMMAR_POOL_PROPERTY; /** Property identifier: XMLSecurityManager. */ private static final String SECURITY_MANAGER = Constants.XERCES_PROPERTY_PREFIX + Constants.SECURITY_MANAGER_PROPERTY; /** Property identifier: Security property manager. */ private static final String XML_SECURITY_PROPERTY_MANAGER = Constants.XML_SECURITY_PROPERTY_MANAGER; // // Data // /** The XMLSchemaLoader */ private final XMLSchemaLoader fXMLSchemaLoader = new XMLSchemaLoader(); /** User-specified ErrorHandler; can be null. */ private ErrorHandler fErrorHandler; /** The LSResrouceResolver */ private LSResourceResolver fLSResourceResolver; /** The DOMEntityResolverWrapper */ private final DOMEntityResolverWrapper fDOMEntityResolverWrapper; /** The ErrorHandlerWrapper */ private ErrorHandlerWrapper fErrorHandlerWrapper; /** The SecurityManager. */ private XMLSecurityManager fSecurityManager; /** The Security property manager. */ private XMLSecurityPropertyManager fSecurityPropertyMgr; /** The container for the real grammar pool. */ private XMLGrammarPoolWrapper fXMLGrammarPoolWrapper; private final JdkXmlFeatures fXmlFeatures; /** * Indicates whether 3rd party parser may be used to override the system-default * Note the default value (false) is the safe option. * Note same as the old property useServicesMechanism */ private final boolean fOverrideDefaultParser; public XMLSchemaFactory() { fErrorHandlerWrapper = new ErrorHandlerWrapper(DraconianErrorHandler.getInstance()); fDOMEntityResolverWrapper = new DOMEntityResolverWrapper(); fXMLGrammarPoolWrapper = new XMLGrammarPoolWrapper(); fXMLSchemaLoader.setFeature(SCHEMA_FULL_CHECKING, true); fXMLSchemaLoader.setProperty(XMLGRAMMAR_POOL, fXMLGrammarPoolWrapper); fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper); fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper); // Enable secure processing feature by default fSecurityManager = new XMLSecurityManager(true); fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); fSecurityPropertyMgr = new XMLSecurityPropertyManager(); fXMLSchemaLoader.setProperty(XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); fXmlFeatures = new JdkXmlFeatures(fSecurityManager.isSecureProcessing()); fOverrideDefaultParser = fXmlFeatures.getFeature( JdkXmlFeatures.XmlFeature.JDK_OVERRIDE_PARSER); fXMLSchemaLoader.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser); } /** * <p>Is specified schema supported by this <code>SchemaFactory</code>?</p> * * @param schemaLanguage Specifies the schema language which the returned <code>SchemaFactory</code> will understand. * <code>schemaLanguage</code> must specify a <a href="#schemaLanguage">valid</a> schema language. * * @return <code>true</code> if <code>SchemaFactory</code> supports <code>schemaLanguage</code>, else <code>false</code>. * * @throws NullPointerException If <code>schemaLanguage</code> is <code>null</code>. * @throws IllegalArgumentException If <code>schemaLanguage.length() == 0</code> * or <code>schemaLanguage</code> does not specify a <a href="#schemaLanguage">valid</a> schema language. */ public boolean isSchemaLanguageSupported(String schemaLanguage) { if (schemaLanguage == null) { throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "SchemaLanguageNull", null)); } if (schemaLanguage.length() == 0) { throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "SchemaLanguageLengthZero", null)); } // only W3C XML Schema 1.0 is supported return schemaLanguage.equals(XMLConstants.W3C_XML_SCHEMA_NS_URI); } public LSResourceResolver getResourceResolver() { return fLSResourceResolver; } public void setResourceResolver(LSResourceResolver resourceResolver) { fLSResourceResolver = resourceResolver; fDOMEntityResolverWrapper.setEntityResolver(resourceResolver); fXMLSchemaLoader.setEntityResolver(fDOMEntityResolverWrapper); } public ErrorHandler getErrorHandler() { return fErrorHandler; } public void setErrorHandler(ErrorHandler errorHandler) { fErrorHandler = errorHandler; fErrorHandlerWrapper.setErrorHandler(errorHandler != null ? errorHandler : DraconianErrorHandler.getInstance()); fXMLSchemaLoader.setErrorHandler(fErrorHandlerWrapper); } public Schema newSchema( Source[] schemas ) throws SAXException { // this will let the loader store parsed Grammars into the pool. XMLGrammarPoolImplExtension pool = new XMLGrammarPoolImplExtension(); fXMLGrammarPoolWrapper.setGrammarPool(pool); XMLInputSource[] xmlInputSources = new XMLInputSource[schemas.length]; InputStream inputStream; Reader reader; for( int i=0; i<schemas.length; i++ ) { Source source = schemas[i]; if (source instanceof StreamSource) { StreamSource streamSource = (StreamSource) source; String publicId = streamSource.getPublicId(); String systemId = streamSource.getSystemId(); inputStream = streamSource.getInputStream(); reader = streamSource.getReader(); xmlInputSources[i] = new XMLInputSource(publicId, systemId, null); xmlInputSources[i].setByteStream(inputStream); xmlInputSources[i].setCharacterStream(reader); } else if (source instanceof SAXSource) { SAXSource saxSource = (SAXSource) source; InputSource inputSource = saxSource.getInputSource(); if (inputSource == null) { throw new SAXException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "SAXSourceNullInputSource", null)); } xmlInputSources[i] = new SAXInputSource(saxSource.getXMLReader(), inputSource); } else if (source instanceof DOMSource) { DOMSource domSource = (DOMSource) source; Node node = domSource.getNode(); String systemID = domSource.getSystemId(); xmlInputSources[i] = new DOMInputSource(node, systemID); } else if (source instanceof StAXSource) { StAXSource staxSource = (StAXSource) source; XMLEventReader eventReader = staxSource.getXMLEventReader(); if (eventReader != null) { xmlInputSources[i] = new StAXInputSource(eventReader); } else { xmlInputSources[i] = new StAXInputSource(staxSource.getXMLStreamReader()); } } else if (source == null) { throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "SchemaSourceArrayMemberNull", null)); } else { throw new IllegalArgumentException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "SchemaFactorySourceUnrecognized", new Object [] {source.getClass().getName()})); } } try { fXMLSchemaLoader.loadGrammar(xmlInputSources); } catch (XNIException e) { // this should have been reported to users already. throw Util.toSAXException(e); } catch (IOException e) { // this hasn't been reported, so do so now. SAXParseException se = new SAXParseException(e.getMessage(),null,e); fErrorHandler.error(se); throw se; // and we must throw it. } // Clear reference to grammar pool. fXMLGrammarPoolWrapper.setGrammarPool(null); // Select Schema implementation based on grammar count. final int grammarCount = pool.getGrammarCount(); AbstractXMLSchema schema = null; if (grammarCount > 1) { schema = new XMLSchema(new ReadOnlyGrammarPool(pool)); } else if (grammarCount == 1) { Grammar[] grammars = pool.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA); schema = new SimpleXMLSchema(grammars[0]); } else { schema = new EmptyXMLSchema(); } propagateFeatures(schema); propagateProperties(schema); return schema; } public Schema newSchema() throws SAXException { // Use a Schema that uses the system id as the equality source. AbstractXMLSchema schema = new WeakReferenceXMLSchema(); propagateFeatures(schema); propagateProperties(schema); return schema; } 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})); } } } 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})); } /** Check to see if the property is managed by the JdkXmlFeatues **/ int index = fXmlFeatures.getIndex(name); if (index > -1) { return fXmlFeatures.getFeature(index); } 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})); } } } 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; } if ((fXmlFeatures != null) && fXmlFeatures.setFeature(name, JdkXmlFeatures.State.APIPROPERTY, value)) { if (name.equals(JdkXmlUtils.OVERRIDE_PARSER) || name.equals(Constants.ORACLE_FEATURE_SERVICE_MECHANISM)) { fXMLSchemaLoader.setFeature(name, value); } 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})); } } } public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException { if (name == null) { throw new NullPointerException(JAXPValidationMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "ProperyNameNull", null)); } if (name.equals(SECURITY_MANAGER)) { fSecurityManager = XMLSecurityManager.convert(object, fSecurityManager); fXMLSchemaLoader.setProperty(SECURITY_MANAGER, fSecurityManager); return; } else if (name.equals(Constants.XML_SECURITY_PROPERTY_MANAGER)) { if (object == null) { fSecurityPropertyMgr = new XMLSecurityPropertyManager(); } else { fSecurityPropertyMgr = (XMLSecurityPropertyManager)object; } fXMLSchemaLoader.setProperty(Constants.XML_SECURITY_PROPERTY_MANAGER, fSecurityPropertyMgr); return; } else if (name.equals(XMLGRAMMAR_POOL)) { throw new SAXNotSupportedException( SAXMessageFormatter.formatMessage(fXMLSchemaLoader.getLocale(), "property-not-supported", new Object [] {name})); } try { //check if the property is managed by security manager if (fSecurityManager == null || !fSecurityManager.setLimit(name, XMLSecurityManager.State.APIPROPERTY, object)) { //check if the property is managed by security property manager if (fSecurityPropertyMgr == null || !fSecurityPropertyMgr.setValue(name, XMLSecurityPropertyManager.State.APIPROPERTY, object)) { //fall back to the existing property manager fXMLSchemaLoader.setProperty(name, object); } } } 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})); } } } private void propagateFeatures(AbstractXMLSchema schema) { schema.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, (fSecurityManager != null && fSecurityManager.isSecureProcessing())); schema.setFeature(JdkXmlUtils.OVERRIDE_PARSER, fOverrideDefaultParser); String[] features = fXMLSchemaLoader.getRecognizedFeatures(); for (int i = 0; i < features.length; ++i) { boolean state = fXMLSchemaLoader.getFeature(features[i]); schema.setFeature(features[i], state); } } private void propagateProperties(AbstractXMLSchema schema) { String[] properties = fXMLSchemaLoader.getRecognizedProperties(); for (int i = 0; i < properties.length; ++i) { Object state = fXMLSchemaLoader.getProperty(properties[i]); schema.setProperty(properties[i], state); } } /** * Extension of XMLGrammarPoolImpl which exposes the number of * grammars stored in the grammar pool. */ static class XMLGrammarPoolImplExtension extends XMLGrammarPoolImpl { /** Constructs a grammar pool with a default number of buckets. */ public XMLGrammarPoolImplExtension() { super(); } /** Constructs a grammar pool with a specified number of buckets. */ public XMLGrammarPoolImplExtension(int initialCapacity) { super(initialCapacity); } /** Returns the number of grammars contained in this pool. */ int getGrammarCount() { return fGrammarCount; } } // XMLSchemaFactory.XMLGrammarPoolImplExtension /** * A grammar pool which wraps another. */ static class XMLGrammarPoolWrapper implements XMLGrammarPool { private XMLGrammarPool fGrammarPool; /* * XMLGrammarPool methods */ public Grammar[] retrieveInitialGrammarSet(String grammarType) { return fGrammarPool.retrieveInitialGrammarSet(grammarType); } public void cacheGrammars(String grammarType, Grammar[] grammars) { fGrammarPool.cacheGrammars(grammarType, grammars); } public Grammar retrieveGrammar(XMLGrammarDescription desc) { return fGrammarPool.retrieveGrammar(desc); } public void lockPool() { fGrammarPool.lockPool(); } public void unlockPool() { fGrammarPool.unlockPool(); } public void clear() { fGrammarPool.clear(); } /* * Other methods */ void setGrammarPool(XMLGrammarPool grammarPool) { fGrammarPool = grammarPool; } XMLGrammarPool getGrammarPool() { return fGrammarPool; } } // XMLSchemaFactory.XMLGrammarPoolWrapper } // XMLSchemaFactory
⏎ com/sun/org/apache/xerces/internal/jaxp/validation/XMLSchemaFactory.java
Or download all of them as a single archive file:
File name: jre-rt-com-1.8.0_191-src.zip File size: 8099783 bytes Release date: 2018-10-28 Download
⇒ Backup JDK 8 Installation Directory
2023-02-07, 255209👍, 3💬
Popular Posts:
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
JDK 11 jdk.jshell.jmod is the JMOD file for JDK 11 JShell tool, which can be invoked by the "jshell"...
JDK 11 jdk.localedata.jmod is the JMOD file for JDK 11 Localedata module. JDK 11 Locale Data module ...
Java Cryptography Extension 1.2.2 JAR File Size and Download Location: File name: jce.jar, jce-1.2.2...