JDK 17 java.desktop.jmod - Desktop Module

JDK 17 java.desktop.jmod is the JMOD file for JDK 17 Desktop module.

JDK 17 Desktop module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\java.desktop.jmod.

JDK 17 Desktop module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.

JDK 17 Desktop module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\java.desktop.

You can click and view the content of each source code file in the list below.

✍: FYIcenter

com/sun/beans/decoder/JavaElementHandler.java

/*
 * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 *
 */
package com.sun.beans.decoder;

import java.beans.XMLDecoder;

/**
 * This class is intended to handle <java> element.
 * Each element that appears in the body of this element
 * is evaluated in the context of the decoder itself.
 * Typically this outer context is used to retrieve the owner of the decoder,
 * which can be set before reading the archive.
 * <p>The following attributes are supported:
 * <dl>
 * <dt>version
 * <dd>the Java version (not supported)
 * <dt>class
 * <dd>the type of preferable parser (not supported)
 * <dt>id
 * <dd>the identifier of the variable that is intended to store the result
 * </dl>
 *
 * @see DocumentHandler#getOwner
 * @see DocumentHandler#setOwner
 * @since 1.7
 *
 * @author Sergey A. Malenkov
 */
final class JavaElementHandler extends ElementHandler {
    private Class<?> type;
    private ValueObject value;

    /**
     * Parses attributes of the element.
     * The following attributes are supported:
     * <dl>
     * <dt>version
     * <dd>the Java version (not supported)
     * <dt>class
     * <dd>the type of preferable parser (not supported)
     * <dt>id
     * <dd>the identifier of the variable that is intended to store the result
     * </dl>
     *
     * @param name   the attribute name
     * @param value  the attribute value
     */
    @Override
    public void addAttribute(String name, String value) {
        if (name.equals("version")) { // NON-NLS: the attribute name
            // unsupported attribute
        } else if (name.equals("class")) { // NON-NLS: the attribute name
            // check class for owner
            this.type = getOwner().findClass(value);
        } else {
            super.addAttribute(name, value);
        }
    }

    /**
     * Adds the argument to the list of readed objects.
     *
     * @param argument  the value of the element that contained in this one
     */
    @Override
    protected void addArgument(Object argument) {
        getOwner().addObject(argument);
    }

    /**
     * Tests whether the value of this element can be used
     * as an argument of the element that contained in this one.
     *
     * @return {@code true} if the value of this element should be used
     *         as an argument of the element that contained in this one,
     *         {@code false} otherwise
     */
    @Override
    protected boolean isArgument() {
        return false; // do not use owner as object
    }

    /**
     * Returns the value of this element.
     *
     * @return the value of this element
     */
    @Override
    protected ValueObject getValueObject() {
        if (this.value == null) {
            this.value = ValueObjectImpl.create(getValue());
        }
        return this.value;
    }

    /**
     * Returns the owner of the owner document handler
     * as a value of &lt;java&gt; element.
     *
     * @return the owner of the owner document handler
     */
    private Object getValue() {
        Object owner = getOwner().getOwner();
        if ((this.type == null) || isValid(owner)) {
            return owner;
        }
        if (owner instanceof XMLDecoder) {
            XMLDecoder decoder = (XMLDecoder) owner;
            owner = decoder.getOwner();
            if (isValid(owner)) {
                return owner;
            }
        }
        throw new IllegalStateException("Unexpected owner class: " + owner.getClass().getName());
    }

    /**
     * Validates the owner of the &lt;java&gt; element.
     * The owner is valid if it is {@code null} or an instance
     * of the class specified by the {@code class} attribute.
     *
     * @param owner  the owner of the &lt;java&gt; element
     * @return {@code true} if the {@code owner} is valid;
     *         {@code false} otherwise
     */
    private boolean isValid(Object owner) {
        return (owner == null) || this.type.isInstance(owner);
    }
}

com/sun/beans/decoder/JavaElementHandler.java

 

Or download all of them as a single archive file:

File name: java.desktop-17.0.5-src.zip
File size: 9152233 bytes
Release date: 2022-09-13
Download 

 

JDK 17 java.instrument.jmod - Instrument Module

JDK 17 java.datatransfer.jmod - Data Transfer Module

JDK 17 JMod/Module Files

⇑⇑ FAQ for JDK (Java Development Kit) 17

2023-09-16, 66426👍, 0💬