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 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/NewElementHandler.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 com.sun.beans.finder.ConstructorFinder; import java.lang.reflect.Array; import java.lang.reflect.Constructor; import java.util.ArrayList; import java.util.List; /** * This class is intended to handle <new> element. * It describes instantiation of the object. * The {@code class} attribute denotes * the name of the class to instantiate. * The inner elements specifies the arguments of the constructor. * For example:<pre> * <new class="java.lang.Long"> * <string>10</string> * </new></pre> * is equivalent to {@code Long.valueOf("10")} in Java code. * <p>The following attributes are supported: * <dl> * <dt>class * <dd>the type of object for instantiation * <dt>id * <dd>the identifier of the variable that is intended to store the result * </dl> * * @since 1.7 * * @author Sergey A. Malenkov */ class NewElementHandler extends ElementHandler { private List<Object> arguments = new ArrayList<Object>(); private ValueObject value = ValueObjectImpl.VOID; private Class<?> type; /** * Parses attributes of the element. * The following attributes are supported: * <dl> * <dt>class * <dd>the type of object for instantiation * <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("class")) { // NON-NLS: the attribute name this.type = getOwner().findClass(value); } else { super.addAttribute(name, value); } } /** * Adds the argument to the list of arguments * that is used to calculate the value of this element. * * @param argument the value of the element that contained in this one */ @Override protected final void addArgument(Object argument) { if (this.arguments == null) { throw new IllegalStateException("Could not add argument to evaluated element"); } this.arguments.add(argument); } /** * Returns the context of the method. * The context of the static method is the class object. * The context of the non-static method is the value of the parent element. * * @return the context of the method */ @Override protected final Object getContextBean() { return (this.type != null) ? this.type : super.getContextBean(); } /** * Returns the value of this element. * * @return the value of this element */ @Override protected final ValueObject getValueObject() { if (this.arguments != null) { try { this.value = getValueObject(this.type, this.arguments.toArray()); } catch (Exception exception) { getOwner().handleException(exception); } finally { this.arguments = null; } } return this.value; } /** * Calculates the value of this element * using the base class and the array of arguments. * By default, it creates an instance of the base class. * This method should be overridden in those handlers * that extend behavior of this element. * * @param type the base class * @param args the array of arguments * @return the value of this element * @throws Exception if calculation is failed */ ValueObject getValueObject(Class<?> type, Object[] args) throws Exception { if (type == null) { throw new IllegalArgumentException("Class name is not set"); } Class<?>[] types = getArgumentTypes(args); Constructor<?> constructor = ConstructorFinder.findConstructor(type, types); if (constructor.isVarArgs()) { args = getArguments(args, constructor.getParameterTypes()); } return ValueObjectImpl.create(constructor.newInstance(args)); } /** * Converts the array of arguments to the array of corresponding classes. * If argument is {@code null} the class is {@code null} too. * * @param arguments the array of arguments * @return the array of corresponding classes */ static Class<?>[] getArgumentTypes(Object[] arguments) { Class<?>[] types = new Class<?>[arguments.length]; for (int i = 0; i < arguments.length; i++) { if (arguments[i] != null) { types[i] = arguments[i].getClass(); } } return types; } /** * Resolves variable arguments. * * @param arguments the array of arguments * @param types the array of parameter types * @return the resolved array of arguments */ static Object[] getArguments(Object[] arguments, Class<?>[] types) { int index = types.length - 1; if (types.length == arguments.length) { Object argument = arguments[index]; if (argument == null) { return arguments; } Class<?> type = types[index]; if (type.isAssignableFrom(argument.getClass())) { return arguments; } } int length = arguments.length - index; Class<?> type = types[index].getComponentType(); Object array = Array.newInstance(type, length); System.arraycopy(arguments, index, array, 0, length); Object[] args = new Object[types.length]; System.arraycopy(arguments, 0, args, 0, index); args[index] = array; return args; } }
⏎ com/sun/beans/decoder/NewElementHandler.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
2023-09-16, 80957👍, 0💬
Popular Posts:
How to read XML document from socket connections with the socket\DelayedInput.java provided in the A...
What Is ojdbc8.jar for Oracle 12c R2? ojdbc8.jar for Oracle 12c R2 is the JAR files of ojdbc.jar, JD...
What Is poi-ooxml-3.5.jar? poi-ooxml-3.5.jar is one of the JAR files for Apache POI 3.5, which provi...
How to read XML document with XML Schema validation from socket connections with the socket\DelayedI...
Where to find answers to frequently asked questions on Downloading and Installing Connector/J - JDBC...