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:
JDK 11 java.desktop.jmod - Desktop Module
JDK 11 java.desktop.jmod is the JMOD file for JDK 11 Desktop module.
JDK 11 Desktop module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\java.desktop.jmod.
JDK 11 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 Desktop module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\java.desktop.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ java/beans/XMLDecoder.java
/* * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package java.beans; import com.sun.beans.decoder.DocumentHandler; import java.io.Closeable; import java.io.InputStream; import java.io.IOException; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; import org.xml.sax.InputSource; import org.xml.sax.helpers.DefaultHandler; /** * The {@code XMLDecoder} class is used to read XML documents * created using the {@code XMLEncoder} and is used just like * the {@code ObjectInputStream}. For example, one can use * the following fragment to read the first object defined * in an XML document written by the {@code XMLEncoder} * class: * <pre> * XMLDecoder d = new XMLDecoder( * new BufferedInputStream( * new FileInputStream("Test.xml"))); * Object result = d.readObject(); * d.close(); * </pre> * *<p> * For more information you might also want to check out * <a href="http://www.oracle.com/technetwork/java/persistence3-139471.html"> * Long Term Persistence of JavaBeans Components: XML Schema</a>, * an article in <em>The Swing Connection.</em> * @see XMLEncoder * @see java.io.ObjectInputStream * * @since 1.4 * * @author Philip Milne */ public class XMLDecoder implements AutoCloseable { private final AccessControlContext acc = AccessController.getContext(); private final DocumentHandler handler = new DocumentHandler(); private final InputSource input; private Object owner; private Object[] array; private int index; /** * Creates a new input stream for reading archives * created by the {@code XMLEncoder} class. * * @param in The underlying stream. * * @see XMLEncoder#XMLEncoder(java.io.OutputStream) */ public XMLDecoder(InputStream in) { this(in, null); } /** * Creates a new input stream for reading archives * created by the {@code XMLEncoder} class. * * @param in The underlying stream. * @param owner The owner of this stream. * */ public XMLDecoder(InputStream in, Object owner) { this(in, owner, null); } /** * Creates a new input stream for reading archives * created by the {@code XMLEncoder} class. * * @param in the underlying stream. * @param owner the owner of this stream. * @param exceptionListener the exception handler for the stream; * if {@code null} the default exception listener will be used. */ public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener) { this(in, owner, exceptionListener, null); } /** * Creates a new input stream for reading archives * created by the {@code XMLEncoder} class. * * @param in the underlying stream. {@code null} may be passed without * error, though the resulting XMLDecoder will be useless * @param owner the owner of this stream. {@code null} is a legal * value * @param exceptionListener the exception handler for the stream, or * {@code null} to use the default * @param cl the class loader used for instantiating objects. * {@code null} indicates that the default class loader should * be used * @since 1.5 */ public XMLDecoder(InputStream in, Object owner, ExceptionListener exceptionListener, ClassLoader cl) { this(new InputSource(in), owner, exceptionListener, cl); } /** * Creates a new decoder to parse XML archives * created by the {@code XMLEncoder} class. * If the input source {@code is} is {@code null}, * no exception is thrown and no parsing is performed. * This behavior is similar to behavior of other constructors * that use {@code InputStream} as a parameter. * * @param is the input source to parse * * @since 1.7 */ public XMLDecoder(InputSource is) { this(is, null, null, null); } /** * Creates a new decoder to parse XML archives * created by the {@code XMLEncoder} class. * * @param is the input source to parse * @param owner the owner of this decoder * @param el the exception handler for the parser, * or {@code null} to use the default exception handler * @param cl the class loader used for instantiating objects, * or {@code null} to use the default class loader * * @since 1.7 */ private XMLDecoder(InputSource is, Object owner, ExceptionListener el, ClassLoader cl) { this.input = is; this.owner = owner; setExceptionListener(el); this.handler.setClassLoader(cl); this.handler.setOwner(this); } /** * This method closes the input stream associated * with this stream. */ public void close() { if (parsingComplete()) { close(this.input.getCharacterStream()); close(this.input.getByteStream()); } } private void close(Closeable in) { if (in != null) { try { in.close(); } catch (IOException e) { getExceptionListener().exceptionThrown(e); } } } private boolean parsingComplete() { if (this.input == null) { return false; } if (this.array == null) { if ((this.acc == null) && (null != System.getSecurityManager())) { throw new SecurityException("AccessControlContext is not set"); } AccessController.doPrivileged(new PrivilegedAction<Void>() { public Void run() { XMLDecoder.this.handler.parse(XMLDecoder.this.input); return null; } }, this.acc); this.array = this.handler.getObjects(); } return true; } /** * Sets the exception handler for this stream to {@code exceptionListener}. * The exception handler is notified when this stream catches recoverable * exceptions. * * @param exceptionListener The exception handler for this stream; * if {@code null} the default exception listener will be used. * * @see #getExceptionListener */ public void setExceptionListener(ExceptionListener exceptionListener) { if (exceptionListener == null) { exceptionListener = Statement.defaultExceptionListener; } this.handler.setExceptionListener(exceptionListener); } /** * Gets the exception handler for this stream. * * @return The exception handler for this stream. * Will return the default exception listener if this has not explicitly been set. * * @see #setExceptionListener */ public ExceptionListener getExceptionListener() { return this.handler.getExceptionListener(); } /** * Reads the next object from the underlying input stream. * * @return the next object read * * @throws ArrayIndexOutOfBoundsException if the stream contains no objects * (or no more objects) * * @see XMLEncoder#writeObject */ public Object readObject() { return (parsingComplete()) ? this.array[this.index++] : null; } /** * Sets the owner of this decoder to {@code owner}. * * @param owner The owner of this decoder. * * @see #getOwner */ public void setOwner(Object owner) { this.owner = owner; } /** * Gets the owner of this decoder. * * @return The owner of this decoder. * * @see #setOwner */ public Object getOwner() { return owner; } /** * Creates a new handler for SAX parser * that can be used to parse embedded XML archives * created by the {@code XMLEncoder} class. * * The {@code owner} should be used if parsed XML document contains * the method call within context of the <java> element. * The {@code null} value may cause illegal parsing in such case. * The same problem may occur, if the {@code owner} class * does not contain expected method to call. See details <a * href="http://www.oracle.com/technetwork/java/persistence3-139471.html"> * here</a>. * * @param owner the owner of the default handler * that can be used as a value of <java> element * @param el the exception handler for the parser, * or {@code null} to use the default exception handler * @param cl the class loader used for instantiating objects, * or {@code null} to use the default class loader * @return an instance of {@code DefaultHandler} for SAX parser * * @since 1.7 */ public static DefaultHandler createHandler(Object owner, ExceptionListener el, ClassLoader cl) { DocumentHandler handler = new DocumentHandler(); handler.setOwner(owner); handler.setExceptionListener(el); handler.setClassLoader(cl); return handler; } }
⏎ java/beans/XMLDecoder.java
Or download all of them as a single archive file:
File name: java.desktop-11.0.1-src.zip File size: 7974380 bytes Release date: 2018-11-04 Download
⇒ JDK 11 java.instrument.jmod - Instrument Module
2022-08-06, 194821👍, 5💬
Popular Posts:
JDK 11 jdk.charsets.jmod is the JMOD file for JDK 11 Charsets module. JDK 11 Charsets module compile...
Where to find answers to frequently asked questions on Downloading and Using JDK (Java Development K...
What Is in Xerces-J-bin.2.12.2.zip? Xerces-J-bin.2.12.2.zip file is the distribution package ZIP fil...
JDK 11 jdk.internal.le.jmod is the JMOD file for JDK 11 Internal Line Editing module. JDK 11 Interna...
maven-core-3.5.4.jar is the JAR file for Apache Maven 3.5.4 Core module. Apache Maven is a software ...