feat(jdk8): add source files of JDK 8.
This commit is contained in:
201
src/main/resources/jdk8/com/oracle/net/Sdp.java
Normal file
201
src/main/resources/jdk8/com/oracle/net/Sdp.java
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.net;
|
||||||
|
|
||||||
|
import java.net.Socket;
|
||||||
|
import java.net.ServerSocket;
|
||||||
|
import java.net.SocketImpl;
|
||||||
|
import java.net.SocketImplFactory;
|
||||||
|
import java.net.SocketException;
|
||||||
|
import java.nio.channels.SocketChannel;
|
||||||
|
import java.nio.channels.ServerSocketChannel;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.FileDescriptor;
|
||||||
|
import java.security.AccessController;
|
||||||
|
import java.security.PrivilegedAction;
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.AccessibleObject;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
|
||||||
|
import sun.net.sdp.SdpSupport;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class consists exclusively of static methods that Sockets or Channels to
|
||||||
|
* sockets that support the InfiniBand Sockets Direct Protocol (SDP).
|
||||||
|
*/
|
||||||
|
|
||||||
|
public final class Sdp {
|
||||||
|
private Sdp() { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package-privage ServerSocket(SocketImpl) constructor
|
||||||
|
*/
|
||||||
|
private static final Constructor<ServerSocket> serverSocketCtor;
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
serverSocketCtor = (Constructor<ServerSocket>)
|
||||||
|
ServerSocket.class.getDeclaredConstructor(SocketImpl.class);
|
||||||
|
setAccessible(serverSocketCtor);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new AssertionError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The package-private SdpSocketImpl() constructor
|
||||||
|
*/
|
||||||
|
private static final Constructor<SocketImpl> socketImplCtor;
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
Class<?> cl = Class.forName("java.net.SdpSocketImpl", true, null);
|
||||||
|
socketImplCtor = (Constructor<SocketImpl>)cl.getDeclaredConstructor();
|
||||||
|
setAccessible(socketImplCtor);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new AssertionError(e);
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
throw new AssertionError(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void setAccessible(final AccessibleObject o) {
|
||||||
|
AccessController.doPrivileged(new PrivilegedAction<Void>() {
|
||||||
|
public Void run() {
|
||||||
|
o.setAccessible(true);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SDP enabled Socket.
|
||||||
|
*/
|
||||||
|
private static class SdpSocket extends Socket {
|
||||||
|
SdpSocket(SocketImpl impl) throws SocketException {
|
||||||
|
super(impl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a SDP enabled SocketImpl
|
||||||
|
*/
|
||||||
|
private static SocketImpl createSocketImpl() {
|
||||||
|
try {
|
||||||
|
return socketImplCtor.newInstance();
|
||||||
|
} catch (InstantiationException x) {
|
||||||
|
throw new AssertionError(x);
|
||||||
|
} catch (IllegalAccessException x) {
|
||||||
|
throw new AssertionError(x);
|
||||||
|
} catch (InvocationTargetException x) {
|
||||||
|
throw new AssertionError(x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an unconnected and unbound SDP socket. The {@code Socket} is
|
||||||
|
* associated with a {@link java.net.SocketImpl} of the system-default type.
|
||||||
|
*
|
||||||
|
* @return a new Socket
|
||||||
|
*
|
||||||
|
* @throws UnsupportedOperationException
|
||||||
|
* If SDP is not supported
|
||||||
|
* @throws IOException
|
||||||
|
* If an I/O error occurs
|
||||||
|
*/
|
||||||
|
public static Socket openSocket() throws IOException {
|
||||||
|
SocketImpl impl = createSocketImpl();
|
||||||
|
return new SdpSocket(impl);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an unbound SDP server socket. The {@code ServerSocket} is
|
||||||
|
* associated with a {@link java.net.SocketImpl} of the system-default type.
|
||||||
|
*
|
||||||
|
* @return a new ServerSocket
|
||||||
|
*
|
||||||
|
* @throws UnsupportedOperationException
|
||||||
|
* If SDP is not supported
|
||||||
|
* @throws IOException
|
||||||
|
* If an I/O error occurs
|
||||||
|
*/
|
||||||
|
public static ServerSocket openServerSocket() throws IOException {
|
||||||
|
// create ServerSocket via package-private constructor
|
||||||
|
SocketImpl impl = createSocketImpl();
|
||||||
|
try {
|
||||||
|
return serverSocketCtor.newInstance(impl);
|
||||||
|
} catch (IllegalAccessException x) {
|
||||||
|
throw new AssertionError(x);
|
||||||
|
} catch (InstantiationException x) {
|
||||||
|
throw new AssertionError(x);
|
||||||
|
} catch (InvocationTargetException x) {
|
||||||
|
Throwable cause = x.getCause();
|
||||||
|
if (cause instanceof IOException)
|
||||||
|
throw (IOException)cause;
|
||||||
|
if (cause instanceof RuntimeException)
|
||||||
|
throw (RuntimeException)cause;
|
||||||
|
throw new RuntimeException(x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a socket channel to a SDP socket.
|
||||||
|
*
|
||||||
|
* <p> The channel will be associated with the system-wide default
|
||||||
|
* {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
|
||||||
|
*
|
||||||
|
* @return a new SocketChannel
|
||||||
|
*
|
||||||
|
* @throws UnsupportedOperationException
|
||||||
|
* If SDP is not supported or not supported by the default selector
|
||||||
|
* provider
|
||||||
|
* @throws IOException
|
||||||
|
* If an I/O error occurs.
|
||||||
|
*/
|
||||||
|
public static SocketChannel openSocketChannel() throws IOException {
|
||||||
|
FileDescriptor fd = SdpSupport.createSocket();
|
||||||
|
return sun.nio.ch.Secrets.newSocketChannel(fd);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Opens a socket channel to a SDP socket.
|
||||||
|
*
|
||||||
|
* <p> The channel will be associated with the system-wide default
|
||||||
|
* {@link java.nio.channels.spi.SelectorProvider SelectorProvider}.
|
||||||
|
*
|
||||||
|
* @return a new ServerSocketChannel
|
||||||
|
*
|
||||||
|
* @throws UnsupportedOperationException
|
||||||
|
* If SDP is not supported or not supported by the default selector
|
||||||
|
* provider
|
||||||
|
* @throws IOException
|
||||||
|
* If an I/O error occurs
|
||||||
|
*/
|
||||||
|
public static ServerSocketChannel openServerSocketChannel()
|
||||||
|
throws IOException
|
||||||
|
{
|
||||||
|
FileDescriptor fd = SdpSupport.createSocket();
|
||||||
|
return sun.nio.ch.Secrets.newServerSocketChannel(fd);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
|
import javax.xml.ws.http.HTTPBinding;
|
||||||
|
import javax.xml.ws.soap.SOAPBinding;
|
||||||
|
import javax.xml.ws.spi.WebServiceFeatureAnnotation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The EnvelopeStyle annotation is used to specify the message envelope style(s)
|
||||||
|
* for a web service endpoint implementation class. To smooth the migration from
|
||||||
|
* the BindingType annotation to this EnvelopeStyle annotation, each of the
|
||||||
|
* styles is mapped to a binding identifier defined in JAX-WS specification.
|
||||||
|
* Though a binding identifier includes both the envelope style and transport,
|
||||||
|
* an envelope style defined herein does NOT imply or mandate any transport protocol
|
||||||
|
* to be use together; HTTP is the default transport. An implementation may
|
||||||
|
* chose to support other transport with any of the envelope styles.
|
||||||
|
*
|
||||||
|
* This annotation may be overriden programmatically or via deployment
|
||||||
|
* descriptors, depending on the platform in use.
|
||||||
|
*
|
||||||
|
* @author shih-chang.chen@oracle.com
|
||||||
|
*/
|
||||||
|
@WebServiceFeatureAnnotation(id="", bean=com.oracle.webservices.internal.api.EnvelopeStyleFeature.class)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface EnvelopeStyle {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The envelope styles. If not specified, the default is the SOAP 1.1.
|
||||||
|
*
|
||||||
|
* @return The enveloping styles
|
||||||
|
*/
|
||||||
|
Style[] style() default { Style.SOAP11 };
|
||||||
|
|
||||||
|
public enum Style {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SOAP1.1. For JAX-WS, this is mapped from:
|
||||||
|
* javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING
|
||||||
|
*/
|
||||||
|
SOAP11(SOAPBinding.SOAP11HTTP_BINDING),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* SOAP1.2. For JAX-WS, this is mapped from:
|
||||||
|
* javax.xml.ws.soap.SOAPBinding.SOAP12HTTP_BINDING
|
||||||
|
*/
|
||||||
|
SOAP12(SOAPBinding.SOAP12HTTP_BINDING),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The raw XML. For JAX-WS, this is mapped from:
|
||||||
|
* javax.xml.ws.http.HTTPBinding.HTTP_BINDING
|
||||||
|
*/
|
||||||
|
XML(HTTPBinding.HTTP_BINDING);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The BindingID used by the BindingType annotation.
|
||||||
|
*/
|
||||||
|
public final String bindingId;
|
||||||
|
|
||||||
|
private Style(String id) {
|
||||||
|
bindingId = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the style is SOAP 1.1.
|
||||||
|
*
|
||||||
|
* @return true if the style is SOAP 1.1.
|
||||||
|
*/
|
||||||
|
public boolean isSOAP11() { return this.equals(SOAP11); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the style is SOAP 1.2.
|
||||||
|
*
|
||||||
|
* @return true if the style is SOAP 1.2.
|
||||||
|
*/
|
||||||
|
public boolean isSOAP12() { return this.equals(SOAP12); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the style is XML.
|
||||||
|
*
|
||||||
|
* @return true if the style is XML.
|
||||||
|
*/
|
||||||
|
public boolean isXML() { return this.equals(XML); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api;
|
||||||
|
|
||||||
|
import javax.xml.ws.WebServiceFeature;
|
||||||
|
|
||||||
|
public class EnvelopeStyleFeature extends WebServiceFeature {
|
||||||
|
|
||||||
|
private EnvelopeStyle.Style[] styles;
|
||||||
|
|
||||||
|
public EnvelopeStyleFeature(EnvelopeStyle.Style... s) {
|
||||||
|
styles = s;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EnvelopeStyle.Style[] getStyles() {
|
||||||
|
return styles;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return EnvelopeStyleFeature.class.getName();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,247 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
import javax.xml.namespace.QName;
|
||||||
|
import javax.xml.transform.Source;
|
||||||
|
import javax.xml.ws.WebServiceFeature;
|
||||||
|
|
||||||
|
import org.xml.sax.EntityResolver;
|
||||||
|
|
||||||
|
import com.oracle.webservices.internal.api.message.MessageContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code Databinding} is the entry point for all the WebService Databinding
|
||||||
|
* functionality. Primarily, a Databinding is to serialize/deserialize an
|
||||||
|
* XML(SOAP) message to/from a JAVA method invocation and return which are
|
||||||
|
* represented as <code>JavaCallInfo</code> instances. A WSDLGenerator can
|
||||||
|
* be created from a Databinding object to genreate WSDL representation of
|
||||||
|
* a JAVA service endpoint interface.
|
||||||
|
* <p>
|
||||||
|
* </p>
|
||||||
|
* The supported databinding modes(flavors) are:
|
||||||
|
* <ul>
|
||||||
|
* <li>"toplink.jaxb"</li>
|
||||||
|
* <li>"glassfish.jaxb"</li>
|
||||||
|
* </ul>
|
||||||
|
* <blockquote> Following is an example that creates a {@code Databinding} which
|
||||||
|
* provides the operations to serialize/deserialize a JavaCallInfo to/from a
|
||||||
|
* SOAP message:<br/>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* DatabindingFactory factory = DatabindingFactory.newInstance();
|
||||||
|
* Databinding.Builder builder = factory.createBuilder(seiClass, endpointClass);
|
||||||
|
* Databinding databinding = builder.build();
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* </blockquote>
|
||||||
|
*
|
||||||
|
* @see com.oracle.webservices.internal.api.databinding.DatabindingFactory
|
||||||
|
*
|
||||||
|
* @author shih-chang.chen@oracle.com
|
||||||
|
*/
|
||||||
|
public interface Databinding {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of a <code>JavaCallInfo</code>.
|
||||||
|
*
|
||||||
|
* @param method The JAVA method
|
||||||
|
* @param args The parameter objects
|
||||||
|
*
|
||||||
|
* @return New instance of a <code>JavaCallInfo</code>
|
||||||
|
*/
|
||||||
|
JavaCallInfo createJavaCallInfo(Method method, Object[] args);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes a JavaCallInfo instance representing a JAVA method call to a
|
||||||
|
* request XML(SOAP) message.
|
||||||
|
*
|
||||||
|
* @param call The JavaCallInfo representing a method call
|
||||||
|
*
|
||||||
|
* @return The request XML(SOAP) message
|
||||||
|
*/
|
||||||
|
MessageContext serializeRequest(JavaCallInfo call);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes a response XML(SOAP) message to a JavaCallInfo instance
|
||||||
|
* representing the return value or exception of a JAVA method call.
|
||||||
|
*
|
||||||
|
* @param message The response message
|
||||||
|
* @param call The JavaCallInfo instance to be updated
|
||||||
|
*
|
||||||
|
* @return The JavaCallInfo updated with the return value or exception of a
|
||||||
|
* JAVA method call
|
||||||
|
*/
|
||||||
|
JavaCallInfo deserializeResponse(MessageContext message, JavaCallInfo call);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deserializes a request XML(SOAP) message to a JavaCallInfo instance
|
||||||
|
* representing a JAVA method call.
|
||||||
|
*
|
||||||
|
* @param message The request message
|
||||||
|
*
|
||||||
|
* @return The JavaCallInfo representing a method call
|
||||||
|
*/
|
||||||
|
JavaCallInfo deserializeRequest(MessageContext message);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Serializes a JavaCallInfo instance representing the return value or
|
||||||
|
* exception of a JAVA method call to a response XML(SOAP) message.
|
||||||
|
*
|
||||||
|
* @param call The JavaCallInfo representing the return value or exception
|
||||||
|
* of a JAVA method call
|
||||||
|
*
|
||||||
|
* @return The response XML(SOAP) message
|
||||||
|
*/
|
||||||
|
MessageContext serializeResponse(JavaCallInfo call);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the MessageContextFactory
|
||||||
|
*
|
||||||
|
* @return The MessageContextFactory
|
||||||
|
*/
|
||||||
|
//Wait for WLS/src1212 - wls.jaxrpc wrapper
|
||||||
|
// MessageContextFactory getMessageContextFactory();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code Databinding.Builder}, created from the DatabindingFactory, is used to
|
||||||
|
* configure how a Databinding instance is to be built from this builder.
|
||||||
|
*
|
||||||
|
* @see com.oracle.webservices.internal.api.databinding.DatabindingFactory
|
||||||
|
* @author shih-chang.chen@oracle.com
|
||||||
|
*/
|
||||||
|
public interface Builder {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the targetNamespace of the WSDL
|
||||||
|
*
|
||||||
|
* @param targetNamespace The targetNamespace to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder targetNamespace(String targetNamespace);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the service name of the WSDL
|
||||||
|
*
|
||||||
|
* @param serviceName The serviceName to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder serviceName(QName serviceName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the port name of the WSDL
|
||||||
|
*
|
||||||
|
* @param portName The portName to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder portName(QName portName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated - no replacement - this was never implemented
|
||||||
|
*
|
||||||
|
* Sets the WSDL URL where the WSDL can be read from
|
||||||
|
*
|
||||||
|
* @param wsdlURL The wsdlURL to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder wsdlURL(URL wsdlURL);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated - no replacement - this was never implemented
|
||||||
|
*
|
||||||
|
* Sets the WSDL Source where the WSDL can be read from
|
||||||
|
*
|
||||||
|
* @param wsdlSource The wsdlSource to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder wsdlSource(Source wsdlSource);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated - no replacement - this was never implemented
|
||||||
|
*
|
||||||
|
* Sets the {@link EntityResolver} for reading the WSDL
|
||||||
|
*
|
||||||
|
* @param entityResolver The {@link EntityResolver} to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder entityResolver(EntityResolver entityResolver);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the ClassLoader which is used to load the service endpoint
|
||||||
|
* interface, implementation bean, and all the value types. If this
|
||||||
|
* value is not set, the default it uses contractClass.getClassLoader().
|
||||||
|
*
|
||||||
|
* @param classLoader The classLoader to set
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder classLoader(ClassLoader classLoader);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets A list of WebServiceFeatures
|
||||||
|
*
|
||||||
|
* @param features The list of WebServiceFeatures
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder feature(WebServiceFeature... features);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets A property of the Databinding object to be created
|
||||||
|
*
|
||||||
|
* @param name The name of the property
|
||||||
|
* @param value The value of the property
|
||||||
|
*
|
||||||
|
* @return this Builder instance
|
||||||
|
*/
|
||||||
|
Builder property(String name, Object value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds a new Databinding instance
|
||||||
|
*
|
||||||
|
* @return The Builder instance
|
||||||
|
*/
|
||||||
|
Databinding build();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the WSDLGenerator which can be used to generate the WSDL
|
||||||
|
* representation of the service endpoint interface of this Databinding
|
||||||
|
* object.
|
||||||
|
*
|
||||||
|
* @return WSDLGenerator The WSDLGenerator
|
||||||
|
*/
|
||||||
|
com.oracle.webservices.internal.api.databinding.WSDLGenerator createWSDLGenerator();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@code DatabindingFactory} is the entry point of all the WebService
|
||||||
|
* Databinding APIs. A DatabindingFactory instance can be used to create
|
||||||
|
* <code>Databinding.Builder</code> instances, and <code>Databinding.Builder</code>
|
||||||
|
* instances are used to configure and build <code>Databinding</code> instances.
|
||||||
|
* <p>
|
||||||
|
* </P>
|
||||||
|
* <blockquote>
|
||||||
|
* Following is an example that creates a {@code Databinding} which provides the
|
||||||
|
* operations to serialize/deserialize a JavaCallInfo to/from a SOAP message:<br/>
|
||||||
|
* <pre>
|
||||||
|
* DatabindingFactory factory = DatabindingFactory.newInstance();
|
||||||
|
* Databinding.Builder builder = factory.createBuilder(seiClass, endpointClass);
|
||||||
|
* Databinding databinding = builder.build();
|
||||||
|
* </pre>
|
||||||
|
* </blockquote>
|
||||||
|
*
|
||||||
|
* @see com.oracle.webservices.internal.api.databinding.Databinding
|
||||||
|
*
|
||||||
|
* @author shih-chang.chen@oracle.com
|
||||||
|
*/
|
||||||
|
public abstract class DatabindingFactory {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of a <code>Databinding.Builder</code> which is
|
||||||
|
* initialized with the specified contractClass and endpointClass. The most
|
||||||
|
* importance initial states of a Builder object is the contract class which
|
||||||
|
* is also called "service endpoint interface" or "SEI" in JAX-WS and JAX-RPC,
|
||||||
|
* and the implementation bean class (endpointClass). The the implementation
|
||||||
|
* bean class (endpointClass) should be null if the Builder is to create
|
||||||
|
* the client side proxy databinding.
|
||||||
|
*
|
||||||
|
* @param contractClass The service endpoint interface class
|
||||||
|
* @param endpointClass The service implementation bean class
|
||||||
|
*
|
||||||
|
* @return New instance of a <code>Databinding.Builder</code>
|
||||||
|
*/
|
||||||
|
abstract public Databinding.Builder createBuilder(Class<?> contractClass, Class<?> endpointClass);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Access properties on the <code>DatabindingFactory</code> instance.
|
||||||
|
*
|
||||||
|
* @return properties of this WsFactory
|
||||||
|
*/
|
||||||
|
abstract public Map<String, Object> properties();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The default implementation class name.
|
||||||
|
*/
|
||||||
|
static final String ImplClass = "com.sun.xml.internal.ws.db.DatabindingFactoryImpl";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance of a <code>DatabindingFactory</code>. This static method
|
||||||
|
* creates a new factory instance.
|
||||||
|
*
|
||||||
|
* Once an application has obtained a reference to a <code>DatabindingFactory</code>
|
||||||
|
* it can use the factory to obtain and configure a <code>Databinding.Builder</code>
|
||||||
|
* to build a <code>Databinding</code> instances.
|
||||||
|
*
|
||||||
|
* @return New instance of a <code>DatabindingFactory</code>
|
||||||
|
*/
|
||||||
|
static public DatabindingFactory newInstance() {
|
||||||
|
try {
|
||||||
|
Class<?> cls = Class.forName(ImplClass);
|
||||||
|
return convertIfNecessary(cls);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
private static DatabindingFactory convertIfNecessary(Class<?> cls) throws InstantiationException, IllegalAccessException {
|
||||||
|
return (DatabindingFactory) cls.newInstance();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
|
||||||
|
import javax.xml.ws.spi.WebServiceFeatureAnnotation;
|
||||||
|
|
||||||
|
@WebServiceFeatureAnnotation(id="", bean=com.oracle.webservices.internal.api.databinding.DatabindingModeFeature.class)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface DatabindingMode {
|
||||||
|
String value();
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.xml.ws.WebServiceFeature;
|
||||||
|
|
||||||
|
public class DatabindingModeFeature extends WebServiceFeature implements com.sun.xml.internal.ws.api.ServiceSharedFeatureMarker {
|
||||||
|
/**
|
||||||
|
* Constant value identifying the DatabindingFeature
|
||||||
|
*/
|
||||||
|
static public final String ID = "http://jax-ws.java.net/features/databinding";
|
||||||
|
|
||||||
|
static public final String GLASSFISH_JAXB = "glassfish.jaxb";
|
||||||
|
|
||||||
|
//These constants should be defined in the corresponding plugin package
|
||||||
|
// static public final String ECLIPSELINK_JAXB = "eclipselink.jaxb";
|
||||||
|
// static public final String ECLIPSELINK_SDO = "eclipselink.sdo";
|
||||||
|
// static public final String TOPLINK_JAXB = "toplink.jaxb";
|
||||||
|
// static public final String TOPLINK_SDO = "toplink.sdo";
|
||||||
|
|
||||||
|
private String mode;
|
||||||
|
private Map<String, Object> properties;
|
||||||
|
|
||||||
|
public DatabindingModeFeature(String mode) {
|
||||||
|
super();
|
||||||
|
this.mode = mode;
|
||||||
|
properties = new HashMap<String, Object>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMode() {
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getID() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getProperties() {
|
||||||
|
return properties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Builder builder() { return new Builder(new DatabindingModeFeature(null)); }
|
||||||
|
|
||||||
|
public final static class Builder {
|
||||||
|
final private DatabindingModeFeature o;
|
||||||
|
Builder(final DatabindingModeFeature x) { o = x; }
|
||||||
|
public DatabindingModeFeature build() { return o; }
|
||||||
|
// public DatabindingModeFeature build() { return (DatabindingModeFeature) FeatureValidator.validate(o); }
|
||||||
|
public Builder value(final String x) { o.mode = x; return this; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import com.sun.xml.internal.ws.api.databinding.MetadataReader;
|
||||||
|
import com.sun.xml.internal.ws.model.ExternalMetadataReader;
|
||||||
|
|
||||||
|
import javax.xml.ws.WebServiceFeature;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WebServiceFeature allowing to define either on server or client side external xml descriptors replacing/supplementing
|
||||||
|
* WS metadata provided by class annotations. This can be useful if those annotations are missing (existing non-WS
|
||||||
|
* components) or if it is necessary to override those.
|
||||||
|
*
|
||||||
|
* @author Miroslav Kos (miroslav.kos at oracle.com)
|
||||||
|
*/
|
||||||
|
public class ExternalMetadataFeature extends WebServiceFeature {
|
||||||
|
|
||||||
|
private static final String ID = "com.oracle.webservices.internal.api.databinding.ExternalMetadataFeature";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable this feature. Defaults to true.
|
||||||
|
*/
|
||||||
|
private boolean enabled = true;
|
||||||
|
|
||||||
|
private List<String> resourceNames;
|
||||||
|
private List<File> files;
|
||||||
|
private MetadataReader reader;
|
||||||
|
|
||||||
|
private ExternalMetadataFeature() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addResources(String... resourceNames) {
|
||||||
|
if (this.resourceNames == null) {
|
||||||
|
this.resourceNames = new ArrayList<String>();
|
||||||
|
}
|
||||||
|
Collections.addAll(this.resourceNames, resourceNames);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getResourceNames() { return resourceNames; }
|
||||||
|
|
||||||
|
public void addFiles(File... files) {
|
||||||
|
if (this.files == null) {
|
||||||
|
this.files = new ArrayList<File>();
|
||||||
|
}
|
||||||
|
Collections.addAll(this.files, files);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<File> getFiles() { return files; }
|
||||||
|
|
||||||
|
public boolean isEnabled() {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setEnabled(final boolean x) {
|
||||||
|
enabled = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getID() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MetadataReader getMetadataReader(ClassLoader classLoader, boolean disableXmlSecurity) {
|
||||||
|
if (reader != null && enabled) return reader;
|
||||||
|
return enabled ? new ExternalMetadataReader(files, resourceNames, classLoader, true, disableXmlSecurity) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (this == o) return true;
|
||||||
|
if (o == null || getClass() != o.getClass()) return false;
|
||||||
|
|
||||||
|
ExternalMetadataFeature that = (ExternalMetadataFeature) o;
|
||||||
|
|
||||||
|
if (enabled != that.enabled) return false;
|
||||||
|
if (files != null ? !files.equals(that.files) : that.files != null) return false;
|
||||||
|
if (resourceNames != null ? !resourceNames.equals(that.resourceNames) : that.resourceNames != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
int result = (enabled ? 1 : 0);
|
||||||
|
result = 31 * result + (resourceNames != null ? resourceNames.hashCode() : 0);
|
||||||
|
result = 31 * result + (files != null ? files.hashCode() : 0);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "[" + getID() +
|
||||||
|
", enabled=" + enabled +
|
||||||
|
", resourceNames=" + resourceNames +
|
||||||
|
", files=" + files +
|
||||||
|
']';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Builder builder() {
|
||||||
|
return new Builder(new ExternalMetadataFeature());
|
||||||
|
}
|
||||||
|
|
||||||
|
public final static class Builder {
|
||||||
|
final private ExternalMetadataFeature o;
|
||||||
|
|
||||||
|
Builder(final ExternalMetadataFeature x) {
|
||||||
|
o = x;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExternalMetadataFeature build() {
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder addResources(String... res) {
|
||||||
|
o.addResources(res);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder addFiles(File... files) {
|
||||||
|
o.addFiles(files);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder setEnabled(boolean enabled) {
|
||||||
|
o.setEnabled(enabled);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Builder setReader( MetadataReader r ) {
|
||||||
|
o.reader = r;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On the client or service-requestor side, a JavaCallInfo object represents a
|
||||||
|
* method call on the service proxy to be serialized as a SOAP request message
|
||||||
|
* to be sent to the service. A SOAP response message returned to the service
|
||||||
|
* client is deserialized as an update to the JavaCallInfo object which is used
|
||||||
|
* to generated the request.
|
||||||
|
* <p>
|
||||||
|
* </p>
|
||||||
|
* On the server or service provider side, a SOAP request message is
|
||||||
|
* deserialized to a JavaCallInfo object which can be used to determine which
|
||||||
|
* method to call, and get the parameter values to call the back-end service
|
||||||
|
* implementation object. The return value or exception returned from the
|
||||||
|
* service implementation should be set to the JavaCallInfo object which then
|
||||||
|
* can be used to serialize to a A SOAP response or fault message to be sent
|
||||||
|
* back to the service client.
|
||||||
|
*
|
||||||
|
* @author shih-chang.chen@oracle.com
|
||||||
|
*/
|
||||||
|
public interface JavaCallInfo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the method of this JavaCallInfo
|
||||||
|
*
|
||||||
|
* @return the method
|
||||||
|
*/
|
||||||
|
public Method getMethod();
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * Sets the method of this JavaCallInfo
|
||||||
|
// *
|
||||||
|
// * @param method The method to set
|
||||||
|
// */
|
||||||
|
// public void setMethod(Method method);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the parameters of this JavaCallInfo
|
||||||
|
*
|
||||||
|
* @return The parameters
|
||||||
|
*/
|
||||||
|
public Object[] getParameters();
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * Sets the parameters of this JavaCallInfo
|
||||||
|
// *
|
||||||
|
// * @param parameters
|
||||||
|
// * the parameters to set
|
||||||
|
// */
|
||||||
|
// public void setParameters(Object[] parameters);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the returnValue of this JavaCallInfo
|
||||||
|
*
|
||||||
|
* @return the returnValue
|
||||||
|
*/
|
||||||
|
public Object getReturnValue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the returnValue of this JavaCallInfo
|
||||||
|
*
|
||||||
|
* @param returnValue
|
||||||
|
* the returnValue to set
|
||||||
|
*/
|
||||||
|
public void setReturnValue(Object returnValue);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the exception of this JavaCallInfo
|
||||||
|
*
|
||||||
|
* @return the exception
|
||||||
|
*/
|
||||||
|
public Throwable getException();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the exception of this JavaCallInfo
|
||||||
|
*
|
||||||
|
* @param exception
|
||||||
|
* the exception to set
|
||||||
|
*/
|
||||||
|
public void setException(Throwable exception);
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WSDLGenerator is used to generate the WSDL representation of the service
|
||||||
|
* endpoint interface of the parent Databinding object.
|
||||||
|
*/
|
||||||
|
public interface WSDLGenerator {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the inlineSchema boolean. When the inlineSchema is true, the
|
||||||
|
* generated schema documents are embedded within the type element of
|
||||||
|
* the generated WSDL. When the inlineSchema is false, the generated
|
||||||
|
* schema documents are generated as standalone schema documents and
|
||||||
|
* imported into the generated WSDL.
|
||||||
|
*
|
||||||
|
* @param inline the inlineSchema boolean.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
WSDLGenerator inlineSchema(boolean inline);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets A property of the WSDLGenerator
|
||||||
|
*
|
||||||
|
* @param name The name of the property
|
||||||
|
* @param value The value of the property
|
||||||
|
*
|
||||||
|
* @return this WSDLGenerator instance
|
||||||
|
*/
|
||||||
|
WSDLGenerator property(String name, Object value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the WSDL using the wsdlResolver to output the generated
|
||||||
|
* documents.
|
||||||
|
*
|
||||||
|
* @param wsdlResolver The WSDLResolver
|
||||||
|
*/
|
||||||
|
void generate(com.oracle.webservices.internal.api.databinding.WSDLResolver wsdlResolver);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates the WSDL into the file directory
|
||||||
|
*
|
||||||
|
* @param outputDir The output file directory
|
||||||
|
* @param name The file name of the main WSDL document
|
||||||
|
*/
|
||||||
|
void generate(File outputDir, String name);
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.databinding;
|
||||||
|
|
||||||
|
import javax.xml.transform.Result;
|
||||||
|
import javax.xml.ws.Holder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* WSDLResolver is used by WSDLGenerator while generating WSDL and its associated
|
||||||
|
* documents. It is used to control what documents need to be generated and what
|
||||||
|
* documents need to be picked from metadata. If endpont's document metadata
|
||||||
|
* already contains some documents, their systemids may be used for wsdl:import,
|
||||||
|
* and schema:import. The suggested filenames are relative urls(for e.g: EchoSchema1.xsd)
|
||||||
|
* The Result object systemids are also relative urls(for e.g: AbsWsdl.wsdl).
|
||||||
|
*
|
||||||
|
* @author Jitendra Kotamraju
|
||||||
|
*/
|
||||||
|
public interface WSDLResolver {
|
||||||
|
/**
|
||||||
|
* Create a Result object into which concrete WSDL is to be generated.
|
||||||
|
*
|
||||||
|
* @return Result for the concrete WSDL
|
||||||
|
*/
|
||||||
|
public Result getWSDL(String suggestedFilename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a Result object into which abstract WSDL is to be generated. If the the
|
||||||
|
* abstract WSDL is already in metadata, it is not generated.
|
||||||
|
*
|
||||||
|
* Update filename if the suggested filename need to be changed in wsdl:import.
|
||||||
|
* This needs to be done if the metadata contains abstract WSDL, and that systemid
|
||||||
|
* needs to be reflected in concrete WSDL's wsdl:import
|
||||||
|
*
|
||||||
|
* @return null if abstract WSDL need not be generated
|
||||||
|
*/
|
||||||
|
public Result getAbstractWSDL(Holder<String> filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a Result object into which schema doc is to be generated. Typically if
|
||||||
|
* there is a schema doc for namespace in metadata, then it is not generated.
|
||||||
|
*
|
||||||
|
* Update filename if the suggested filename need to be changed in xsd:import. This
|
||||||
|
* needs to be done if the metadata contains the document, and that systemid
|
||||||
|
* needs to be reflected in some other document's xsd:import
|
||||||
|
*
|
||||||
|
* @return null if schema need not be generated
|
||||||
|
*/
|
||||||
|
public Result getSchemaOutput(String namespace, Holder<String> filename);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,308 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
import com.sun.istack.internal.NotNull;
|
||||||
|
import com.sun.istack.internal.Nullable;
|
||||||
|
import com.sun.xml.internal.ws.api.message.Packet;
|
||||||
|
import com.sun.xml.internal.ws.client.RequestContext;
|
||||||
|
import com.sun.xml.internal.ws.client.ResponseContext;
|
||||||
|
|
||||||
|
import javax.xml.ws.WebServiceContext;
|
||||||
|
|
||||||
|
import java.util.AbstractMap;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.IdentityHashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link PropertySet} that combines properties exposed from multiple
|
||||||
|
* {@link PropertySet}s into one.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This implementation allows one {@link PropertySet} to assemble
|
||||||
|
* all properties exposed from other "satellite" {@link PropertySet}s.
|
||||||
|
* (A satellite may itself be a {@link DistributedPropertySet}, so
|
||||||
|
* in general this can form a tree.)
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This is useful for JAX-WS because the properties we expose to the application
|
||||||
|
* are contributed by different pieces, and therefore we'd like each of them
|
||||||
|
* to have a separate {@link PropertySet} implementation that backs up
|
||||||
|
* the properties. For example, this allows FastInfoset to expose its
|
||||||
|
* set of properties to {@link RequestContext} by using a strongly-typed fields.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This is also useful for a client-side transport to expose a bunch of properties
|
||||||
|
* into {@link ResponseContext}. It simply needs to create a {@link PropertySet}
|
||||||
|
* object with methods for each property it wants to expose, and then add that
|
||||||
|
* {@link PropertySet} to {@link Packet}. This allows property values to be
|
||||||
|
* lazily computed (when actually asked by users), thus improving the performance
|
||||||
|
* of the typical case where property values are not asked.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* A similar benefit applies on the server-side, for a transport to expose
|
||||||
|
* a bunch of properties to {@link WebServiceContext}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* To achieve these benefits, access to {@link DistributedPropertySet} is slower
|
||||||
|
* compared to {@link PropertySet} (such as get/set), while adding a satellite
|
||||||
|
* object is relatively fast.
|
||||||
|
*
|
||||||
|
* @author Kohsuke Kawaguchi
|
||||||
|
*/
|
||||||
|
public abstract class BaseDistributedPropertySet extends BasePropertySet implements DistributedPropertySet {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All {@link PropertySet}s that are bundled into this {@link PropertySet}.
|
||||||
|
*/
|
||||||
|
private final Map<Class<? extends com.oracle.webservices.internal.api.message.PropertySet>, PropertySet> satellites
|
||||||
|
= new IdentityHashMap<Class<? extends com.oracle.webservices.internal.api.message.PropertySet>, PropertySet>();
|
||||||
|
|
||||||
|
private final Map<String, Object> viewthis;
|
||||||
|
|
||||||
|
public BaseDistributedPropertySet() {
|
||||||
|
this.viewthis = super.createView();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addSatellite(@NotNull PropertySet satellite) {
|
||||||
|
addSatellite(satellite.getClass(), satellite);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addSatellite(@NotNull Class<? extends com.oracle.webservices.internal.api.message.PropertySet> keyClass, @NotNull PropertySet satellite) {
|
||||||
|
satellites.put(keyClass, satellite);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeSatellite(PropertySet satellite) {
|
||||||
|
satellites.remove(satellite.getClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void copySatelliteInto(@NotNull DistributedPropertySet r) {
|
||||||
|
for (Map.Entry<Class<? extends com.oracle.webservices.internal.api.message.PropertySet>, PropertySet> entry : satellites.entrySet()) {
|
||||||
|
r.addSatellite(entry.getKey(), entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void copySatelliteInto(MessageContext r) {
|
||||||
|
copySatelliteInto((DistributedPropertySet)r);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public @Nullable <T extends com.oracle.webservices.internal.api.message.PropertySet> T getSatellite(Class<T> satelliteClass) {
|
||||||
|
T satellite = (T) satellites.get(satelliteClass);
|
||||||
|
if (satellite != null) {
|
||||||
|
return satellite;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (satelliteClass.isInstance(child)) {
|
||||||
|
return satelliteClass.cast(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DistributedPropertySet.class.isInstance(child)) {
|
||||||
|
satellite = DistributedPropertySet.class.cast(child).getSatellite(satelliteClass);
|
||||||
|
if (satellite != null) {
|
||||||
|
return satellite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<Class<? extends com.oracle.webservices.internal.api.message.PropertySet>, com.oracle.webservices.internal.api.message.PropertySet> getSatellites() {
|
||||||
|
return satellites;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object get(Object key) {
|
||||||
|
// check satellites
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.supports(key)) {
|
||||||
|
return child.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// otherwise it must be the master
|
||||||
|
return super.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object put(String key, Object value) {
|
||||||
|
// check satellites
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if(child.supports(key)) {
|
||||||
|
return child.put(key,value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// otherwise it must be the master
|
||||||
|
return super.put(key,value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containsKey(Object key) {
|
||||||
|
if (viewthis.containsKey(key))
|
||||||
|
return true;
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.containsKey(key)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean supports(Object key) {
|
||||||
|
// check satellites
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.supports(key)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.supports(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object remove(Object key) {
|
||||||
|
// check satellites
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.supports(key)) {
|
||||||
|
return child.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void createEntrySet(Set<Entry<String, Object>> core) {
|
||||||
|
super.createEntrySet(core);
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
((BasePropertySet) child).createEntrySet(core);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Map<String, Object> asMapLocal() {
|
||||||
|
return viewthis;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected boolean supportsLocal(Object key) {
|
||||||
|
return super.supports(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
class DistributedMapView extends AbstractMap<String, Object> {
|
||||||
|
@Override
|
||||||
|
public Object get(Object key) {
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.supports(key)) {
|
||||||
|
return child.get(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return viewthis.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int size() {
|
||||||
|
int size = viewthis.size();
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
size += child.asMap().size();
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containsKey(Object key) {
|
||||||
|
if (viewthis.containsKey(key))
|
||||||
|
return true;
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.containsKey(key))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Entry<String, Object>> entrySet() {
|
||||||
|
Set<Entry<String, Object>> entries = new HashSet<Entry<String, Object>>();
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
for (Entry<String,Object> entry : child.asMap().entrySet()) {
|
||||||
|
// the code below is here to avoid entries.addAll(child.asMap().entrySet()); which works differently on JDK6/7
|
||||||
|
// see DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS
|
||||||
|
entries.add(new SimpleImmutableEntry<String, Object>(entry.getKey(), entry.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Entry<String,Object> entry : viewthis.entrySet()) {
|
||||||
|
// the code below is here to avoid entries.addAll(child.asMap().entrySet()); which works differently on JDK6/7
|
||||||
|
// see DMI_ENTRY_SETS_MAY_REUSE_ENTRY_OBJECTS
|
||||||
|
entries.add(new SimpleImmutableEntry<String, Object>(entry.getKey(), entry.getValue()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object put(String key, Object value) {
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.supports(key)) {
|
||||||
|
return child.put(key, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return viewthis.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
satellites.clear();
|
||||||
|
viewthis.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object remove(Object key) {
|
||||||
|
for (PropertySet child : satellites.values()) {
|
||||||
|
if (child.supports(key)) {
|
||||||
|
return child.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return viewthis.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Map<String, Object> createView() {
|
||||||
|
return new DistributedMapView();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,548 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
import com.sun.istack.internal.NotNull;
|
||||||
|
import com.sun.istack.internal.Nullable;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.security.AccessController;
|
||||||
|
import java.security.PrivilegedAction;
|
||||||
|
import java.util.AbstractMap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of "properties" that can be accessed via strongly-typed fields
|
||||||
|
* as well as reflexibly through the property name.
|
||||||
|
*
|
||||||
|
* @author Kohsuke Kawaguchi
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("SuspiciousMethodCalls")
|
||||||
|
public abstract class BasePropertySet implements PropertySet {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new instance of TypedMap.
|
||||||
|
*/
|
||||||
|
protected BasePropertySet() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private Map<String,Object> mapView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the list of strongly-typed known properties
|
||||||
|
* (keyed by property names.)
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Just giving it an alias to make the use of this class more fool-proof.
|
||||||
|
*/
|
||||||
|
protected static class PropertyMap extends HashMap<String,Accessor> {
|
||||||
|
|
||||||
|
// the entries are often being iterated through so performance can be improved
|
||||||
|
// by their caching instead of iterating through the original (immutable) map each time
|
||||||
|
transient PropertyMapEntry[] cachedEntries = null;
|
||||||
|
|
||||||
|
PropertyMapEntry[] getPropertyMapEntries() {
|
||||||
|
if (cachedEntries == null) {
|
||||||
|
cachedEntries = createPropertyMapEntries();
|
||||||
|
}
|
||||||
|
return cachedEntries;
|
||||||
|
}
|
||||||
|
|
||||||
|
private PropertyMapEntry[] createPropertyMapEntries() {
|
||||||
|
final PropertyMapEntry[] modelEntries = new PropertyMapEntry[size()];
|
||||||
|
int i = 0;
|
||||||
|
for (final Entry<String, Accessor> e : entrySet()) {
|
||||||
|
modelEntries[i++] = new PropertyMapEntry(e.getKey(), e.getValue());
|
||||||
|
}
|
||||||
|
return modelEntries;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PropertyMapEntry represents a Map.Entry in the PropertyMap with more efficient access.
|
||||||
|
*/
|
||||||
|
static public class PropertyMapEntry {
|
||||||
|
public PropertyMapEntry(String k, Accessor v) {
|
||||||
|
key = k; value = v;
|
||||||
|
}
|
||||||
|
String key;
|
||||||
|
Accessor value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Map representing the Fields and Methods annotated with {@link PropertySet.Property}.
|
||||||
|
* Model of {@link PropertySet} class.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* At the end of the derivation chain this method just needs to be implemented
|
||||||
|
* as:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* private static final PropertyMap model;
|
||||||
|
* static {
|
||||||
|
* model = parse(MyDerivedClass.class);
|
||||||
|
* }
|
||||||
|
* protected PropertyMap getPropertyMap() {
|
||||||
|
* return model;
|
||||||
|
* }
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
protected abstract PropertyMap getPropertyMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method parses a class for fields and methods with {@link PropertySet.Property}.
|
||||||
|
*/
|
||||||
|
protected static PropertyMap parse(final Class clazz) {
|
||||||
|
// make all relevant fields and methods accessible.
|
||||||
|
// this allows runtime to skip the security check, so they runs faster.
|
||||||
|
return AccessController.doPrivileged(new PrivilegedAction<PropertyMap>() {
|
||||||
|
@Override
|
||||||
|
public PropertyMap run() {
|
||||||
|
PropertyMap props = new PropertyMap();
|
||||||
|
for (Class c=clazz; c!=null; c=c.getSuperclass()) {
|
||||||
|
for (Field f : c.getDeclaredFields()) {
|
||||||
|
Property cp = f.getAnnotation(Property.class);
|
||||||
|
if(cp!=null) {
|
||||||
|
for(String value : cp.value()) {
|
||||||
|
props.put(value, new FieldAccessor(f, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (Method m : c.getDeclaredMethods()) {
|
||||||
|
Property cp = m.getAnnotation(Property.class);
|
||||||
|
if(cp!=null) {
|
||||||
|
String name = m.getName();
|
||||||
|
assert name.startsWith("get") || name.startsWith("is");
|
||||||
|
|
||||||
|
String setName = name.startsWith("is") ? "set"+name.substring(2) : // isFoo -> setFoo
|
||||||
|
's' +name.substring(1); // getFoo -> setFoo
|
||||||
|
Method setter;
|
||||||
|
try {
|
||||||
|
setter = clazz.getMethod(setName,m.getReturnType());
|
||||||
|
} catch (NoSuchMethodException e) {
|
||||||
|
setter = null; // no setter
|
||||||
|
}
|
||||||
|
for(String value : cp.value()) {
|
||||||
|
props.put(value, new MethodAccessor(m, setter, value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return props;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a typed property defined on a {@link PropertySet}.
|
||||||
|
*/
|
||||||
|
protected interface Accessor {
|
||||||
|
String getName();
|
||||||
|
boolean hasValue(PropertySet props);
|
||||||
|
Object get(PropertySet props);
|
||||||
|
void set(PropertySet props, Object value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static final class FieldAccessor implements Accessor {
|
||||||
|
/**
|
||||||
|
* Field with the annotation.
|
||||||
|
*/
|
||||||
|
private final Field f;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* One of the values in {@link Property} annotation on {@link #f}.
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
protected FieldAccessor(Field f, String name) {
|
||||||
|
this.f = f;
|
||||||
|
f.setAccessible(true);
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasValue(PropertySet props) {
|
||||||
|
return get(props)!=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object get(PropertySet props) {
|
||||||
|
try {
|
||||||
|
return f.get(props);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void set(PropertySet props, Object value) {
|
||||||
|
try {
|
||||||
|
f.set(props,value);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new AssertionError();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static final class MethodAccessor implements Accessor {
|
||||||
|
/**
|
||||||
|
* Getter method.
|
||||||
|
*/
|
||||||
|
private final @NotNull Method getter;
|
||||||
|
/**
|
||||||
|
* Setter method.
|
||||||
|
* Some property is read-only.
|
||||||
|
*/
|
||||||
|
private final @Nullable Method setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* One of the values in {@link Property} annotation on {@link #getter}.
|
||||||
|
*/
|
||||||
|
private final String name;
|
||||||
|
|
||||||
|
protected MethodAccessor(Method getter, Method setter, String value) {
|
||||||
|
this.getter = getter;
|
||||||
|
this.setter = setter;
|
||||||
|
this.name = value;
|
||||||
|
getter.setAccessible(true);
|
||||||
|
if (setter!=null) {
|
||||||
|
setter.setAccessible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasValue(PropertySet props) {
|
||||||
|
return get(props)!=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object get(PropertySet props) {
|
||||||
|
try {
|
||||||
|
return getter.invoke(props);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new AssertionError();
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
handle(e);
|
||||||
|
return 0; // never reach here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void set(PropertySet props, Object value) {
|
||||||
|
if(setter==null) {
|
||||||
|
throw new ReadOnlyPropertyException(getName());
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
setter.invoke(props,value);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new AssertionError();
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
handle(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Since we don't expect the getter/setter to throw a checked exception,
|
||||||
|
* it should be possible to make the exception propagation transparent.
|
||||||
|
* That's what we are trying to do here.
|
||||||
|
*/
|
||||||
|
private Exception handle(InvocationTargetException e) {
|
||||||
|
Throwable t = e.getTargetException();
|
||||||
|
if (t instanceof Error) {
|
||||||
|
throw (Error)t;
|
||||||
|
}
|
||||||
|
if (t instanceof RuntimeException) {
|
||||||
|
throw (RuntimeException)t;
|
||||||
|
}
|
||||||
|
throw new Error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class allowing to work with PropertySet object as with a Map; it doesn't only allow to read properties from
|
||||||
|
* the map but also to modify the map in a way it is in sync with original strongly typed fields. It also allows
|
||||||
|
* (if necessary) to store additional properties those can't be found in strongly typed fields.
|
||||||
|
*
|
||||||
|
* @see com.sun.xml.internal.ws.api.PropertySet#asMap() method
|
||||||
|
*/
|
||||||
|
final class MapView extends HashMap<String, Object> {
|
||||||
|
|
||||||
|
// flag if it should allow store also different properties
|
||||||
|
// than the from strongly typed fields
|
||||||
|
boolean extensible;
|
||||||
|
|
||||||
|
MapView(boolean extensible) {
|
||||||
|
super(getPropertyMap().getPropertyMapEntries().length);
|
||||||
|
this.extensible = extensible;
|
||||||
|
initialize();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initialize() {
|
||||||
|
// iterate (cached) array instead of map to speed things up ...
|
||||||
|
PropertyMapEntry[] entries = getPropertyMap().getPropertyMapEntries();
|
||||||
|
for (PropertyMapEntry entry : entries) {
|
||||||
|
super.put(entry.key, entry.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object get(Object key) {
|
||||||
|
Object o = super.get(key);
|
||||||
|
if (o instanceof Accessor) {
|
||||||
|
return ((Accessor) o).get(BasePropertySet.this);
|
||||||
|
} else {
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<Entry<String, Object>> entrySet() {
|
||||||
|
Set<Entry<String, Object>> entries = new HashSet<Entry<String, Object>>();
|
||||||
|
for (String key : keySet()) {
|
||||||
|
entries.add(new SimpleImmutableEntry<String, Object>(key, get(key)));
|
||||||
|
}
|
||||||
|
return entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object put(String key, Object value) {
|
||||||
|
|
||||||
|
Object o = super.get(key);
|
||||||
|
if (o != null && o instanceof Accessor) {
|
||||||
|
|
||||||
|
Object oldValue = ((Accessor) o).get(BasePropertySet.this);
|
||||||
|
((Accessor) o).set(BasePropertySet.this, value);
|
||||||
|
return oldValue;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (extensible) {
|
||||||
|
return super.put(key, value);
|
||||||
|
} else {
|
||||||
|
throw new IllegalStateException("Unknown property [" + key + "] for PropertySet [" +
|
||||||
|
BasePropertySet.this.getClass().getName() + "]");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void clear() {
|
||||||
|
for (String key : keySet()) {
|
||||||
|
remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object remove(Object key) {
|
||||||
|
Object o;
|
||||||
|
o = super.get(key);
|
||||||
|
if (o instanceof Accessor) {
|
||||||
|
((Accessor)o).set(BasePropertySet.this, null);
|
||||||
|
}
|
||||||
|
return super.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean containsKey(Object key) {
|
||||||
|
Accessor sp = getPropertyMap().get(key);
|
||||||
|
if (sp != null) {
|
||||||
|
return sp.get(this) != null;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name of the property.
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* This field is typed as {@link Object} to follow the {@link Map#get(Object)}
|
||||||
|
* convention, but if anything but {@link String} is passed, this method
|
||||||
|
* just returns null.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object get(Object key) {
|
||||||
|
Accessor sp = getPropertyMap().get(key);
|
||||||
|
if (sp != null) {
|
||||||
|
return sp.get(this);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Undefined property "+key);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a property.
|
||||||
|
*
|
||||||
|
* <h3>Implementation Note</h3>
|
||||||
|
* This method is slow. Code inside JAX-WS should define strongly-typed
|
||||||
|
* fields in this class and access them directly, instead of using this.
|
||||||
|
*
|
||||||
|
* @throws ReadOnlyPropertyException
|
||||||
|
* if the given key is an alias of a strongly-typed field,
|
||||||
|
* and if the name object given is not assignable to the field.
|
||||||
|
*
|
||||||
|
* @see Property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object put(String key, Object value) {
|
||||||
|
Accessor sp = getPropertyMap().get(key);
|
||||||
|
if(sp!=null) {
|
||||||
|
Object old = sp.get(this);
|
||||||
|
sp.set(this,value);
|
||||||
|
return old;
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Undefined property "+key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if this {@link PropertySet} supports a property of the given name.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean supports(Object key) {
|
||||||
|
return getPropertyMap().containsKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object remove(Object key) {
|
||||||
|
Accessor sp = getPropertyMap().get(key);
|
||||||
|
if(sp!=null) {
|
||||||
|
Object old = sp.get(this);
|
||||||
|
sp.set(this,null);
|
||||||
|
return old;
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Undefined property "+key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a {@link Map} view of this {@link PropertySet}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This map is partially live, in the sense that values you set to it
|
||||||
|
* will be reflected to {@link PropertySet}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* However, this map may not pick up changes made
|
||||||
|
* to {@link PropertySet} after the view is created.
|
||||||
|
*
|
||||||
|
* @deprecated use newer implementation {@link PropertySet#asMap()} which produces
|
||||||
|
* readwrite {@link Map}
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* always non-null valid instance.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@Override
|
||||||
|
public final Map<String,Object> createMapView() {
|
||||||
|
final Set<Entry<String,Object>> core = new HashSet<Entry<String,Object>>();
|
||||||
|
createEntrySet(core);
|
||||||
|
|
||||||
|
return new AbstractMap<String, Object>() {
|
||||||
|
@Override
|
||||||
|
public Set<Entry<String,Object>> entrySet() {
|
||||||
|
return core;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a modifiable {@link Map} view of this {@link PropertySet}.
|
||||||
|
* <p/>
|
||||||
|
* Changes done on this {@link Map} or on {@link PropertySet} object work in both directions - values made to
|
||||||
|
* {@link Map} are reflected to {@link PropertySet} and changes done using getters/setters on {@link PropertySet}
|
||||||
|
* object are automatically reflected in this {@link Map}.
|
||||||
|
* <p/>
|
||||||
|
* If necessary, it also can hold other values (not present on {@link PropertySet}) -
|
||||||
|
* {@see PropertySet#mapAllowsAdditionalProperties}
|
||||||
|
*
|
||||||
|
* @return always non-null valid instance.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> asMap() {
|
||||||
|
if (mapView == null) {
|
||||||
|
mapView = createView();
|
||||||
|
}
|
||||||
|
return mapView;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected Map<String, Object> createView() {
|
||||||
|
return new MapView(mapAllowsAdditionalProperties());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used when constructing the {@link MapView} for this object - it controls if the {@link MapView} servers only to
|
||||||
|
* access strongly typed values or allows also different values
|
||||||
|
*
|
||||||
|
* @return true if {@link Map} should allow also properties not defined as strongly typed fields
|
||||||
|
*/
|
||||||
|
protected boolean mapAllowsAdditionalProperties() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void createEntrySet(Set<Entry<String,Object>> core) {
|
||||||
|
for (final Entry<String, Accessor> e : getPropertyMap().entrySet()) {
|
||||||
|
core.add(new Entry<String, Object>() {
|
||||||
|
@Override
|
||||||
|
public String getKey() {
|
||||||
|
return e.getKey();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getValue() {
|
||||||
|
return e.getValue().get(BasePropertySet.this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object setValue(Object value) {
|
||||||
|
Accessor acc = e.getValue();
|
||||||
|
Object old = acc.get(BasePropertySet.this);
|
||||||
|
acc.set(BasePropertySet.this,value);
|
||||||
|
return old;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
//TODO Do we want to remove this implementation dependency?
|
||||||
|
import com.sun.xml.internal.ws.encoding.ContentTypeImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Content-Type transport header that will be returned by {@link MessageContext#write(java.io.OutputStream)}.
|
||||||
|
* It will provide the Content-Type header and also take care of SOAP 1.1 SOAPAction header.
|
||||||
|
*
|
||||||
|
* @author Vivek Pandey
|
||||||
|
*/
|
||||||
|
public interface ContentType {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gives non-null Content-Type header value.
|
||||||
|
*/
|
||||||
|
public String getContentType();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gives SOAPAction transport header value. It will be non-null only for SOAP 1.1 messages. In other cases
|
||||||
|
* it MUST be null. The SOAPAction transport header should be written out only when its non-null.
|
||||||
|
*
|
||||||
|
* @return It can be null, in that case SOAPAction header should be written.
|
||||||
|
*/
|
||||||
|
public String getSOAPActionHeader();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Controls the Accept transport header, if the transport supports it.
|
||||||
|
* Returning null means the transport need not add any new header.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* We realize that this is not an elegant abstraction, but
|
||||||
|
* this would do for now. If another person comes and asks for
|
||||||
|
* a similar functionality, we'll define a real abstraction.
|
||||||
|
*/
|
||||||
|
public String getAcceptHeader();
|
||||||
|
|
||||||
|
static public class Builder {
|
||||||
|
private String contentType;
|
||||||
|
private String soapAction;
|
||||||
|
private String accept;
|
||||||
|
private String charset;
|
||||||
|
|
||||||
|
public Builder contentType(String s) {contentType = s; return this; }
|
||||||
|
public Builder soapAction (String s) {soapAction = s; return this; }
|
||||||
|
public Builder accept (String s) {accept = s; return this; }
|
||||||
|
public Builder charset (String s) {charset = s; return this; }
|
||||||
|
public ContentType build() {
|
||||||
|
//TODO Do we want to remove this implementation dependency?
|
||||||
|
return new ContentTypeImpl(contentType, soapAction, accept, charset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.sun.istack.internal.Nullable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@link PropertySet} that combines properties exposed from multiple
|
||||||
|
* {@link PropertySet}s into one.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This implementation allows one {@link PropertySet} to assemble
|
||||||
|
* all properties exposed from other "satellite" {@link PropertySet}s.
|
||||||
|
* (A satellite may itself be a {@link DistributedPropertySet}, so
|
||||||
|
* in general this can form a tree.)
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This is useful for JAX-WS because the properties we expose to the application
|
||||||
|
* are contributed by different pieces, and therefore we'd like each of them
|
||||||
|
* to have a separate {@link PropertySet} implementation that backs up
|
||||||
|
* the properties. For example, this allows FastInfoset to expose its
|
||||||
|
* set of properties to {@link RequestContext} by using a strongly-typed fields.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This is also useful for a client-side transport to expose a bunch of properties
|
||||||
|
* into {@link ResponseContext}. It simply needs to create a {@link PropertySet}
|
||||||
|
* object with methods for each property it wants to expose, and then add that
|
||||||
|
* {@link PropertySet} to {@link Packet}. This allows property values to be
|
||||||
|
* lazily computed (when actually asked by users), thus improving the performance
|
||||||
|
* of the typical case where property values are not asked.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* A similar benefit applies on the server-side, for a transport to expose
|
||||||
|
* a bunch of properties to {@link WebServiceContext}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* To achieve these benefits, access to {@link DistributedPropertySet} is slower
|
||||||
|
* compared to {@link PropertySet} (such as get/set), while adding a satellite
|
||||||
|
* object is relatively fast.
|
||||||
|
*
|
||||||
|
* @author Kohsuke Kawaguchi
|
||||||
|
*/
|
||||||
|
public interface DistributedPropertySet extends com.oracle.webservices.internal.api.message.PropertySet {
|
||||||
|
|
||||||
|
public @Nullable <T extends com.oracle.webservices.internal.api.message.PropertySet> T getSatellite(Class<T> satelliteClass);
|
||||||
|
|
||||||
|
public Map<Class<? extends com.oracle.webservices.internal.api.message.PropertySet>, com.oracle.webservices.internal.api.message.PropertySet> getSatellites();
|
||||||
|
|
||||||
|
public void addSatellite(com.oracle.webservices.internal.api.message.PropertySet satellite);
|
||||||
|
|
||||||
|
public void addSatellite(Class<? extends com.oracle.webservices.internal.api.message.PropertySet> keyClass, com.oracle.webservices.internal.api.message.PropertySet satellite);
|
||||||
|
|
||||||
|
public void removeSatellite(com.oracle.webservices.internal.api.message.PropertySet satellite);
|
||||||
|
|
||||||
|
public void copySatelliteInto(com.oracle.webservices.internal.api.message.MessageContext r);
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.OutputStream;
|
||||||
|
import java.nio.ByteBuffer;
|
||||||
|
import java.nio.channels.WritableByteChannel;
|
||||||
|
|
||||||
|
import javax.xml.soap.SOAPException;
|
||||||
|
import javax.xml.soap.SOAPMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MessageContext represents a container of a SOAP message and all the properties
|
||||||
|
* including the transport headers.
|
||||||
|
*
|
||||||
|
* MessageContext is a composite {@link PropertySet} that combines properties exposed from multiple
|
||||||
|
* {@link PropertySet}s into one.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This implementation allows one {@link PropertySet} to assemble
|
||||||
|
* all properties exposed from other "satellite" {@link PropertySet}s.
|
||||||
|
* (A satellite may itself be a {@link DistributedPropertySet}, so
|
||||||
|
* in general this can form a tree.)
|
||||||
|
*
|
||||||
|
* @author shih-chang.chen@oracle.com
|
||||||
|
*/
|
||||||
|
public interface MessageContext extends DistributedPropertySet {
|
||||||
|
/**
|
||||||
|
* Gets the SAAJ SOAPMessage representation of the SOAP message.
|
||||||
|
*
|
||||||
|
* @return The SOAPMessage
|
||||||
|
*/
|
||||||
|
SOAPMessage getAsSOAPMessage() throws SOAPException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the SAAJ SOAPMessage representation of the SOAP message.
|
||||||
|
* @deprecated use getAsSOAPMessage
|
||||||
|
* @return The SOAPMessage
|
||||||
|
*/
|
||||||
|
SOAPMessage getSOAPMessage() throws SOAPException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Writes the XML infoset portion of this MessageContext
|
||||||
|
* (from <soap:Envelope> to </soap:Envelope>).
|
||||||
|
*
|
||||||
|
* @param out
|
||||||
|
* Must not be null. The caller is responsible for closing the stream,
|
||||||
|
* not the callee.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* The MIME content type of the encoded message (such as "application/xml").
|
||||||
|
* This information is often ncessary by transport.
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
* if a {@link OutputStream} throws {@link IOException}.
|
||||||
|
*/
|
||||||
|
ContentType writeTo( OutputStream out ) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The version of {@link #writeTo(OutputStream)}
|
||||||
|
* that writes to NIO {@link ByteBuffer}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* TODO: for the convenience of implementation, write
|
||||||
|
* an adapter that wraps {@link WritableByteChannel} to {@link OutputStream}.
|
||||||
|
*/
|
||||||
|
// ContentType writeTo( WritableByteChannel buffer );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the Content-type of this message. For an out-bound message that this getContentType()
|
||||||
|
* method returns a null, the Content-Type can be determined only by calling the writeTo
|
||||||
|
* method to write the MessageContext to an OutputStream.
|
||||||
|
*
|
||||||
|
* @return The MIME content type of this message
|
||||||
|
*/
|
||||||
|
ContentType getContentType();
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import com.oracle.webservices.internal.api.EnvelopeStyle;
|
||||||
|
import com.sun.xml.internal.ws.api.SOAPVersion; // TODO leaking RI APIs
|
||||||
|
import com.sun.xml.internal.ws.util.ServiceFinder;
|
||||||
|
|
||||||
|
import javax.xml.soap.MimeHeaders;
|
||||||
|
import javax.xml.soap.SOAPMessage;
|
||||||
|
import javax.xml.transform.Source;
|
||||||
|
import javax.xml.ws.WebServiceFeature;
|
||||||
|
|
||||||
|
public abstract class MessageContextFactory
|
||||||
|
{
|
||||||
|
private static final MessageContextFactory DEFAULT = new com.sun.xml.internal.ws.api.message.MessageContextFactory(new WebServiceFeature[0]);
|
||||||
|
|
||||||
|
protected abstract MessageContextFactory newFactory(WebServiceFeature ... f);
|
||||||
|
|
||||||
|
public abstract MessageContext createContext();
|
||||||
|
|
||||||
|
public abstract MessageContext createContext(SOAPMessage m);
|
||||||
|
|
||||||
|
public abstract MessageContext createContext(Source m);
|
||||||
|
|
||||||
|
public abstract MessageContext createContext(Source m, EnvelopeStyle.Style envelopeStyle);
|
||||||
|
|
||||||
|
public abstract MessageContext createContext(InputStream in, String contentType) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated http://java.net/jira/browse/JAX_WS-1077
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public abstract MessageContext createContext(InputStream in, MimeHeaders headers) throws IOException;
|
||||||
|
|
||||||
|
static public MessageContextFactory createFactory(WebServiceFeature ... f) {
|
||||||
|
return createFactory(null, f);
|
||||||
|
}
|
||||||
|
|
||||||
|
static public MessageContextFactory createFactory(ClassLoader cl, WebServiceFeature ...f) {
|
||||||
|
for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
|
||||||
|
MessageContextFactory newfac = factory.newFactory(f);
|
||||||
|
if (newfac != null) return newfac;
|
||||||
|
}
|
||||||
|
return new com.sun.xml.internal.ws.api.message.MessageContextFactory(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public abstract MessageContext doCreate();
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public abstract MessageContext doCreate(SOAPMessage m);
|
||||||
|
|
||||||
|
//public abstract MessageContext doCreate(InputStream x);
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public abstract MessageContext doCreate(Source x, SOAPVersion soapVersion);
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static MessageContext create(final ClassLoader... classLoader) {
|
||||||
|
return serviceFinder(classLoader,
|
||||||
|
new Creator() {
|
||||||
|
public MessageContext create(final MessageContextFactory f) {
|
||||||
|
return f.doCreate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static MessageContext create(final SOAPMessage m, final ClassLoader... classLoader) {
|
||||||
|
return serviceFinder(classLoader,
|
||||||
|
new Creator() {
|
||||||
|
public MessageContext create(final MessageContextFactory f) {
|
||||||
|
return f.doCreate(m);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
public static MessageContext create(final Source m, final SOAPVersion v, final ClassLoader... classLoader) {
|
||||||
|
return serviceFinder(classLoader,
|
||||||
|
new Creator() {
|
||||||
|
public MessageContext create(final MessageContextFactory f) {
|
||||||
|
return f.doCreate(m, v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
private static MessageContext serviceFinder(final ClassLoader[] classLoader, final Creator creator) {
|
||||||
|
final ClassLoader cl = classLoader.length == 0 ? null : classLoader[0];
|
||||||
|
for (MessageContextFactory factory : ServiceFinder.find(MessageContextFactory.class, cl)) {
|
||||||
|
final MessageContext messageContext = creator.create(factory);
|
||||||
|
if (messageContext != null)
|
||||||
|
return messageContext;
|
||||||
|
}
|
||||||
|
return creator.create(DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
private static interface Creator {
|
||||||
|
public MessageContext create(MessageContextFactory f);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Inherited;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.xml.ws.handler.MessageContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A set of "properties" that can be accessed via strongly-typed fields
|
||||||
|
* as well as reflexibly through the property name.
|
||||||
|
*
|
||||||
|
* @author Kohsuke Kawaguchi
|
||||||
|
*/
|
||||||
|
public interface PropertySet {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks a field on {@link PropertySet} as a
|
||||||
|
* property of {@link MessageContext}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* To make the runtime processing easy, this annotation
|
||||||
|
* must be on a public field (since the property name
|
||||||
|
* can be set through {@link Map} anyway, you won't be
|
||||||
|
* losing abstraction by doing so.)
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For similar reason, this annotation can be only placed
|
||||||
|
* on a reference type, not primitive type.
|
||||||
|
*
|
||||||
|
* @author Kohsuke Kawaguchi
|
||||||
|
*/
|
||||||
|
@Inherited
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Target({ElementType.FIELD,ElementType.METHOD})
|
||||||
|
public @interface Property {
|
||||||
|
/**
|
||||||
|
* Name of the property.
|
||||||
|
*/
|
||||||
|
String[] value();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean containsKey(Object key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name of the property.
|
||||||
|
*
|
||||||
|
* @param key
|
||||||
|
* This field is typed as {@link Object} to follow the {@link Map#get(Object)}
|
||||||
|
* convention, but if anything but {@link String} is passed, this method
|
||||||
|
* just returns null.
|
||||||
|
*/
|
||||||
|
public Object get(Object key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a property.
|
||||||
|
*
|
||||||
|
* <h3>Implementation Note</h3>
|
||||||
|
* This method is slow. Code inside JAX-WS should define strongly-typed
|
||||||
|
* fields in this class and access them directly, instead of using this.
|
||||||
|
*
|
||||||
|
* @see Property
|
||||||
|
*/
|
||||||
|
public Object put(String key, Object value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if this {@link PropertySet} supports a property of the given name.
|
||||||
|
*/
|
||||||
|
public boolean supports(Object key);
|
||||||
|
|
||||||
|
public Object remove(Object key);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a {@link Map} view of this {@link PropertySet}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This map is partially live, in the sense that values you set to it
|
||||||
|
* will be reflected to {@link PropertySet}.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* However, this map may not pick up changes made
|
||||||
|
* to {@link PropertySet} after the view is created.
|
||||||
|
*
|
||||||
|
* @deprecated use newer implementation {@link com.sun.xml.internal.ws.api.PropertySet#asMap()} which produces
|
||||||
|
* readwrite {@link Map}
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* always non-null valid instance.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public Map<String,Object> createMapView();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a modifiable {@link Map} view of this {@link PropertySet}.
|
||||||
|
* <p/>
|
||||||
|
* Changes done on this {@link Map} or on {@link PropertySet} object work in both directions - values made to
|
||||||
|
* {@link Map} are reflected to {@link PropertySet} and changes done using getters/setters on {@link PropertySet}
|
||||||
|
* object are automatically reflected in this {@link Map}.
|
||||||
|
* <p/>
|
||||||
|
* If necessary, it also can hold other values (not present on {@link PropertySet}) -
|
||||||
|
* {@see PropertySet#mapAllowsAdditionalProperties}
|
||||||
|
*
|
||||||
|
* @return always non-null valid instance.
|
||||||
|
*/
|
||||||
|
public Map<String, Object> asMap();
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.api.message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used to indicate that {@link PropertySet#put(String, Object)} failed
|
||||||
|
* because a property is read-only.
|
||||||
|
*
|
||||||
|
* @author Kohsuke Kawaguchi
|
||||||
|
*/
|
||||||
|
public class ReadOnlyPropertyException extends IllegalArgumentException {
|
||||||
|
private final String propertyName;
|
||||||
|
|
||||||
|
public ReadOnlyPropertyException(String propertyName) {
|
||||||
|
super(propertyName+" is a read-only property.");
|
||||||
|
this.propertyName = propertyName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name of the property that was read-only.
|
||||||
|
*/
|
||||||
|
public String getPropertyName() {
|
||||||
|
return propertyName;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.impl.encoding;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import javax.xml.stream.XMLStreamReader;
|
||||||
|
|
||||||
|
import com.oracle.webservices.internal.impl.internalspi.encoding.StreamDecoder;
|
||||||
|
|
||||||
|
import com.sun.xml.internal.ws.api.SOAPVersion;
|
||||||
|
import com.sun.xml.internal.ws.api.message.AttachmentSet;
|
||||||
|
import com.sun.xml.internal.ws.api.message.Message;
|
||||||
|
import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory;
|
||||||
|
import com.sun.xml.internal.ws.encoding.StreamSOAPCodec;
|
||||||
|
import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader;
|
||||||
|
|
||||||
|
public class StreamDecoderImpl implements StreamDecoder {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Message decode(InputStream in, String charset,
|
||||||
|
AttachmentSet att, SOAPVersion soapVersion) throws IOException {
|
||||||
|
XMLStreamReader reader = XMLStreamReaderFactory.create(null, in, charset, true);
|
||||||
|
reader = new TidyXMLStreamReader(reader, in);
|
||||||
|
return StreamSOAPCodec.decode(soapVersion, reader, att);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.webservices.internal.impl.internalspi.encoding;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import com.sun.xml.internal.ws.api.SOAPVersion;
|
||||||
|
import com.sun.xml.internal.ws.api.message.AttachmentSet;
|
||||||
|
import com.sun.xml.internal.ws.api.message.Message;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Decodes SOAPEnvelope read from an <code>InputStream</code> into a <code>Message</code> instance.
|
||||||
|
* This SPI allows for other implementations instead of the default, which is based on XMLStreamReader.
|
||||||
|
*
|
||||||
|
* @since 2.2.9
|
||||||
|
*/
|
||||||
|
public interface StreamDecoder {
|
||||||
|
Message decode(
|
||||||
|
InputStream in, String charset,
|
||||||
|
AttachmentSet att, SOAPVersion soapVersion) throws IOException;
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlEnum;
|
||||||
|
import javax.xml.bind.annotation.XmlEnumValue;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for existing-annotations-type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
* <p>
|
||||||
|
* <pre>
|
||||||
|
* <simpleType name="existing-annotations-type">
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
|
||||||
|
* <enumeration value="merge"/>
|
||||||
|
* <enumeration value="ignore"/>
|
||||||
|
* </restriction>
|
||||||
|
* </simpleType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlType(name = "existing-annotations-type")
|
||||||
|
@XmlEnum
|
||||||
|
public enum ExistingAnnotationsType {
|
||||||
|
|
||||||
|
@XmlEnumValue("merge")
|
||||||
|
MERGE("merge"),
|
||||||
|
@XmlEnumValue("ignore")
|
||||||
|
IGNORE("ignore");
|
||||||
|
private final String value;
|
||||||
|
|
||||||
|
ExistingAnnotationsType(String v) {
|
||||||
|
value = v;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ExistingAnnotationsType fromValue(String v) {
|
||||||
|
for (ExistingAnnotationsType c: ExistingAnnotationsType.values()) {
|
||||||
|
if (c.value.equals(v)) {
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,265 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAnyAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlAnyElement;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRefs;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.namespace.QName;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <group ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}method-annotation" maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* <element name="java-params" minOccurs="0">
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <element ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}java-param" maxOccurs="unbounded"/>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </element>
|
||||||
|
* </sequence>
|
||||||
|
* <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <anyAttribute processContents='skip' namespace='##other'/>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "", propOrder = {
|
||||||
|
"methodAnnotation",
|
||||||
|
"javaParams"
|
||||||
|
})
|
||||||
|
@XmlRootElement(name = "java-method")
|
||||||
|
public class JavaMethod {
|
||||||
|
|
||||||
|
@XmlElementRefs({
|
||||||
|
@XmlElementRef(name = "web-endpoint", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebEndpoint.class, required = false),
|
||||||
|
@XmlElementRef(name = "oneway", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlOneway.class, required = false),
|
||||||
|
@XmlElementRef(name = "action", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlAction.class, required = false),
|
||||||
|
@XmlElementRef(name = "soap-binding", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlSOAPBinding.class, required = false),
|
||||||
|
@XmlElementRef(name = "web-result", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebResult.class, required = false),
|
||||||
|
@XmlElementRef(name = "web-method", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebMethod.class, required = false)
|
||||||
|
})
|
||||||
|
@XmlAnyElement
|
||||||
|
protected List<Object> methodAnnotation;
|
||||||
|
@XmlElement(name = "java-params")
|
||||||
|
protected JavaMethod.JavaParams javaParams;
|
||||||
|
@XmlAttribute(name = "name", required = true)
|
||||||
|
protected String name;
|
||||||
|
@XmlAnyAttribute
|
||||||
|
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the methodAnnotation property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the methodAnnotation property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getMethodAnnotation().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link XmlWebEndpoint }
|
||||||
|
* {@link XmlOneway }
|
||||||
|
* {@link XmlAction }
|
||||||
|
* {@link XmlSOAPBinding }
|
||||||
|
* {@link XmlWebResult }
|
||||||
|
* {@link XmlWebMethod }
|
||||||
|
* {@link Element }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<Object> getMethodAnnotation() {
|
||||||
|
if (methodAnnotation == null) {
|
||||||
|
methodAnnotation = new ArrayList<Object>();
|
||||||
|
}
|
||||||
|
return this.methodAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the javaParams property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link JavaMethod.JavaParams }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaMethod.JavaParams getJavaParams() {
|
||||||
|
return javaParams;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the javaParams property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link JavaMethod.JavaParams }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setJavaParams(JavaMethod.JavaParams value) {
|
||||||
|
this.javaParams = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a map that contains attributes that aren't bound to any typed property on this class.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* the map is keyed by the name of the attribute and
|
||||||
|
* the value is the string value of the attribute.
|
||||||
|
*
|
||||||
|
* the map returned by this method is live, and you can add new attribute
|
||||||
|
* by updating the map directly. Because of this design, there's no setter.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* always non-null
|
||||||
|
*/
|
||||||
|
public Map<QName, String> getOtherAttributes() {
|
||||||
|
return otherAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <element ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}java-param" maxOccurs="unbounded"/>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "", propOrder = {
|
||||||
|
"javaParam"
|
||||||
|
})
|
||||||
|
public static class JavaParams {
|
||||||
|
|
||||||
|
@XmlElement(name = "java-param", required = true)
|
||||||
|
protected List<JavaParam> javaParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the javaParam property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the javaParam property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getJavaParam().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link JavaParam }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<JavaParam> getJavaParam() {
|
||||||
|
if (javaParam == null) {
|
||||||
|
javaParam = new ArrayList<JavaParam>();
|
||||||
|
}
|
||||||
|
return this.javaParam;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAnyAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlAnyElement;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.namespace.QName;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <group ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}param-annotation" maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* </sequence>
|
||||||
|
* <attribute name="java-type" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <anyAttribute processContents='skip' namespace='##other'/>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "", propOrder = {
|
||||||
|
"paramAnnotation"
|
||||||
|
})
|
||||||
|
@XmlRootElement(name = "java-param")
|
||||||
|
public class JavaParam {
|
||||||
|
|
||||||
|
@XmlElementRef(name = "web-param", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebParam.class, required = false)
|
||||||
|
@XmlAnyElement
|
||||||
|
protected List<Object> paramAnnotation;
|
||||||
|
@XmlAttribute(name = "java-type")
|
||||||
|
protected String javaType;
|
||||||
|
@XmlAnyAttribute
|
||||||
|
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the paramAnnotation property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the paramAnnotation property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getParamAnnotation().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link XmlWebParam }
|
||||||
|
* {@link Element }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<Object> getParamAnnotation() {
|
||||||
|
if (paramAnnotation == null) {
|
||||||
|
paramAnnotation = new ArrayList<Object>();
|
||||||
|
}
|
||||||
|
return this.paramAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the javaType property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getJavaType() {
|
||||||
|
return javaType;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the javaType property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setJavaType(String value) {
|
||||||
|
this.javaType = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a map that contains attributes that aren't bound to any typed property on this class.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* the map is keyed by the name of the attribute and
|
||||||
|
* the value is the string value of the attribute.
|
||||||
|
*
|
||||||
|
* the map returned by this method is live, and you can add new attribute
|
||||||
|
* by updating the map directly. Because of this design, there's no setter.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* always non-null
|
||||||
|
*/
|
||||||
|
public Map<QName, String> getOtherAttributes() {
|
||||||
|
return otherAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,452 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAnyAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlAnyElement;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRef;
|
||||||
|
import javax.xml.bind.annotation.XmlElementRefs;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.namespace.QName;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for java-wsdl-mapping-type complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType name="java-wsdl-mapping-type">
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <element name="xml-schema-mapping" minOccurs="0">
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <any maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </element>
|
||||||
|
* <group ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}class-annotation" maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* <element name="java-methods" minOccurs="0">
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <element ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}java-method" maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </element>
|
||||||
|
* </sequence>
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="java-type-name" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="existing-annotations" type="{http://xmlns.oracle.com/webservices/jaxws-databinding}existing-annotations-type" />
|
||||||
|
* <attribute name="databinding" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <anyAttribute processContents='skip' namespace='##other'/>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "java-wsdl-mapping-type", propOrder = {
|
||||||
|
"xmlSchemaMapping",
|
||||||
|
"classAnnotation",
|
||||||
|
"javaMethods"
|
||||||
|
})
|
||||||
|
public class JavaWsdlMappingType {
|
||||||
|
|
||||||
|
@XmlElement(name = "xml-schema-mapping")
|
||||||
|
protected JavaWsdlMappingType.XmlSchemaMapping xmlSchemaMapping;
|
||||||
|
@XmlElementRefs({
|
||||||
|
@XmlElementRef(name = "web-service-client", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebServiceClient.class, required = false),
|
||||||
|
@XmlElementRef(name = "binding-type", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlBindingType.class, required = false),
|
||||||
|
@XmlElementRef(name = "web-service", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebService.class, required = false),
|
||||||
|
@XmlElementRef(name = "web-fault", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlWebFault.class, required = false),
|
||||||
|
@XmlElementRef(name = "service-mode", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlServiceMode.class, required = false),
|
||||||
|
@XmlElementRef(name = "mtom", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlMTOM.class, required = false),
|
||||||
|
@XmlElementRef(name = "handler-chain", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlHandlerChain.class, required = false),
|
||||||
|
@XmlElementRef(name = "soap-binding", namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", type = XmlSOAPBinding.class, required = false)
|
||||||
|
})
|
||||||
|
@XmlAnyElement
|
||||||
|
protected List<Object> classAnnotation;
|
||||||
|
@XmlElement(name = "java-methods")
|
||||||
|
protected JavaWsdlMappingType.JavaMethods javaMethods;
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "java-type-name")
|
||||||
|
protected String javaTypeName;
|
||||||
|
@XmlAttribute(name = "existing-annotations")
|
||||||
|
protected ExistingAnnotationsType existingAnnotations;
|
||||||
|
@XmlAttribute(name = "databinding")
|
||||||
|
protected String databinding;
|
||||||
|
@XmlAnyAttribute
|
||||||
|
private Map<QName, String> otherAttributes = new HashMap<QName, String>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the xmlSchemaMapping property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link JavaWsdlMappingType.XmlSchemaMapping }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaWsdlMappingType.XmlSchemaMapping getXmlSchemaMapping() {
|
||||||
|
return xmlSchemaMapping;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the xmlSchemaMapping property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link JavaWsdlMappingType.XmlSchemaMapping }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setXmlSchemaMapping(JavaWsdlMappingType.XmlSchemaMapping value) {
|
||||||
|
this.xmlSchemaMapping = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* The class-annotation group defines the set of
|
||||||
|
* annotations applicable to the Java class
|
||||||
|
* declaration.
|
||||||
|
* Gets the value of the classAnnotation property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the classAnnotation property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getClassAnnotation().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link XmlWebServiceClient }
|
||||||
|
* {@link XmlBindingType }
|
||||||
|
* {@link XmlWebService }
|
||||||
|
* {@link XmlWebFault }
|
||||||
|
* {@link XmlServiceMode }
|
||||||
|
* {@link XmlMTOM }
|
||||||
|
* {@link XmlHandlerChain }
|
||||||
|
* {@link Element }
|
||||||
|
* {@link XmlSOAPBinding }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<Object> getClassAnnotation() {
|
||||||
|
if (classAnnotation == null) {
|
||||||
|
classAnnotation = new ArrayList<Object>();
|
||||||
|
}
|
||||||
|
return this.classAnnotation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the javaMethods property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link JavaWsdlMappingType.JavaMethods }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaWsdlMappingType.JavaMethods getJavaMethods() {
|
||||||
|
return javaMethods;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the javaMethods property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link JavaWsdlMappingType.JavaMethods }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setJavaMethods(JavaWsdlMappingType.JavaMethods value) {
|
||||||
|
this.javaMethods = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the javaTypeName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getJavaTypeName() {
|
||||||
|
return javaTypeName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the javaTypeName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setJavaTypeName(String value) {
|
||||||
|
this.javaTypeName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the classAnnotations property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link ExistingAnnotationsType }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public ExistingAnnotationsType getExistingAnnotations() {
|
||||||
|
return existingAnnotations;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the classAnnotations property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link ExistingAnnotationsType }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setExistingAnnotations(ExistingAnnotationsType value) {
|
||||||
|
this.existingAnnotations = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the databinding property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getDatabinding() {
|
||||||
|
return databinding;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the databinding property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setDatabinding(String value) {
|
||||||
|
this.databinding = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a map that contains attributes that aren't bound to any typed property on this class.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* the map is keyed by the name of the attribute and
|
||||||
|
* the value is the string value of the attribute.
|
||||||
|
*
|
||||||
|
* the map returned by this method is live, and you can add new attribute
|
||||||
|
* by updating the map directly. Because of this design, there's no setter.
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* always non-null
|
||||||
|
*/
|
||||||
|
public Map<QName, String> getOtherAttributes() {
|
||||||
|
return otherAttributes;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <element ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}java-method" maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "", propOrder = {
|
||||||
|
"javaMethod"
|
||||||
|
})
|
||||||
|
public static class JavaMethods {
|
||||||
|
|
||||||
|
@XmlElement(name = "java-method")
|
||||||
|
protected List<JavaMethod> javaMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the javaMethod property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the javaMethod property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getJavaMethod().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link JavaMethod }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<JavaMethod> getJavaMethod() {
|
||||||
|
if (javaMethod == null) {
|
||||||
|
javaMethod = new ArrayList<JavaMethod>();
|
||||||
|
}
|
||||||
|
return this.javaMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <any maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "", propOrder = {
|
||||||
|
"any"
|
||||||
|
})
|
||||||
|
public static class XmlSchemaMapping {
|
||||||
|
|
||||||
|
@XmlAnyElement(lax = true)
|
||||||
|
protected List<Object> any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the any property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the any property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getAny().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link Object }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<Object> getAny() {
|
||||||
|
if (any == null) {
|
||||||
|
any = new ArrayList<Object>();
|
||||||
|
}
|
||||||
|
return this.any;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,268 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.JAXBElement;
|
||||||
|
import javax.xml.bind.annotation.XmlElementDecl;
|
||||||
|
import javax.xml.bind.annotation.XmlRegistry;
|
||||||
|
import javax.xml.namespace.QName;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This object contains factory methods for each
|
||||||
|
* Java content interface and Java element interface
|
||||||
|
* generated in the com.sun.xml.internal.ws.ext2.java_wsdl package.
|
||||||
|
* <p>An ObjectFactory allows you to programatically
|
||||||
|
* construct new instances of the Java representation
|
||||||
|
* for XML content. The Java representation of XML
|
||||||
|
* content can consist of schema derived interfaces
|
||||||
|
* and classes representing the binding of schema
|
||||||
|
* type definitions, element declarations and model
|
||||||
|
* groups. Factory methods for each of these are
|
||||||
|
* provided in this class.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlRegistry
|
||||||
|
public class ObjectFactory {
|
||||||
|
|
||||||
|
private final static QName _JavaWsdlMapping_QNAME = new QName("http://xmlns.oracle.com/webservices/jaxws-databinding", "java-wsdl-mapping");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: com.sun.xml.internal.ws.ext2.java_wsdl
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public ObjectFactory() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JavaMethod }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaMethod createJavaMethod() {
|
||||||
|
return new JavaMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JavaWsdlMappingType }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaWsdlMappingType createJavaWsdlMappingType() {
|
||||||
|
return new JavaWsdlMappingType();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebEndpoint }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebEndpoint createWebEndpoint() {
|
||||||
|
return new XmlWebEndpoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlMTOM }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlMTOM createMtom() {
|
||||||
|
return new XmlMTOM();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebServiceClient }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebServiceClient createWebServiceClient() {
|
||||||
|
return new XmlWebServiceClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlServiceMode }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlServiceMode createServiceMode() {
|
||||||
|
return new XmlServiceMode();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlBindingType }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlBindingType createBindingType() {
|
||||||
|
return new XmlBindingType();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebServiceRef }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebServiceRef createWebServiceRef() {
|
||||||
|
return new XmlWebServiceRef();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JavaParam }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaParam createJavaParam() {
|
||||||
|
return new JavaParam();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebParam }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebParam createWebParam() {
|
||||||
|
return new XmlWebParam();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebMethod }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebMethod createWebMethod() {
|
||||||
|
return new XmlWebMethod();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebResult }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebResult createWebResult() {
|
||||||
|
return new XmlWebResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlOneway }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlOneway createOneway() {
|
||||||
|
return new XmlOneway();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlSOAPBinding }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlSOAPBinding createSoapBinding() {
|
||||||
|
return new XmlSOAPBinding();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlAction }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlAction createAction() {
|
||||||
|
return new XmlAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlFaultAction }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlFaultAction createFaultAction() {
|
||||||
|
return new XmlFaultAction();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JavaMethod.JavaParams }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaMethod.JavaParams createJavaMethodJavaParams() {
|
||||||
|
return new JavaMethod.JavaParams();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlHandlerChain }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlHandlerChain createHandlerChain() {
|
||||||
|
return new XmlHandlerChain();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebServiceProvider }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebServiceProvider createWebServiceProvider() {
|
||||||
|
return new XmlWebServiceProvider();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebFault }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebFault createWebFault() {
|
||||||
|
return new XmlWebFault();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlResponseWrapper }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlResponseWrapper createResponseWrapper() {
|
||||||
|
return new XmlResponseWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlWebService }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlWebService createWebService() {
|
||||||
|
return new XmlWebService();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link XmlRequestWrapper }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public XmlRequestWrapper createRequestWrapper() {
|
||||||
|
return new XmlRequestWrapper();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JavaWsdlMappingType.XmlSchemaMapping }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaWsdlMappingType.XmlSchemaMapping createJavaWsdlMappingTypeXmlSchemaMapping() {
|
||||||
|
return new JavaWsdlMappingType.XmlSchemaMapping();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JavaWsdlMappingType.JavaMethods }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public JavaWsdlMappingType.JavaMethods createJavaWsdlMappingTypeJavaMethods() {
|
||||||
|
return new JavaWsdlMappingType.JavaMethods();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create an instance of {@link JAXBElement }{@code <}{@link JavaWsdlMappingType }{@code >}}
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlElementDecl(namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", name = "java-wsdl-mapping")
|
||||||
|
public JAXBElement<JavaWsdlMappingType> createJavaWsdlMapping(JavaWsdlMappingType value) {
|
||||||
|
return new JAXBElement<JavaWsdlMappingType>(_JavaWsdlMapping_QNAME, JavaWsdlMappingType.class, null, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlEnum;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for soap-binding-parameter-style.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
* <p>
|
||||||
|
* <pre>
|
||||||
|
* <simpleType name="soap-binding-parameter-style">
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
|
||||||
|
* <enumeration value="BARE"/>
|
||||||
|
* <enumeration value="WRAPPED"/>
|
||||||
|
* </restriction>
|
||||||
|
* </simpleType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlType(name = "soap-binding-parameter-style")
|
||||||
|
@XmlEnum
|
||||||
|
public enum SoapBindingParameterStyle {
|
||||||
|
|
||||||
|
BARE,
|
||||||
|
WRAPPED;
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SoapBindingParameterStyle fromValue(String v) {
|
||||||
|
return valueOf(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlEnum;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for soap-binding-style.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
* <p>
|
||||||
|
* <pre>
|
||||||
|
* <simpleType name="soap-binding-style">
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
|
||||||
|
* <enumeration value="DOCUMENT"/>
|
||||||
|
* <enumeration value="RPC"/>
|
||||||
|
* </restriction>
|
||||||
|
* </simpleType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlType(name = "soap-binding-style")
|
||||||
|
@XmlEnum
|
||||||
|
public enum SoapBindingStyle {
|
||||||
|
|
||||||
|
DOCUMENT,
|
||||||
|
RPC;
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SoapBindingStyle fromValue(String v) {
|
||||||
|
return valueOf(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlEnum;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for soap-binding-use.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
* <p>
|
||||||
|
* <pre>
|
||||||
|
* <simpleType name="soap-binding-use">
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
|
||||||
|
* <enumeration value="LITERAL"/>
|
||||||
|
* <enumeration value="ENCODED"/>
|
||||||
|
* </restriction>
|
||||||
|
* </simpleType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlType(name = "soap-binding-use")
|
||||||
|
@XmlEnum
|
||||||
|
public enum SoapBindingUse {
|
||||||
|
|
||||||
|
LITERAL,
|
||||||
|
ENCODED;
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SoapBindingUse fromValue(String v) {
|
||||||
|
return valueOf(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
|
||||||
|
import com.sun.xml.internal.ws.model.RuntimeModelerException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple util to handle default values.
|
||||||
|
*
|
||||||
|
* @author miroslav.kos@oracle.com
|
||||||
|
*/
|
||||||
|
class Util {
|
||||||
|
|
||||||
|
static String nullSafe(String value) {
|
||||||
|
return value == null ? "" : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static <T> T nullSafe(T value, T defaultValue) {
|
||||||
|
return value == null ? defaultValue : value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
static <T extends Enum> T nullSafe(Enum value, T defaultValue) {
|
||||||
|
return value == null ? defaultValue : (T) T.valueOf(defaultValue.getClass(), value.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Class<?> findClass(String className) {
|
||||||
|
try {
|
||||||
|
return Class.forName(className);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
throw new RuntimeModelerException("runtime.modeler.external.metadata.generic", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlEnum;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for web-param-mode.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
* <p>
|
||||||
|
* <pre>
|
||||||
|
* <simpleType name="web-param-mode">
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
|
||||||
|
* <enumeration value="IN"/>
|
||||||
|
* <enumeration value="OUT"/>
|
||||||
|
* <enumeration value="INOUT"/>
|
||||||
|
* </restriction>
|
||||||
|
* </simpleType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlType(name = "web-param-mode")
|
||||||
|
@XmlEnum
|
||||||
|
public enum WebParamMode {
|
||||||
|
|
||||||
|
IN,
|
||||||
|
OUT,
|
||||||
|
INOUT;
|
||||||
|
|
||||||
|
public String value() {
|
||||||
|
return name();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static WebParamMode fromValue(String v) {
|
||||||
|
return valueOf(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,173 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* <element ref="{http://xmlns.oracle.com/webservices/jaxws-databinding}fault-action" maxOccurs="unbounded" minOccurs="0"/>
|
||||||
|
* </sequence>
|
||||||
|
* <attribute name="input" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="output" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "", propOrder = {
|
||||||
|
"faultAction"
|
||||||
|
})
|
||||||
|
@XmlRootElement(name = "action")
|
||||||
|
public class XmlAction implements javax.xml.ws.Action {
|
||||||
|
|
||||||
|
@XmlElement(name = "fault-action")
|
||||||
|
protected List<XmlFaultAction> faultAction;
|
||||||
|
@XmlAttribute(name = "input")
|
||||||
|
protected String input;
|
||||||
|
@XmlAttribute(name = "output")
|
||||||
|
protected String output;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the faultAction property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* This accessor method returns a reference to the live list,
|
||||||
|
* not a snapshot. Therefore any modification you make to the
|
||||||
|
* returned list will be present inside the JAXB object.
|
||||||
|
* This is why there is not a <CODE>set</CODE> method for the faultAction property.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* For example, to add a new item, do as follows:
|
||||||
|
* <pre>
|
||||||
|
* getFaultAction().add(newItem);
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* Objects of the following type(s) are allowed in the list
|
||||||
|
* {@link XmlFaultAction }
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public List<XmlFaultAction> getFaultAction() {
|
||||||
|
if (faultAction == null) {
|
||||||
|
faultAction = new ArrayList<XmlFaultAction>();
|
||||||
|
}
|
||||||
|
return this.faultAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the input property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getInput() {
|
||||||
|
return nullSafe(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the input property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setInput(String value) {
|
||||||
|
this.input = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the output property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getOutput() {
|
||||||
|
return nullSafe(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the output property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setOutput(String value) {
|
||||||
|
this.output = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String input() {
|
||||||
|
return nullSafe(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String output() {
|
||||||
|
return nullSafe(output);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public javax.xml.ws.FaultAction[] fault() {
|
||||||
|
return new javax.xml.ws.FaultAction[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.Action.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.ws.soap.AddressingFeature;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "addressing")
|
||||||
|
public class XmlAddressing implements javax.xml.ws.soap.Addressing {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "enabled")
|
||||||
|
protected Boolean enabled;
|
||||||
|
|
||||||
|
@XmlAttribute(name = "required")
|
||||||
|
protected Boolean required;
|
||||||
|
|
||||||
|
public Boolean getEnabled() {
|
||||||
|
return enabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnabled(Boolean enabled) {
|
||||||
|
this.enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getRequired() {
|
||||||
|
return required();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequired(Boolean required) {
|
||||||
|
this.required = required;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean enabled() {
|
||||||
|
return nullSafe(enabled, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean required() {
|
||||||
|
return nullSafe(required, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AddressingFeature.Responses responses() {
|
||||||
|
return AddressingFeature.Responses.ALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.soap.Addressing.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "binding-type")
|
||||||
|
public class XmlBindingType implements javax.xml.ws.BindingType {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "value")
|
||||||
|
protected String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the value property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the value property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String value() {
|
||||||
|
return nullSafe(value);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.BindingType.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.findClass;
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="className" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "fault-action")
|
||||||
|
public class XmlFaultAction implements javax.xml.ws.FaultAction {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "className", required = true)
|
||||||
|
protected String className;
|
||||||
|
@XmlAttribute(name = "value")
|
||||||
|
protected String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the className property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getClassName() {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the className property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setClassName(String value) {
|
||||||
|
this.className = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the value property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getValue() {
|
||||||
|
return nullSafe(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the value property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public Class<? extends Exception> className() {
|
||||||
|
return (Class<Exception>) findClass(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String value() {
|
||||||
|
return nullSafe(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.FaultAction.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="file" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "handler-chain")
|
||||||
|
public class XmlHandlerChain implements javax.jws.HandlerChain {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "file")
|
||||||
|
protected String file;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the file property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getFile() {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the file property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setFile(String value) {
|
||||||
|
this.file = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String file() {
|
||||||
|
return nullSafe(file);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return ""; // deprecated, so let's ignore it ...
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.HandlerChain.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.ws.soap.MTOM;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="enabled" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
|
||||||
|
* <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}int" default="0" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "mtom")
|
||||||
|
public class XmlMTOM implements MTOM {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "enabled")
|
||||||
|
protected Boolean enabled;
|
||||||
|
@XmlAttribute(name = "threshold")
|
||||||
|
protected Integer threshold;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the enabled property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public boolean isEnabled() {
|
||||||
|
if (enabled == null) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the enabled property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setEnabled(Boolean value) {
|
||||||
|
this.enabled = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the threshold property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link Integer }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public int getThreshold() {
|
||||||
|
if (threshold == null) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return threshold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the threshold property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link Integer }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setThreshold(Integer value) {
|
||||||
|
this.threshold = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean enabled() {
|
||||||
|
return nullSafe(enabled, Boolean.TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int threshold() {
|
||||||
|
return nullSafe(threshold, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return MTOM.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <sequence>
|
||||||
|
* </sequence>
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "oneway")
|
||||||
|
public class XmlOneway implements javax.jws.Oneway {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.Oneway.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="local-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="target-namespace" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="class-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="part-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "request-wrapper")
|
||||||
|
public class XmlRequestWrapper implements javax.xml.ws.RequestWrapper {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "local-name")
|
||||||
|
protected String localName;
|
||||||
|
@XmlAttribute(name = "target-namespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
@XmlAttribute(name = "class-name")
|
||||||
|
protected String className;
|
||||||
|
@XmlAttribute(name = "part-name")
|
||||||
|
protected String partName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the localName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getLocalName() {
|
||||||
|
if (localName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return localName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the localName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setLocalName(String value) {
|
||||||
|
this.localName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
if (targetNamespace == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the className property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getClassName() {
|
||||||
|
if (className == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the className property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setClassName(String value) {
|
||||||
|
this.className = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartName() {
|
||||||
|
return partName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartName(String partName) {
|
||||||
|
this.partName = partName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String localName() {
|
||||||
|
return nullSafe(localName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String className() {
|
||||||
|
return nullSafe(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String partName() {
|
||||||
|
return nullSafe(partName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.RequestWrapper.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="local-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="target-namespace" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="class-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="part-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "response-wrapper")
|
||||||
|
public class XmlResponseWrapper implements javax.xml.ws.ResponseWrapper {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "local-name")
|
||||||
|
protected String localName;
|
||||||
|
@XmlAttribute(name = "target-namespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
@XmlAttribute(name = "class-name")
|
||||||
|
protected String className;
|
||||||
|
@XmlAttribute(name = "part-name")
|
||||||
|
protected String partName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the localName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getLocalName() {
|
||||||
|
if (localName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return localName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the localName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setLocalName(String value) {
|
||||||
|
this.localName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
if (targetNamespace == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the className property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getClassName() {
|
||||||
|
if (className == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return className;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the className property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setClassName(String value) {
|
||||||
|
this.className = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPartName() {
|
||||||
|
return partName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPartName(String partName) {
|
||||||
|
this.partName = partName;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String localName() {
|
||||||
|
return nullSafe(localName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String className() {
|
||||||
|
return nullSafe(className);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String partName() {
|
||||||
|
return nullSafe(partName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.ResponseWrapper.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="style" type="{http://xmlns.oracle.com/webservices/jaxws-databinding}soap-binding-style" default="DOCUMENT" />
|
||||||
|
* <attribute name="use" type="{http://xmlns.oracle.com/webservices/jaxws-databinding}soap-binding-use" default="LITERAL" />
|
||||||
|
* <attribute name="parameter-style" type="{http://xmlns.oracle.com/webservices/jaxws-databinding}soap-binding-parameter-style" default="WRAPPED" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "soap-binding")
|
||||||
|
public class XmlSOAPBinding implements javax.jws.soap.SOAPBinding {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "style")
|
||||||
|
protected SoapBindingStyle style;
|
||||||
|
@XmlAttribute(name = "use")
|
||||||
|
protected SoapBindingUse use;
|
||||||
|
@XmlAttribute(name = "parameter-style")
|
||||||
|
protected SoapBindingParameterStyle parameterStyle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the style property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link SoapBindingStyle }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public SoapBindingStyle getStyle() {
|
||||||
|
if (style == null) {
|
||||||
|
return SoapBindingStyle.DOCUMENT;
|
||||||
|
} else {
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the style property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link SoapBindingStyle }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setStyle(SoapBindingStyle value) {
|
||||||
|
this.style = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the use property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link SoapBindingUse }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public SoapBindingUse getUse() {
|
||||||
|
if (use == null) {
|
||||||
|
return SoapBindingUse.LITERAL;
|
||||||
|
} else {
|
||||||
|
return use;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the use property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link SoapBindingUse }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setUse(SoapBindingUse value) {
|
||||||
|
this.use = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the parameterStyle property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link SoapBindingParameterStyle }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public SoapBindingParameterStyle getParameterStyle() {
|
||||||
|
if (parameterStyle == null) {
|
||||||
|
return SoapBindingParameterStyle.WRAPPED;
|
||||||
|
} else {
|
||||||
|
return parameterStyle;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the parameterStyle property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link SoapBindingParameterStyle }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setParameterStyle(SoapBindingParameterStyle value) {
|
||||||
|
this.parameterStyle = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Style style() {
|
||||||
|
return nullSafe(style, Style.DOCUMENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Use use() {
|
||||||
|
return nullSafe(use, Use.LITERAL);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ParameterStyle parameterStyle() {
|
||||||
|
return nullSafe(parameterStyle, ParameterStyle.WRAPPED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.soap.SOAPBinding.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.ws.Service;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" default="PAYLOAD" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "service-mode")
|
||||||
|
public class XmlServiceMode implements javax.xml.ws.ServiceMode {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "value")
|
||||||
|
protected String value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the value property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getValue() {
|
||||||
|
if (value == null) {
|
||||||
|
return "PAYLOAD";
|
||||||
|
} else {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the value property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Service.Mode value() {
|
||||||
|
return Service.Mode.valueOf(nullSafe(value, "PAYLOAD"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.ServiceMode.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-endpoint")
|
||||||
|
public class XmlWebEndpoint implements javax.xml.ws.WebEndpoint {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.WebEndpoint.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="faultBean" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-fault")
|
||||||
|
public class XmlWebFault implements javax.xml.ws.WebFault {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "targetNamespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
@XmlAttribute(name = "faultBean")
|
||||||
|
protected String faultBean;
|
||||||
|
@XmlAttribute(name = "messageName")
|
||||||
|
protected String messageName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the faultBean property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getFaultBean() {
|
||||||
|
return faultBean;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the faultBean property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setFaultBean(String value) {
|
||||||
|
this.faultBean = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String faultBean() {
|
||||||
|
return nullSafe(faultBean);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String messageName() {
|
||||||
|
return nullSafe(messageName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.WebFault.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,172 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="action" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="exclude" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
|
||||||
|
* <attribute name="operation-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-method")
|
||||||
|
public class XmlWebMethod implements javax.jws.WebMethod {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "action")
|
||||||
|
protected String action;
|
||||||
|
@XmlAttribute(name = "exclude")
|
||||||
|
protected Boolean exclude;
|
||||||
|
@XmlAttribute(name = "operation-name")
|
||||||
|
protected String operationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the action property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getAction() {
|
||||||
|
if (action == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return action;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the action property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setAction(String value) {
|
||||||
|
this.action = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the exclude property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public boolean isExclude() {
|
||||||
|
if (exclude == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return exclude;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the exclude property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setExclude(Boolean value) {
|
||||||
|
this.exclude = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the operationName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getOperationName() {
|
||||||
|
if (operationName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return operationName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the operationName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setOperationName(String value) {
|
||||||
|
this.operationName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String operationName() {
|
||||||
|
return nullSafe(operationName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String action() {
|
||||||
|
return nullSafe(action);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean exclude() {
|
||||||
|
return nullSafe(exclude, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.WebMethod.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,244 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="header" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
|
||||||
|
* <attribute name="mode" type="{http://xmlns.oracle.com/webservices/jaxws-databinding}web-param-mode" default="IN" />
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="part-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="target-namespace" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-param")
|
||||||
|
public class XmlWebParam implements javax.jws.WebParam {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "header")
|
||||||
|
protected Boolean header;
|
||||||
|
@XmlAttribute(name = "mode")
|
||||||
|
protected WebParamMode mode;
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "part-name")
|
||||||
|
protected String partName;
|
||||||
|
@XmlAttribute(name = "target-namespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the header property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public boolean isHeader() {
|
||||||
|
if (header == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the header property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setHeader(Boolean value) {
|
||||||
|
this.header = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the mode property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link WebParamMode }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public WebParamMode getMode() {
|
||||||
|
if (mode == null) {
|
||||||
|
return WebParamMode.IN;
|
||||||
|
} else {
|
||||||
|
return mode;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the mode property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link WebParamMode }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setMode(WebParamMode value) {
|
||||||
|
this.mode = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
if (name == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the partName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getPartName() {
|
||||||
|
if (partName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return partName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the partName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setPartName(String value) {
|
||||||
|
this.partName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
if (targetNamespace == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String partName() {
|
||||||
|
return nullSafe(partName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mode mode() {
|
||||||
|
return nullSafe(mode, Mode.IN);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean header() {
|
||||||
|
return nullSafe(header, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.WebParam.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="header" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="part-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="target-namespace" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-result")
|
||||||
|
public class XmlWebResult implements javax.jws.WebResult {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "header")
|
||||||
|
protected Boolean header;
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "part-name")
|
||||||
|
protected String partName;
|
||||||
|
@XmlAttribute(name = "target-namespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the header property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public boolean isHeader() {
|
||||||
|
if (header == null) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return header;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the header property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link Boolean }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setHeader(Boolean value) {
|
||||||
|
this.header = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
if (name == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the partName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getPartName() {
|
||||||
|
if (partName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return partName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the partName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setPartName(String value) {
|
||||||
|
this.partName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
if (targetNamespace == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String partName() {
|
||||||
|
return nullSafe(partName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean header() {
|
||||||
|
return nullSafe(header, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.WebResult.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,282 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="endpoint-interface" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="port-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="service-name" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="target-namespace" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* <attribute name="wsdl-location" type="{http://www.w3.org/2001/XMLSchema}string" default="" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-service")
|
||||||
|
public class XmlWebService implements javax.jws.WebService {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "endpoint-interface")
|
||||||
|
protected String endpointInterface;
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "port-name")
|
||||||
|
protected String portName;
|
||||||
|
@XmlAttribute(name = "service-name")
|
||||||
|
protected String serviceName;
|
||||||
|
@XmlAttribute(name = "target-namespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
@XmlAttribute(name = "wsdl-location")
|
||||||
|
protected String wsdlLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the endpointInterface property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getEndpointInterface() {
|
||||||
|
if (endpointInterface == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return endpointInterface;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the endpointInterface property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setEndpointInterface(String value) {
|
||||||
|
this.endpointInterface = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
if (name == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the portName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getPortName() {
|
||||||
|
if (portName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return portName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the portName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setPortName(String value) {
|
||||||
|
this.portName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the serviceName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getServiceName() {
|
||||||
|
if (serviceName == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return serviceName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the serviceName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setServiceName(String value) {
|
||||||
|
this.serviceName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
if (targetNamespace == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getWsdlLocation() {
|
||||||
|
if (wsdlLocation == null) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return wsdlLocation;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setWsdlLocation(String value) {
|
||||||
|
this.wsdlLocation = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String serviceName() {
|
||||||
|
return nullSafe(serviceName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String portName() {
|
||||||
|
return nullSafe(portName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String wsdlLocation() {
|
||||||
|
return nullSafe(wsdlLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String endpointInterface() {
|
||||||
|
return nullSafe(endpointInterface);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.jws.WebService.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="wsdlLocation" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-service-client")
|
||||||
|
public class XmlWebServiceClient implements javax.xml.ws.WebServiceClient {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "targetNamespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
@XmlAttribute(name = "wsdlLocation")
|
||||||
|
protected String wsdlLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getWsdlLocation() {
|
||||||
|
return wsdlLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setWsdlLocation(String value) {
|
||||||
|
this.wsdlLocation = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String wsdlLocation() {
|
||||||
|
return nullSafe(wsdlLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.WebServiceClient.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="targetNamespace" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="serviceName" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="portName" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="wsdlLocation" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-service-provider")
|
||||||
|
public class XmlWebServiceProvider implements javax.xml.ws.WebServiceProvider {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "targetNamespace")
|
||||||
|
protected String targetNamespace;
|
||||||
|
@XmlAttribute(name = "serviceName")
|
||||||
|
protected String serviceName;
|
||||||
|
@XmlAttribute(name = "portName")
|
||||||
|
protected String portName;
|
||||||
|
@XmlAttribute(name = "wsdlLocation")
|
||||||
|
protected String wsdlLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getTargetNamespace() {
|
||||||
|
return targetNamespace;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the targetNamespace property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setTargetNamespace(String value) {
|
||||||
|
this.targetNamespace = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the serviceName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getServiceName() {
|
||||||
|
return serviceName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the serviceName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setServiceName(String value) {
|
||||||
|
this.serviceName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the portName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getPortName() {
|
||||||
|
return portName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the portName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setPortName(String value) {
|
||||||
|
this.portName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getWsdlLocation() {
|
||||||
|
return wsdlLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setWsdlLocation(String value) {
|
||||||
|
this.wsdlLocation = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String wsdlLocation() {
|
||||||
|
return nullSafe(wsdlLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String serviceName() {
|
||||||
|
return nullSafe(serviceName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String targetNamespace() {
|
||||||
|
return nullSafe(targetNamespace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String portName() {
|
||||||
|
return nullSafe(portName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.WebServiceProvider.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,248 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
import javax.xml.bind.annotation.XmlRootElement;
|
||||||
|
import javax.xml.bind.annotation.XmlType;
|
||||||
|
import javax.xml.ws.Service;
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.findClass;
|
||||||
|
import static com.oracle.xmlns.internal.webservices.jaxws_databinding.Util.nullSafe;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was generated by JAXB-RI v2.2.6 and afterwards modified
|
||||||
|
* to implement appropriate Annotation
|
||||||
|
*
|
||||||
|
* <p>Java class for anonymous complex type.
|
||||||
|
*
|
||||||
|
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* <complexType>
|
||||||
|
* <complexContent>
|
||||||
|
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||||
|
* <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="mappedName" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* <attribute name="wsdlLocation" type="{http://www.w3.org/2001/XMLSchema}string" />
|
||||||
|
* </restriction>
|
||||||
|
* </complexContent>
|
||||||
|
* </complexType>
|
||||||
|
* </pre>
|
||||||
|
*/
|
||||||
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
|
@XmlType(name = "")
|
||||||
|
@XmlRootElement(name = "web-service-ref")
|
||||||
|
public class XmlWebServiceRef implements javax.xml.ws.WebServiceRef {
|
||||||
|
|
||||||
|
@XmlAttribute(name = "name")
|
||||||
|
protected String name;
|
||||||
|
@XmlAttribute(name = "type")
|
||||||
|
protected String type;
|
||||||
|
@XmlAttribute(name = "mappedName")
|
||||||
|
protected String mappedName;
|
||||||
|
@XmlAttribute(name = "value")
|
||||||
|
protected String value;
|
||||||
|
@XmlAttribute(name = "wsdlLocation")
|
||||||
|
protected String wsdlLocation;
|
||||||
|
@XmlAttribute(name = "lookup")
|
||||||
|
protected String lookup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the name property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the name property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setName(String value) {
|
||||||
|
this.name = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the type property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the type property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setType(String value) {
|
||||||
|
this.type = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the mappedName property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getMappedName() {
|
||||||
|
return mappedName;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the mappedName property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setMappedName(String value) {
|
||||||
|
this.mappedName = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the value property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the value property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* possible object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public String getWsdlLocation() {
|
||||||
|
return wsdlLocation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the value of the wsdlLocation property.
|
||||||
|
*
|
||||||
|
* @param value
|
||||||
|
* allowed object is
|
||||||
|
* {@link String }
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public void setWsdlLocation(String value) {
|
||||||
|
this.wsdlLocation = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLookup() {
|
||||||
|
return lookup;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLookup(String lookup) {
|
||||||
|
this.lookup = lookup;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String name() {
|
||||||
|
return nullSafe(name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<?> type() {
|
||||||
|
if (type == null) {
|
||||||
|
return Object.class;
|
||||||
|
}
|
||||||
|
return findClass(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String mappedName() {
|
||||||
|
return nullSafe(mappedName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public Class<? extends Service> value() {
|
||||||
|
if (value == null) {
|
||||||
|
return Service.class;
|
||||||
|
}
|
||||||
|
return (Class<Service>) findClass(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String wsdlLocation() {
|
||||||
|
return nullSafe(wsdlLocation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String lookup() {
|
||||||
|
return nullSafe(lookup);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Class<? extends Annotation> annotationType() {
|
||||||
|
return javax.xml.ws.WebServiceRef.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.6-SNAPSHOT
|
||||||
|
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
|
||||||
|
// Any modifications to this file will be lost upon recompilation of the source schema.
|
||||||
|
// Generated on: 2012.03.21 at 10:57:01 AM CET
|
||||||
|
//
|
||||||
|
|
||||||
|
@javax.xml.bind.annotation.XmlSchema(namespace = "http://xmlns.oracle.com/webservices/jaxws-databinding", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
|
||||||
|
package com.oracle.xmlns.internal.webservices.jaxws_databinding;
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "active" },
|
||||||
|
{ "alert", "alert" },
|
||||||
|
{ "armed", "armed" },
|
||||||
|
{ "awtcomponent", "AWT component" },
|
||||||
|
{ "busy", "busy" },
|
||||||
|
{ "canvas", "canvas" },
|
||||||
|
{ "checkbox", "check box" },
|
||||||
|
{ "checked", "checked" },
|
||||||
|
{ "childNodeOf", "child node of" },
|
||||||
|
{ "collapsed", "collapsed" },
|
||||||
|
{ "colorchooser", "color chooser" },
|
||||||
|
{ "columnheader", "column header" },
|
||||||
|
{ "combobox", "combo box" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "desktop icon" },
|
||||||
|
{ "desktoppane", "desktop pane" },
|
||||||
|
{ "dialog", "dialog" },
|
||||||
|
{ "directorypane", "directory pane" },
|
||||||
|
{ "editable", "editable" },
|
||||||
|
{ "editbar", "editbar" },
|
||||||
|
{ "embeddedBy", "embedded by" },
|
||||||
|
{ "embeds", "embeds" },
|
||||||
|
{ "enabled", "enabled" },
|
||||||
|
{ "expandable", "expandable" },
|
||||||
|
{ "expanded", "expanded" },
|
||||||
|
{ "filechooser", "file chooser" },
|
||||||
|
{ "filler", "filler" },
|
||||||
|
{ "flowsFrom", "flows from" },
|
||||||
|
{ "flowsTo", "flows to" },
|
||||||
|
{ "focusable", "focusable" },
|
||||||
|
{ "focused", "focused" },
|
||||||
|
{ "footer", "footer" },
|
||||||
|
{ "frame", "frame" },
|
||||||
|
{ "glasspane", "glass pane" },
|
||||||
|
{ "header", "header" },
|
||||||
|
{ "horizontal", "horizontal" },
|
||||||
|
{ "htmlcontainer", "HTML container" },
|
||||||
|
{ "iconified", "iconified" },
|
||||||
|
{ "indeterminate", "indeterminate" },
|
||||||
|
{ "internalframe", "internal frame" },
|
||||||
|
{ "label", "label" },
|
||||||
|
{ "labelFor", "label for" },
|
||||||
|
{ "labeledBy", "labeled by" },
|
||||||
|
{ "layeredpane", "layered pane" },
|
||||||
|
{ "list", "list" },
|
||||||
|
{ "listitem", "list item" },
|
||||||
|
{ "managesDescendants", "manages descendants" },
|
||||||
|
{ "memberOf", "member of" },
|
||||||
|
{ "menu", "menu" },
|
||||||
|
{ "menubar", "menu bar" },
|
||||||
|
{ "menuitem", "menu item" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "multiple line" },
|
||||||
|
{ "multiselectable", "multiselectable" },
|
||||||
|
{ "opaque", "opaque" },
|
||||||
|
{ "optionpane", "option pane" },
|
||||||
|
{ "pagetab", "page tab" },
|
||||||
|
{ "pagetablist", "page tab list" },
|
||||||
|
{ "panel", "panel" },
|
||||||
|
{ "paragraph", "paragraph" },
|
||||||
|
{ "parentWindowOf", "parent window of" },
|
||||||
|
{ "passwordtext", "password text" },
|
||||||
|
{ "popupmenu", "popup menu" },
|
||||||
|
{ "pressed", "pressed" },
|
||||||
|
{ "progressMonitor", "progress monitor" },
|
||||||
|
{ "progressbar", "progress bar" },
|
||||||
|
{ "pushbutton", "push button" },
|
||||||
|
{ "radiobutton", "radio button" },
|
||||||
|
{ "resizable", "resizable" },
|
||||||
|
{ "rootpane", "root pane" },
|
||||||
|
{ "rowheader", "row header" },
|
||||||
|
{ "ruler", "ruler" },
|
||||||
|
{ "scrollbar", "scroll bar" },
|
||||||
|
{ "scrollpane", "scroll pane" },
|
||||||
|
{ "selectable", "selectable" },
|
||||||
|
{ "selected", "selected" },
|
||||||
|
{ "separator", "separator" },
|
||||||
|
{ "showing", "showing" },
|
||||||
|
{ "singleline", "single line" },
|
||||||
|
{ "slider", "slider" },
|
||||||
|
{ "splitpane", "split pane" },
|
||||||
|
{ "subwindowOf", "subwindow of" },
|
||||||
|
{ "swingcomponent", "swing component" },
|
||||||
|
{ "table", "table" },
|
||||||
|
{ "text", "text" },
|
||||||
|
{ "togglebutton", "toggle button" },
|
||||||
|
{ "toggleexpand", "toggle expand" },
|
||||||
|
{ "toolbar", "tool bar" },
|
||||||
|
{ "tooltip", "tool tip" },
|
||||||
|
{ "transient", "transient" },
|
||||||
|
{ "tree", "tree" },
|
||||||
|
{ "truncated", "truncated" },
|
||||||
|
{ "unknown", "unknown" },
|
||||||
|
{ "vertical", "vertical" },
|
||||||
|
{ "viewport", "viewport" },
|
||||||
|
{ "visible", "visible" },
|
||||||
|
{ "window", "window" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_de extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "aktiv" },
|
||||||
|
{ "alert", "Alert" },
|
||||||
|
{ "armed", "aktiviert" },
|
||||||
|
{ "awtcomponent", "AWT-Komponente" },
|
||||||
|
{ "busy", "ausgelastet" },
|
||||||
|
{ "canvas", "Leinwand" },
|
||||||
|
{ "checkbox", "Kontrollk\u00E4stchen" },
|
||||||
|
{ "checked", "markiert" },
|
||||||
|
{ "childNodeOf", "untergeordneter Knoten von" },
|
||||||
|
{ "collapsed", "ausgeblendet" },
|
||||||
|
{ "colorchooser", "Farbauswahl" },
|
||||||
|
{ "columnheader", "Spaltenheader" },
|
||||||
|
{ "combobox", "Kombinationsfeld" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "Desktopsymbol" },
|
||||||
|
{ "desktoppane", "Desktopbereich" },
|
||||||
|
{ "dialog", "Dialogfeld" },
|
||||||
|
{ "directorypane", "Verzeichnisbereich" },
|
||||||
|
{ "editable", "bearbeitbar" },
|
||||||
|
{ "editbar", "Bearbeitungsleiste" },
|
||||||
|
{ "embeddedBy", "eingebettet in" },
|
||||||
|
{ "embeds", "bettet ein" },
|
||||||
|
{ "enabled", "aktiviert" },
|
||||||
|
{ "expandable", "erweiterbar" },
|
||||||
|
{ "expanded", "eingeblendet" },
|
||||||
|
{ "filechooser", "Dateiauswahl" },
|
||||||
|
{ "filler", "F\u00FCllbereich" },
|
||||||
|
{ "flowsFrom", "flie\u00DFt von" },
|
||||||
|
{ "flowsTo", "flie\u00DFt zu" },
|
||||||
|
{ "focusable", "fokussierbar" },
|
||||||
|
{ "focused", "fokussiert" },
|
||||||
|
{ "footer", "Footer" },
|
||||||
|
{ "frame", "Rahmen" },
|
||||||
|
{ "glasspane", "Glass Pane" },
|
||||||
|
{ "header", "Header" },
|
||||||
|
{ "horizontal", "horizontal" },
|
||||||
|
{ "htmlcontainer", "HTML-Container" },
|
||||||
|
{ "iconified", "minimiert" },
|
||||||
|
{ "indeterminate", "unbestimmt" },
|
||||||
|
{ "internalframe", "Innerer Rahmen" },
|
||||||
|
{ "label", "Label" },
|
||||||
|
{ "labelFor", "Label f\u00FCr" },
|
||||||
|
{ "labeledBy", "beschriftet von" },
|
||||||
|
{ "layeredpane", "Layered Pane" },
|
||||||
|
{ "list", "Liste" },
|
||||||
|
{ "listitem", "Listenelement" },
|
||||||
|
{ "managesDescendants", "verwaltet untergeordnete Objekte" },
|
||||||
|
{ "memberOf", "Mitglied von" },
|
||||||
|
{ "menu", "Men\u00FC" },
|
||||||
|
{ "menubar", "Men\u00FCleiste" },
|
||||||
|
{ "menuitem", "Men\u00FCpunkt" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "mehrzeilig" },
|
||||||
|
{ "multiselectable", "mehrfach ausw\u00E4hlbar" },
|
||||||
|
{ "opaque", "nicht transparent" },
|
||||||
|
{ "optionpane", "Optionsbereich" },
|
||||||
|
{ "pagetab", "Registerkarte" },
|
||||||
|
{ "pagetablist", "Registerkartenliste" },
|
||||||
|
{ "panel", "Bereich" },
|
||||||
|
{ "paragraph", "Absatz" },
|
||||||
|
{ "parentWindowOf", "\u00FCbergeordnetes Fenster von" },
|
||||||
|
{ "passwordtext", "Kennworttext" },
|
||||||
|
{ "popupmenu", "Popup-Men\u00FC" },
|
||||||
|
{ "pressed", "gedr\u00FCckt" },
|
||||||
|
{ "progressMonitor", "Fortschrittsmonitor" },
|
||||||
|
{ "progressbar", "Fortschrittsbalken" },
|
||||||
|
{ "pushbutton", "Schaltfl\u00E4che" },
|
||||||
|
{ "radiobutton", "Optionsfeld" },
|
||||||
|
{ "resizable", "skalierbar" },
|
||||||
|
{ "rootpane", "Root-Bereich" },
|
||||||
|
{ "rowheader", "Zeilenheader" },
|
||||||
|
{ "ruler", "Lineal" },
|
||||||
|
{ "scrollbar", "Bildlaufleiste" },
|
||||||
|
{ "scrollpane", "Bildlaufbereich" },
|
||||||
|
{ "selectable", "w\u00E4hlbar" },
|
||||||
|
{ "selected", "ausgew\u00E4hlt" },
|
||||||
|
{ "separator", "Trennzeichen" },
|
||||||
|
{ "showing", "angezeigt" },
|
||||||
|
{ "singleline", "einzeilig" },
|
||||||
|
{ "slider", "Schieberegler" },
|
||||||
|
{ "splitpane", "Split Pane" },
|
||||||
|
{ "subwindowOf", "Unterfenster von" },
|
||||||
|
{ "swingcomponent", "Swing-Komponente" },
|
||||||
|
{ "table", "Tabelle" },
|
||||||
|
{ "text", "Text" },
|
||||||
|
{ "togglebutton", "Umschaltfl\u00E4che" },
|
||||||
|
{ "toggleexpand", "einblenden umschalten" },
|
||||||
|
{ "toolbar", "Symbolleiste" },
|
||||||
|
{ "tooltip", "QuickInfo" },
|
||||||
|
{ "transient", "transient" },
|
||||||
|
{ "tree", "Baumstruktur" },
|
||||||
|
{ "truncated", "abgeschnitten" },
|
||||||
|
{ "unknown", "Unbekannt" },
|
||||||
|
{ "vertical", "vertikal" },
|
||||||
|
{ "viewport", "Viewport" },
|
||||||
|
{ "visible", "sichtbar" },
|
||||||
|
{ "window", "Fenster" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_en extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "active" },
|
||||||
|
{ "alert", "alert" },
|
||||||
|
{ "armed", "armed" },
|
||||||
|
{ "awtcomponent", "AWT component" },
|
||||||
|
{ "busy", "busy" },
|
||||||
|
{ "canvas", "canvas" },
|
||||||
|
{ "checkbox", "check box" },
|
||||||
|
{ "checked", "checked" },
|
||||||
|
{ "childNodeOf", "child node of" },
|
||||||
|
{ "collapsed", "collapsed" },
|
||||||
|
{ "colorchooser", "color chooser" },
|
||||||
|
{ "columnheader", "column header" },
|
||||||
|
{ "combobox", "combo box" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "desktop icon" },
|
||||||
|
{ "desktoppane", "desktop pane" },
|
||||||
|
{ "dialog", "dialog" },
|
||||||
|
{ "directorypane", "directory pane" },
|
||||||
|
{ "editable", "editable" },
|
||||||
|
{ "editbar", "editbar" },
|
||||||
|
{ "embeddedBy", "embedded by" },
|
||||||
|
{ "embeds", "embeds" },
|
||||||
|
{ "enabled", "enabled" },
|
||||||
|
{ "expandable", "expandable" },
|
||||||
|
{ "expanded", "expanded" },
|
||||||
|
{ "filechooser", "file chooser" },
|
||||||
|
{ "filler", "filler" },
|
||||||
|
{ "flowsFrom", "flows from" },
|
||||||
|
{ "flowsTo", "flows to" },
|
||||||
|
{ "focusable", "focusable" },
|
||||||
|
{ "focused", "focused" },
|
||||||
|
{ "footer", "footer" },
|
||||||
|
{ "frame", "frame" },
|
||||||
|
{ "glasspane", "glass pane" },
|
||||||
|
{ "header", "header" },
|
||||||
|
{ "horizontal", "horizontal" },
|
||||||
|
{ "htmlcontainer", "HTML container" },
|
||||||
|
{ "iconified", "iconified" },
|
||||||
|
{ "indeterminate", "indeterminate" },
|
||||||
|
{ "internalframe", "internal frame" },
|
||||||
|
{ "label", "label" },
|
||||||
|
{ "labelFor", "label for" },
|
||||||
|
{ "labeledBy", "labeled by" },
|
||||||
|
{ "layeredpane", "layered pane" },
|
||||||
|
{ "list", "list" },
|
||||||
|
{ "listitem", "list item" },
|
||||||
|
{ "managesDescendants", "manages descendants" },
|
||||||
|
{ "memberOf", "member of" },
|
||||||
|
{ "menu", "menu" },
|
||||||
|
{ "menubar", "menu bar" },
|
||||||
|
{ "menuitem", "menu item" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "multiple line" },
|
||||||
|
{ "multiselectable", "multiselectable" },
|
||||||
|
{ "opaque", "opaque" },
|
||||||
|
{ "optionpane", "option pane" },
|
||||||
|
{ "pagetab", "page tab" },
|
||||||
|
{ "pagetablist", "page tab list" },
|
||||||
|
{ "panel", "panel" },
|
||||||
|
{ "paragraph", "paragraph" },
|
||||||
|
{ "parentWindowOf", "parent window of" },
|
||||||
|
{ "passwordtext", "password text" },
|
||||||
|
{ "popupmenu", "popup menu" },
|
||||||
|
{ "pressed", "pressed" },
|
||||||
|
{ "progressMonitor", "progress monitor" },
|
||||||
|
{ "progressbar", "progress bar" },
|
||||||
|
{ "pushbutton", "push button" },
|
||||||
|
{ "radiobutton", "radio button" },
|
||||||
|
{ "resizable", "resizable" },
|
||||||
|
{ "rootpane", "root pane" },
|
||||||
|
{ "rowheader", "row header" },
|
||||||
|
{ "ruler", "ruler" },
|
||||||
|
{ "scrollbar", "scroll bar" },
|
||||||
|
{ "scrollpane", "scroll pane" },
|
||||||
|
{ "selectable", "selectable" },
|
||||||
|
{ "selected", "selected" },
|
||||||
|
{ "separator", "separator" },
|
||||||
|
{ "showing", "showing" },
|
||||||
|
{ "singleline", "single line" },
|
||||||
|
{ "slider", "slider" },
|
||||||
|
{ "splitpane", "split pane" },
|
||||||
|
{ "subwindowOf", "subwindow of" },
|
||||||
|
{ "swingcomponent", "swing component" },
|
||||||
|
{ "table", "table" },
|
||||||
|
{ "text", "text" },
|
||||||
|
{ "togglebutton", "toggle button" },
|
||||||
|
{ "toolbar", "tool bar" },
|
||||||
|
{ "tooltip", "tool tip" },
|
||||||
|
{ "transient", "transient" },
|
||||||
|
{ "tree", "tree" },
|
||||||
|
{ "truncated", "truncated" },
|
||||||
|
{ "unknown", "unknown" },
|
||||||
|
{ "vertical", "vertical" },
|
||||||
|
{ "viewport", "viewport" },
|
||||||
|
{ "visible", "visible" },
|
||||||
|
{ "window", "window" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_es extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "activo" },
|
||||||
|
{ "alert", "alerta" },
|
||||||
|
{ "armed", "armado" },
|
||||||
|
{ "awtcomponent", "componente AWT" },
|
||||||
|
{ "busy", "ocupado" },
|
||||||
|
{ "canvas", "lienzo" },
|
||||||
|
{ "checkbox", "casilla de control" },
|
||||||
|
{ "checked", "activado" },
|
||||||
|
{ "childNodeOf", "nodo secundario de" },
|
||||||
|
{ "collapsed", "reducido" },
|
||||||
|
{ "colorchooser", "selector de color" },
|
||||||
|
{ "columnheader", "cabecera de columna" },
|
||||||
|
{ "combobox", "cuadro combinado" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "icono de escritorio" },
|
||||||
|
{ "desktoppane", "panel de escritorio" },
|
||||||
|
{ "dialog", "cuadro de di\u00E1logo" },
|
||||||
|
{ "directorypane", "panel de directorio" },
|
||||||
|
{ "editable", "editable" },
|
||||||
|
{ "editbar", "barra de edici\u00F3n" },
|
||||||
|
{ "embeddedBy", "embebido por" },
|
||||||
|
{ "embeds", "embebe" },
|
||||||
|
{ "enabled", "activado" },
|
||||||
|
{ "expandable", "ampliable" },
|
||||||
|
{ "expanded", "ampliado" },
|
||||||
|
{ "filechooser", "selector de archivos" },
|
||||||
|
{ "filler", "rellenador" },
|
||||||
|
{ "flowsFrom", "procede de" },
|
||||||
|
{ "flowsTo", "llega a" },
|
||||||
|
{ "focusable", "enfocable" },
|
||||||
|
{ "focused", "enfocado" },
|
||||||
|
{ "footer", "pie" },
|
||||||
|
{ "frame", "marco" },
|
||||||
|
{ "glasspane", "panel de cristal" },
|
||||||
|
{ "header", "cabecera" },
|
||||||
|
{ "horizontal", "horizontal" },
|
||||||
|
{ "htmlcontainer", "Contenedor HTML" },
|
||||||
|
{ "iconified", "convertido en icono" },
|
||||||
|
{ "indeterminate", "indeterminada" },
|
||||||
|
{ "internalframe", "marco interno" },
|
||||||
|
{ "label", "etiqueta" },
|
||||||
|
{ "labelFor", "etiqueta para" },
|
||||||
|
{ "labeledBy", "etiquetado por" },
|
||||||
|
{ "layeredpane", "panel en capas" },
|
||||||
|
{ "list", "lista" },
|
||||||
|
{ "listitem", "elemento de lista" },
|
||||||
|
{ "managesDescendants", "gestiona descendientes" },
|
||||||
|
{ "memberOf", "miembro de" },
|
||||||
|
{ "menu", "men\u00FA" },
|
||||||
|
{ "menubar", "barra de men\u00FAs" },
|
||||||
|
{ "menuitem", "elemento de men\u00FA" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "l\u00EDnea m\u00FAltiple" },
|
||||||
|
{ "multiselectable", "multiseleccionable" },
|
||||||
|
{ "opaque", "opaco" },
|
||||||
|
{ "optionpane", "panel de opciones" },
|
||||||
|
{ "pagetab", "separador de p\u00E1gina" },
|
||||||
|
{ "pagetablist", "lista de separadores de p\u00E1gina" },
|
||||||
|
{ "panel", "panel" },
|
||||||
|
{ "paragraph", "p\u00E1rrafo" },
|
||||||
|
{ "parentWindowOf", "ventana principal de" },
|
||||||
|
{ "passwordtext", "texto de contrase\u00F1a" },
|
||||||
|
{ "popupmenu", "men\u00FA emergente" },
|
||||||
|
{ "pressed", "pulsado" },
|
||||||
|
{ "progressMonitor", "monitor de progreso" },
|
||||||
|
{ "progressbar", "barra de progreso" },
|
||||||
|
{ "pushbutton", "bot\u00F3n" },
|
||||||
|
{ "radiobutton", "bot\u00F3n de radio" },
|
||||||
|
{ "resizable", "redimensionable" },
|
||||||
|
{ "rootpane", "panel ra\u00EDz" },
|
||||||
|
{ "rowheader", "cabecera de filas" },
|
||||||
|
{ "ruler", "regla" },
|
||||||
|
{ "scrollbar", "barra de desplazamiento" },
|
||||||
|
{ "scrollpane", "panel de desplazamiento" },
|
||||||
|
{ "selectable", "seleccionable" },
|
||||||
|
{ "selected", "seleccionado" },
|
||||||
|
{ "separator", "separador" },
|
||||||
|
{ "showing", "mostrando" },
|
||||||
|
{ "singleline", "l\u00EDnea \u00FAnica" },
|
||||||
|
{ "slider", "deslizador" },
|
||||||
|
{ "splitpane", "panel de divisi\u00F3n" },
|
||||||
|
{ "subwindowOf", "ventana subordinada de" },
|
||||||
|
{ "swingcomponent", "componente swing" },
|
||||||
|
{ "table", "tabla" },
|
||||||
|
{ "text", "texto" },
|
||||||
|
{ "togglebutton", "bot\u00F3n conmutador" },
|
||||||
|
{ "toggleexpand", "conmutar ampliaci\u00F3n" },
|
||||||
|
{ "toolbar", "barra de herramientas" },
|
||||||
|
{ "tooltip", "ayuda de burbuja" },
|
||||||
|
{ "transient", "transitorio" },
|
||||||
|
{ "tree", "\u00E1rbol" },
|
||||||
|
{ "truncated", "truncado" },
|
||||||
|
{ "unknown", "desconocido" },
|
||||||
|
{ "vertical", "vertical" },
|
||||||
|
{ "viewport", "viewport" },
|
||||||
|
{ "visible", "visible" },
|
||||||
|
{ "window", "ventana" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_fr extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "actif" },
|
||||||
|
{ "alert", "alerte" },
|
||||||
|
{ "armed", "arm\u00E9" },
|
||||||
|
{ "awtcomponent", "composant AWT" },
|
||||||
|
{ "busy", "occup\u00E9" },
|
||||||
|
{ "canvas", "canevas" },
|
||||||
|
{ "checkbox", "case \u00E0 cocher" },
|
||||||
|
{ "checked", "coch\u00E9" },
|
||||||
|
{ "childNodeOf", "noeud enfant de" },
|
||||||
|
{ "collapsed", "r\u00E9duit" },
|
||||||
|
{ "colorchooser", "s\u00E9lecteur de couleurs" },
|
||||||
|
{ "columnheader", "en-t\u00EAte de colonne" },
|
||||||
|
{ "combobox", "liste d\u00E9roulante" },
|
||||||
|
{ "controlledBy", "contr\u00F4l\u00E9 par" },
|
||||||
|
{ "controllerFor", "contr\u00F4leur pour" },
|
||||||
|
{ "desktopicon", "ic\u00F4ne de bureau" },
|
||||||
|
{ "desktoppane", "panneau de bureau" },
|
||||||
|
{ "dialog", "bo\u00EEte de dialogue" },
|
||||||
|
{ "directorypane", "panneau de r\u00E9pertoires" },
|
||||||
|
{ "editable", "modifiable" },
|
||||||
|
{ "editbar", "barre d'\u00E9dition" },
|
||||||
|
{ "embeddedBy", "incorpor\u00E9 par" },
|
||||||
|
{ "embeds", "incorpore" },
|
||||||
|
{ "enabled", "activ\u00E9" },
|
||||||
|
{ "expandable", "extensible" },
|
||||||
|
{ "expanded", "d\u00E9velopp\u00E9" },
|
||||||
|
{ "filechooser", "s\u00E9lecteur de fichiers" },
|
||||||
|
{ "filler", "\u00E9l\u00E9ment de remplissage" },
|
||||||
|
{ "flowsFrom", "flux depuis" },
|
||||||
|
{ "flowsTo", "flux vers" },
|
||||||
|
{ "focusable", "zone d'entr\u00E9e possible" },
|
||||||
|
{ "focused", "avec zone d'entr\u00E9e" },
|
||||||
|
{ "footer", "pied de page" },
|
||||||
|
{ "frame", "cadre" },
|
||||||
|
{ "glasspane", "panneau de grossissement" },
|
||||||
|
{ "header", "en-t\u00EAte" },
|
||||||
|
{ "horizontal", "horizontal" },
|
||||||
|
{ "htmlcontainer", "conteneur HTML" },
|
||||||
|
{ "iconified", "r\u00E9duit \u00E0 une ic\u00F4ne" },
|
||||||
|
{ "indeterminate", "ind\u00E9termin\u00E9" },
|
||||||
|
{ "internalframe", "cadre interne" },
|
||||||
|
{ "label", "libell\u00E9" },
|
||||||
|
{ "labelFor", "libell\u00E9 de" },
|
||||||
|
{ "labeledBy", "libell\u00E9 par" },
|
||||||
|
{ "layeredpane", "panneau superpos\u00E9" },
|
||||||
|
{ "list", "liste" },
|
||||||
|
{ "listitem", "\u00E9l\u00E9ment de liste" },
|
||||||
|
{ "managesDescendants", "g\u00E8re les descendants" },
|
||||||
|
{ "memberOf", "membre de" },
|
||||||
|
{ "menu", "menu" },
|
||||||
|
{ "menubar", "barre de menus" },
|
||||||
|
{ "menuitem", "option de menu" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "ligne multiple" },
|
||||||
|
{ "multiselectable", "multis\u00E9lectionnable" },
|
||||||
|
{ "opaque", "opaque" },
|
||||||
|
{ "optionpane", "panneau d'options" },
|
||||||
|
{ "pagetab", "onglet de page" },
|
||||||
|
{ "pagetablist", "liste d'onglets de page" },
|
||||||
|
{ "panel", "panneau" },
|
||||||
|
{ "paragraph", "paragraphe" },
|
||||||
|
{ "parentWindowOf", "fen\u00EAtre parente de" },
|
||||||
|
{ "passwordtext", "texte de mot de passe" },
|
||||||
|
{ "popupmenu", "menu contextuel" },
|
||||||
|
{ "pressed", "enfonc\u00E9" },
|
||||||
|
{ "progressMonitor", "contr\u00F4le de la progression" },
|
||||||
|
{ "progressbar", "barre de progression" },
|
||||||
|
{ "pushbutton", "bouton" },
|
||||||
|
{ "radiobutton", "bouton radio" },
|
||||||
|
{ "resizable", "redimensionnable" },
|
||||||
|
{ "rootpane", "panneau racine" },
|
||||||
|
{ "rowheader", "en-t\u00EAte de ligne" },
|
||||||
|
{ "ruler", "r\u00E8gle" },
|
||||||
|
{ "scrollbar", "barre de d\u00E9filement" },
|
||||||
|
{ "scrollpane", "panneau de d\u00E9filement" },
|
||||||
|
{ "selectable", "s\u00E9lectionnable" },
|
||||||
|
{ "selected", "s\u00E9lectionn\u00E9" },
|
||||||
|
{ "separator", "s\u00E9parateur" },
|
||||||
|
{ "showing", "montrant" },
|
||||||
|
{ "singleline", "ligne unique" },
|
||||||
|
{ "slider", "curseur" },
|
||||||
|
{ "splitpane", "panneau divis\u00E9" },
|
||||||
|
{ "subwindowOf", "sous-fen\u00EAtre de" },
|
||||||
|
{ "swingcomponent", "composant Swing" },
|
||||||
|
{ "table", "tableau" },
|
||||||
|
{ "text", "texte" },
|
||||||
|
{ "togglebutton", "bouton de basculement" },
|
||||||
|
{ "toggleexpand", "activer/d\u00E9sactiver d\u00E9veloppement" },
|
||||||
|
{ "toolbar", "barre d'outils" },
|
||||||
|
{ "tooltip", "info-bulle" },
|
||||||
|
{ "transient", "non persistant" },
|
||||||
|
{ "tree", "arborescence" },
|
||||||
|
{ "truncated", "tronqu\u00E9" },
|
||||||
|
{ "unknown", "inconnu" },
|
||||||
|
{ "vertical", "vertical" },
|
||||||
|
{ "viewport", "lucarne" },
|
||||||
|
{ "visible", "visible" },
|
||||||
|
{ "window", "fen\u00EAtre" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_it extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "attivo" },
|
||||||
|
{ "alert", "avviso" },
|
||||||
|
{ "armed", "abilitato" },
|
||||||
|
{ "awtcomponent", "componente AWT" },
|
||||||
|
{ "busy", "occupato" },
|
||||||
|
{ "canvas", "sfondo" },
|
||||||
|
{ "checkbox", "casella di controllo" },
|
||||||
|
{ "checked", "verificato" },
|
||||||
|
{ "childNodeOf", "nodo figlio di" },
|
||||||
|
{ "collapsed", "compresso" },
|
||||||
|
{ "colorchooser", "selezione colori" },
|
||||||
|
{ "columnheader", "intestazione colonna" },
|
||||||
|
{ "combobox", "casella combinata" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "icona desktop" },
|
||||||
|
{ "desktoppane", "riquadro desktop" },
|
||||||
|
{ "dialog", "finestra di dialogo" },
|
||||||
|
{ "directorypane", "riquadro directory" },
|
||||||
|
{ "editable", "modificabile" },
|
||||||
|
{ "editbar", "barra di modifica" },
|
||||||
|
{ "embeddedBy", "incorporato da" },
|
||||||
|
{ "embeds", "incorpora" },
|
||||||
|
{ "enabled", "abilitato" },
|
||||||
|
{ "expandable", "espandibile" },
|
||||||
|
{ "expanded", "espanso" },
|
||||||
|
{ "filechooser", "selezione file" },
|
||||||
|
{ "filler", "utilit\u00E0 riempimento" },
|
||||||
|
{ "flowsFrom", "proviene da" },
|
||||||
|
{ "flowsTo", "va verso" },
|
||||||
|
{ "focusable", "attivabile in primo piano" },
|
||||||
|
{ "focused", "in primo piano" },
|
||||||
|
{ "footer", "pi\u00E8 di pagina" },
|
||||||
|
{ "frame", "cornice" },
|
||||||
|
{ "glasspane", "riquadro trasparente" },
|
||||||
|
{ "header", "intestazione" },
|
||||||
|
{ "horizontal", "orizzontale" },
|
||||||
|
{ "htmlcontainer", "Contenitore HTML" },
|
||||||
|
{ "iconified", "ridotto a icona" },
|
||||||
|
{ "indeterminate", "indeterminato" },
|
||||||
|
{ "internalframe", "cornice interna" },
|
||||||
|
{ "label", "etichetta" },
|
||||||
|
{ "labelFor", "etichetta per" },
|
||||||
|
{ "labeledBy", "etichetta di" },
|
||||||
|
{ "layeredpane", "riquadro a livelli" },
|
||||||
|
{ "list", "lista" },
|
||||||
|
{ "listitem", "voce lista" },
|
||||||
|
{ "managesDescendants", "gestisce i discendenti" },
|
||||||
|
{ "memberOf", "membro di" },
|
||||||
|
{ "menu", "menu" },
|
||||||
|
{ "menubar", "barra dei menu" },
|
||||||
|
{ "menuitem", "voce di menu" },
|
||||||
|
{ "modal", "modale" },
|
||||||
|
{ "multiline", "a righe multiple" },
|
||||||
|
{ "multiselectable", "multi-selezionabile" },
|
||||||
|
{ "opaque", "nascosto" },
|
||||||
|
{ "optionpane", "riquadro opzioni" },
|
||||||
|
{ "pagetab", "scheda pagina" },
|
||||||
|
{ "pagetablist", "lista schede pagina" },
|
||||||
|
{ "panel", "pannello" },
|
||||||
|
{ "paragraph", "paragrafo" },
|
||||||
|
{ "parentWindowOf", "finestra di livello superiore di" },
|
||||||
|
{ "passwordtext", "testo della password" },
|
||||||
|
{ "popupmenu", "menu popup" },
|
||||||
|
{ "pressed", "premuto" },
|
||||||
|
{ "progressMonitor", "stato avanzamento" },
|
||||||
|
{ "progressbar", "barra di avanzamento" },
|
||||||
|
{ "pushbutton", "pulsante" },
|
||||||
|
{ "radiobutton", "pulsante di scelta" },
|
||||||
|
{ "resizable", "ridimensionabile" },
|
||||||
|
{ "rootpane", "riquadro root" },
|
||||||
|
{ "rowheader", "intestazione di riga" },
|
||||||
|
{ "ruler", "righello" },
|
||||||
|
{ "scrollbar", "barra di scorrimento" },
|
||||||
|
{ "scrollpane", "riquadro scorrimento" },
|
||||||
|
{ "selectable", "selezionabile" },
|
||||||
|
{ "selected", "selezionato" },
|
||||||
|
{ "separator", "separatore" },
|
||||||
|
{ "showing", "visualizzato" },
|
||||||
|
{ "singleline", "a riga singola" },
|
||||||
|
{ "slider", "dispositivo di scorrimento" },
|
||||||
|
{ "splitpane", "riquadro doppio" },
|
||||||
|
{ "subwindowOf", "sottofinestra di" },
|
||||||
|
{ "swingcomponent", "componente swing" },
|
||||||
|
{ "table", "tabella" },
|
||||||
|
{ "text", "testo" },
|
||||||
|
{ "togglebutton", "interruttore" },
|
||||||
|
{ "toggleexpand", "attiva/disattiva espansione" },
|
||||||
|
{ "toolbar", "barra degli strumenti" },
|
||||||
|
{ "tooltip", "descrizione comandi" },
|
||||||
|
{ "transient", "transitorio" },
|
||||||
|
{ "tree", "albero" },
|
||||||
|
{ "truncated", "troncato" },
|
||||||
|
{ "unknown", "sconosciuto" },
|
||||||
|
{ "vertical", "verticale" },
|
||||||
|
{ "viewport", "viewport" },
|
||||||
|
{ "visible", "visibile" },
|
||||||
|
{ "window", "finestra" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_ja extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "\u30A2\u30AF\u30C6\u30A3\u30D6" },
|
||||||
|
{ "alert", "\u30A2\u30E9\u30FC\u30C8" },
|
||||||
|
{ "armed", "\u4F5C\u52D5\u6E96\u5099\u5B8C\u4E86" },
|
||||||
|
{ "awtcomponent", "AWT\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8" },
|
||||||
|
{ "busy", "\u30D3\u30B8\u30FC" },
|
||||||
|
{ "canvas", "\u30AD\u30E3\u30F3\u30D0\u30B9" },
|
||||||
|
{ "checkbox", "\u30C1\u30A7\u30C3\u30AF\u30FB\u30DC\u30C3\u30AF\u30B9" },
|
||||||
|
{ "checked", "\u30C1\u30A7\u30C3\u30AF" },
|
||||||
|
{ "childNodeOf", "child node of" },
|
||||||
|
{ "collapsed", "\u77ED\u7E2E" },
|
||||||
|
{ "colorchooser", "\u30AB\u30E9\u30FC\u30FB\u30C1\u30E5\u30FC\u30B6" },
|
||||||
|
{ "columnheader", "\u5217\u30D8\u30C3\u30C0\u30FC" },
|
||||||
|
{ "combobox", "\u30B3\u30F3\u30DC\u30FB\u30DC\u30C3\u30AF\u30B9" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30A2\u30A4\u30B3\u30F3" },
|
||||||
|
{ "desktoppane", "\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u533A\u753B" },
|
||||||
|
{ "dialog", "\u30C0\u30A4\u30A2\u30ED\u30B0" },
|
||||||
|
{ "directorypane", "\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u533A\u753B" },
|
||||||
|
{ "editable", "\u7DE8\u96C6\u53EF\u80FD" },
|
||||||
|
{ "editbar", "\u7DE8\u96C6\u30D0\u30FC" },
|
||||||
|
{ "embeddedBy", "embedded by" },
|
||||||
|
{ "embeds", "\u57CB\u8FBC\u307F" },
|
||||||
|
{ "enabled", "\u6709\u52B9" },
|
||||||
|
{ "expandable", "\u5C55\u958B\u53EF\u80FD" },
|
||||||
|
{ "expanded", "\u5C55\u958B" },
|
||||||
|
{ "filechooser", "\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6" },
|
||||||
|
{ "filler", "\u30D5\u30A3\u30E9\u30FC" },
|
||||||
|
{ "flowsFrom", "flows from" },
|
||||||
|
{ "flowsTo", "flows to" },
|
||||||
|
{ "focusable", "\u30D5\u30A9\u30FC\u30AB\u30B9\u53EF\u80FD" },
|
||||||
|
{ "focused", "\u30D5\u30A9\u30FC\u30AB\u30B9" },
|
||||||
|
{ "footer", "\u30D5\u30C3\u30BF\u30FC" },
|
||||||
|
{ "frame", "\u30D5\u30EC\u30FC\u30E0" },
|
||||||
|
{ "glasspane", "\u30AC\u30E9\u30B9\u533A\u753B" },
|
||||||
|
{ "header", "\u30D8\u30C3\u30C0\u30FC" },
|
||||||
|
{ "horizontal", "\u6C34\u5E73" },
|
||||||
|
{ "htmlcontainer", "HTML\u30B3\u30F3\u30C6\u30CA" },
|
||||||
|
{ "iconified", "\u30A2\u30A4\u30B3\u30F3\u5316" },
|
||||||
|
{ "indeterminate", "\u4E0D\u78BA\u5B9A" },
|
||||||
|
{ "internalframe", "\u5185\u90E8\u30D5\u30EC\u30FC\u30E0" },
|
||||||
|
{ "label", "\u30E9\u30D9\u30EB" },
|
||||||
|
{ "labelFor", "label for" },
|
||||||
|
{ "labeledBy", "labeled by" },
|
||||||
|
{ "layeredpane", "\u968E\u5C64\u5316\u3055\u308C\u305F\u533A\u753B" },
|
||||||
|
{ "list", "\u30EA\u30B9\u30C8" },
|
||||||
|
{ "listitem", "\u30EA\u30B9\u30C8\u9805\u76EE" },
|
||||||
|
{ "managesDescendants", "\u5B50\u5B6B\u3092\u7BA1\u7406" },
|
||||||
|
{ "memberOf", "member of" },
|
||||||
|
{ "menu", "\u30E1\u30CB\u30E5\u30FC" },
|
||||||
|
{ "menubar", "\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC" },
|
||||||
|
{ "menuitem", "\u30E1\u30CB\u30E5\u30FC\u9805\u76EE" },
|
||||||
|
{ "modal", "\u30E2\u30FC\u30C0\u30EB" },
|
||||||
|
{ "multiline", "\u8907\u6570\u884C" },
|
||||||
|
{ "multiselectable", "\u8907\u6570\u9078\u629E\u53EF\u80FD" },
|
||||||
|
{ "opaque", "\u4E0D\u900F\u660E" },
|
||||||
|
{ "optionpane", "\u30AA\u30D7\u30B7\u30E7\u30F3\u533A\u753B" },
|
||||||
|
{ "pagetab", "\u30DA\u30FC\u30B8\u30FB\u30BF\u30D6" },
|
||||||
|
{ "pagetablist", "\u30DA\u30FC\u30B8\u30FB\u30BF\u30D6\u30FB\u30EA\u30B9\u30C8" },
|
||||||
|
{ "panel", "\u30D1\u30CD\u30EB" },
|
||||||
|
{ "paragraph", "\u6BB5\u843D" },
|
||||||
|
{ "parentWindowOf", "parent window of" },
|
||||||
|
{ "passwordtext", "\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30C6\u30AD\u30B9\u30C8" },
|
||||||
|
{ "popupmenu", "\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7\u30FB\u30E1\u30CB\u30E5\u30FC" },
|
||||||
|
{ "pressed", "\u62BC\u4E0B" },
|
||||||
|
{ "progressMonitor", "\u9032\u6357\u30E2\u30CB\u30BF\u30FC" },
|
||||||
|
{ "progressbar", "\u9032\u6357\u30D0\u30FC" },
|
||||||
|
{ "pushbutton", "\u30D7\u30C3\u30B7\u30E5\u30FB\u30DC\u30BF\u30F3" },
|
||||||
|
{ "radiobutton", "\u30E9\u30B8\u30AA\u30FB\u30DC\u30BF\u30F3" },
|
||||||
|
{ "resizable", "\u30B5\u30A4\u30BA\u5909\u66F4\u53EF\u80FD" },
|
||||||
|
{ "rootpane", "\u30EB\u30FC\u30C8\u533A\u753B" },
|
||||||
|
{ "rowheader", "\u884C\u30D8\u30C3\u30C0\u30FC" },
|
||||||
|
{ "ruler", "\u30EB\u30FC\u30E9\u30FC" },
|
||||||
|
{ "scrollbar", "\u30B9\u30AF\u30ED\u30FC\u30EB\u30FB\u30D0\u30FC" },
|
||||||
|
{ "scrollpane", "\u30B9\u30AF\u30ED\u30FC\u30EB\u533A\u753B" },
|
||||||
|
{ "selectable", "\u9078\u629E\u53EF\u80FD" },
|
||||||
|
{ "selected", "\u9078\u629E" },
|
||||||
|
{ "separator", "\u30BB\u30D1\u30EC\u30FC\u30BF" },
|
||||||
|
{ "showing", "\u8868\u793A" },
|
||||||
|
{ "singleline", "\u5358\u4E00\u884C" },
|
||||||
|
{ "slider", "\u30B9\u30E9\u30A4\u30C0" },
|
||||||
|
{ "splitpane", "\u5206\u5272\u533A\u753B" },
|
||||||
|
{ "subwindowOf", "subwindow of" },
|
||||||
|
{ "swingcomponent", "Swing\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8" },
|
||||||
|
{ "table", "\u8868" },
|
||||||
|
{ "text", "\u30C6\u30AD\u30B9\u30C8" },
|
||||||
|
{ "togglebutton", "\u30C8\u30B0\u30EB\u30FB\u30DC\u30BF\u30F3" },
|
||||||
|
{ "toggleexpand", "\u5C55\u958B\u306E\u30C8\u30B0\u30EB" },
|
||||||
|
{ "toolbar", "\u30C4\u30FC\u30EB\u30D0\u30FC" },
|
||||||
|
{ "tooltip", "\u30C4\u30FC\u30EB\u30C1\u30C3\u30D7" },
|
||||||
|
{ "transient", "\u4E00\u6642" },
|
||||||
|
{ "tree", "\u30C4\u30EA\u30FC" },
|
||||||
|
{ "truncated", "\u4E0D\u5B8C\u5168" },
|
||||||
|
{ "unknown", "\u4E0D\u660E" },
|
||||||
|
{ "vertical", "\u5782\u76F4" },
|
||||||
|
{ "viewport", "\u30D3\u30E5\u30FC\u30DD\u30FC\u30C8" },
|
||||||
|
{ "visible", "\u53EF\u8996" },
|
||||||
|
{ "window", "\u30A6\u30A3\u30F3\u30C9\u30A6" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_ko extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "\uD65C\uC131" },
|
||||||
|
{ "alert", "\uACBD\uBCF4" },
|
||||||
|
{ "armed", "\uD06C\uAE30" },
|
||||||
|
{ "awtcomponent", "AWT \uAD6C\uC131\uC694\uC18C" },
|
||||||
|
{ "busy", "\uC0AC\uC6A9 \uC911" },
|
||||||
|
{ "canvas", "\uCE94\uBC84\uC2A4" },
|
||||||
|
{ "checkbox", "\uCCB4\uD06C\uBC15\uC2A4" },
|
||||||
|
{ "checked", "\uC120\uD0DD\uB428" },
|
||||||
|
{ "childNodeOf", "\uD558\uC704 \uB178\uB4DC" },
|
||||||
|
{ "collapsed", "\uCD95\uC18C\uB428" },
|
||||||
|
{ "colorchooser", "\uC0C9\uC0C1 \uC120\uD0DD\uAE30" },
|
||||||
|
{ "columnheader", "\uC5F4 \uBA38\uB9AC\uAE00" },
|
||||||
|
{ "combobox", "\uCF64\uBCF4 \uC0C1\uC790" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "\uBC14\uD0D5\uD654\uBA74 \uC544\uC774\uCF58" },
|
||||||
|
{ "desktoppane", "\uBC14\uD0D5\uD654\uBA74 \uCC3D" },
|
||||||
|
{ "dialog", "\uB300\uD654\uC0C1\uC790" },
|
||||||
|
{ "directorypane", "\uB514\uB809\uD1A0\uB9AC \uCC3D" },
|
||||||
|
{ "editable", "\uD3B8\uC9D1 \uAC00\uB2A5" },
|
||||||
|
{ "editbar", "\uD3B8\uC9D1 \uB3C4\uAD6C" },
|
||||||
|
{ "embeddedBy", "\uD3EC\uD568 \uC8FC\uCCB4" },
|
||||||
|
{ "embeds", "\uD3EC\uD568" },
|
||||||
|
{ "enabled", "\uC0AC\uC6A9" },
|
||||||
|
{ "expandable", "\uD655\uC7A5 \uAC00\uB2A5" },
|
||||||
|
{ "expanded", "\uD655\uC7A5\uB428" },
|
||||||
|
{ "filechooser", "\uD30C\uC77C \uC120\uD0DD\uAE30" },
|
||||||
|
{ "filler", "\uD544\uB7EC" },
|
||||||
|
{ "flowsFrom", "\uD750\uB984 \uCD9C\uCC98" },
|
||||||
|
{ "flowsTo", "\uD750\uB984 \uB300\uC0C1" },
|
||||||
|
{ "focusable", "\uD3EC\uCEE4\uC2A4 \uAC00\uB2A5" },
|
||||||
|
{ "focused", "\uD3EC\uCEE4\uC2A4\uB428" },
|
||||||
|
{ "footer", "\uBC14\uB2E5\uAE00" },
|
||||||
|
{ "frame", "\uD504\uB808\uC784" },
|
||||||
|
{ "glasspane", "\uAE00\uB798\uC2A4 \uCC3D" },
|
||||||
|
{ "header", "\uBA38\uB9AC\uAE00" },
|
||||||
|
{ "horizontal", "\uAC00\uB85C" },
|
||||||
|
{ "htmlcontainer", "HTML \uCEE8\uD14C\uC774\uB108" },
|
||||||
|
{ "iconified", "\uC544\uC774\uCF58\uD654\uB428" },
|
||||||
|
{ "indeterminate", "\uD655\uC815\uB418\uC9C0 \uC54A\uC74C" },
|
||||||
|
{ "internalframe", "\uB0B4\uBD80 \uD504\uB808\uC784" },
|
||||||
|
{ "label", "\uB808\uC774\uBE14" },
|
||||||
|
{ "labelFor", "\uB808\uC774\uBE14 \uB300\uC0C1" },
|
||||||
|
{ "labeledBy", "\uB808\uC774\uBE14 \uC9C0\uC815\uC790" },
|
||||||
|
{ "layeredpane", "\uACC4\uCE35\uC801 \uCC3D" },
|
||||||
|
{ "list", "\uBAA9\uB85D" },
|
||||||
|
{ "listitem", "\uBAA9\uB85D \uD56D\uBAA9" },
|
||||||
|
{ "managesDescendants", "\uC885\uC18D \uD56D\uBAA9 \uAD00\uB9AC" },
|
||||||
|
{ "memberOf", "\uC18C\uC18D \uADF8\uB8F9" },
|
||||||
|
{ "menu", "\uBA54\uB274" },
|
||||||
|
{ "menubar", "\uBA54\uB274 \uD45C\uC2DC\uC904" },
|
||||||
|
{ "menuitem", "\uBA54\uB274 \uD56D\uBAA9" },
|
||||||
|
{ "modal", "\uBAA8\uB2EC" },
|
||||||
|
{ "multiline", "\uBCF5\uC218 \uD589" },
|
||||||
|
{ "multiselectable", "\uB2E4\uC911 \uC120\uD0DD \uAC00\uB2A5" },
|
||||||
|
{ "opaque", "\uBD88\uD22C\uBA85" },
|
||||||
|
{ "optionpane", "\uC635\uC158 \uCC3D" },
|
||||||
|
{ "pagetab", "\uD398\uC774\uC9C0 \uD0ED" },
|
||||||
|
{ "pagetablist", "\uD398\uC774\uC9C0 \uD0ED \uBAA9\uB85D" },
|
||||||
|
{ "panel", "\uD328\uB110" },
|
||||||
|
{ "paragraph", "\uB2E8\uB77D" },
|
||||||
|
{ "parentWindowOf", "\uC0C1\uC704 \uCC3D" },
|
||||||
|
{ "passwordtext", "\uBE44\uBC00\uBC88\uD638 \uD14D\uC2A4\uD2B8" },
|
||||||
|
{ "popupmenu", "\uD31D\uC5C5 \uBA54\uB274" },
|
||||||
|
{ "pressed", "\uB204\uB984" },
|
||||||
|
{ "progressMonitor", "\uC9C4\uD589 \uBAA8\uB2C8\uD130" },
|
||||||
|
{ "progressbar", "\uC9C4\uD589 \uB9C9\uB300" },
|
||||||
|
{ "pushbutton", "\uB204\uB984 \uB2E8\uCD94" },
|
||||||
|
{ "radiobutton", "\uB77C\uB514\uC624 \uB2E8\uCD94" },
|
||||||
|
{ "resizable", "\uD06C\uAE30 \uC870\uC815 \uAC00\uB2A5" },
|
||||||
|
{ "rootpane", "\uB8E8\uD2B8 \uCC3D" },
|
||||||
|
{ "rowheader", "\uD589 \uBA38\uB9AC\uAE00" },
|
||||||
|
{ "ruler", "\uB208\uAE08\uC790" },
|
||||||
|
{ "scrollbar", "\uC2A4\uD06C\uB864 \uB9C9\uB300" },
|
||||||
|
{ "scrollpane", "\uC2A4\uD06C\uB864 \uCC3D" },
|
||||||
|
{ "selectable", "\uC120\uD0DD \uAC00\uB2A5" },
|
||||||
|
{ "selected", "\uC120\uD0DD\uB428" },
|
||||||
|
{ "separator", "\uAD6C\uBD84 \uAE30\uD638" },
|
||||||
|
{ "showing", "\uD45C\uC2DC" },
|
||||||
|
{ "singleline", "\uD55C \uC904" },
|
||||||
|
{ "slider", "\uC2AC\uB77C\uC774\uB354" },
|
||||||
|
{ "splitpane", "\uBD84\uD560 \uCC3D" },
|
||||||
|
{ "subwindowOf", "\uD558\uC704 \uCC3D" },
|
||||||
|
{ "swingcomponent", "\uD68C\uC804 \uAD6C\uC131\uC694\uC18C" },
|
||||||
|
{ "table", "\uD14C\uC774\uBE14" },
|
||||||
|
{ "text", "\uD14D\uC2A4\uD2B8" },
|
||||||
|
{ "togglebutton", "\uD1A0\uAE00 \uB2E8\uCD94" },
|
||||||
|
{ "toggleexpand", "\uD1A0\uAE00 \uD655\uC7A5" },
|
||||||
|
{ "toolbar", "\uB3C4\uAD6C \uBAA8\uC74C" },
|
||||||
|
{ "tooltip", "\uB3C4\uAD6C \uC124\uBA85" },
|
||||||
|
{ "transient", "\uC77C\uC2DC" },
|
||||||
|
{ "tree", "\uD2B8\uB9AC" },
|
||||||
|
{ "truncated", "\uC798\uB9BC" },
|
||||||
|
{ "unknown", "\uC54C \uC218 \uC5C6\uC74C" },
|
||||||
|
{ "vertical", "\uC138\uB85C" },
|
||||||
|
{ "viewport", "\uBDF0\uD3EC\uD2B8" },
|
||||||
|
{ "visible", "\uD45C\uC2DC \uAC00\uB2A5" },
|
||||||
|
{ "window", "\uCC3D" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_pt_BR extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "ativo" },
|
||||||
|
{ "alert", "alerta" },
|
||||||
|
{ "armed", "armado" },
|
||||||
|
{ "awtcomponent", "componente AWT" },
|
||||||
|
{ "busy", "ocupado" },
|
||||||
|
{ "canvas", "tela" },
|
||||||
|
{ "checkbox", "caixa de sele\u00E7\u00E3o" },
|
||||||
|
{ "checked", "selecionado" },
|
||||||
|
{ "childNodeOf", "n\u00F3 filho de" },
|
||||||
|
{ "collapsed", "contra\u00EDdo" },
|
||||||
|
{ "colorchooser", "seletor de cores" },
|
||||||
|
{ "columnheader", "cabe\u00E7alho da coluna" },
|
||||||
|
{ "combobox", "caixa de combina\u00E7\u00E3o" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "\u00EDcone da \u00E1rea de trabalho" },
|
||||||
|
{ "desktoppane", "painel da \u00E1rea de trabalho" },
|
||||||
|
{ "dialog", "caixa de di\u00E1logo" },
|
||||||
|
{ "directorypane", "painel do diret\u00F3rio" },
|
||||||
|
{ "editable", "edit\u00E1vel" },
|
||||||
|
{ "editbar", "barra de edi\u00E7\u00E3o" },
|
||||||
|
{ "embeddedBy", "integrado por" },
|
||||||
|
{ "embeds", "integra" },
|
||||||
|
{ "enabled", "ativado" },
|
||||||
|
{ "expandable", "expans\u00EDvel" },
|
||||||
|
{ "expanded", "expandido" },
|
||||||
|
{ "filechooser", "seletor de arquivos" },
|
||||||
|
{ "filler", "preenchedor" },
|
||||||
|
{ "flowsFrom", "fluxos de" },
|
||||||
|
{ "flowsTo", "fluxos para" },
|
||||||
|
{ "focusable", "focaliz\u00E1vel" },
|
||||||
|
{ "focused", "focalizado" },
|
||||||
|
{ "footer", "rodap\u00E9" },
|
||||||
|
{ "frame", "quadro" },
|
||||||
|
{ "glasspane", "painel transparente" },
|
||||||
|
{ "header", "cabe\u00E7alho" },
|
||||||
|
{ "horizontal", "horizontal" },
|
||||||
|
{ "htmlcontainer", "Container de HTML" },
|
||||||
|
{ "iconified", "iconizado" },
|
||||||
|
{ "indeterminate", "indeterminado" },
|
||||||
|
{ "internalframe", "quadro interno" },
|
||||||
|
{ "label", "r\u00F3tulo" },
|
||||||
|
{ "labelFor", "r\u00F3tulo de" },
|
||||||
|
{ "labeledBy", "rotulado por" },
|
||||||
|
{ "layeredpane", "painel em camadas" },
|
||||||
|
{ "list", "lista" },
|
||||||
|
{ "listitem", "item da lista" },
|
||||||
|
{ "managesDescendants", "gerencia descendentes" },
|
||||||
|
{ "memberOf", "membro de" },
|
||||||
|
{ "menu", "menu" },
|
||||||
|
{ "menubar", "barra de menus" },
|
||||||
|
{ "menuitem", "item do menu" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "v\u00E1rias linhas" },
|
||||||
|
{ "multiselectable", "m\u00FAltipla escolha" },
|
||||||
|
{ "opaque", "opaco" },
|
||||||
|
{ "optionpane", "painel de op\u00E7\u00F5es" },
|
||||||
|
{ "pagetab", "guia da p\u00E1gina" },
|
||||||
|
{ "pagetablist", "lista de guias da p\u00E1gina" },
|
||||||
|
{ "panel", "painel" },
|
||||||
|
{ "paragraph", "par\u00E1grafo" },
|
||||||
|
{ "parentWindowOf", "janela pai de" },
|
||||||
|
{ "passwordtext", "texto da senha" },
|
||||||
|
{ "popupmenu", "menu pop-up" },
|
||||||
|
{ "pressed", "pressionado" },
|
||||||
|
{ "progressMonitor", "monitor de progresso" },
|
||||||
|
{ "progressbar", "barra de progresso" },
|
||||||
|
{ "pushbutton", "bot\u00E3o de a\u00E7\u00E3o" },
|
||||||
|
{ "radiobutton", "bot\u00E3o de op\u00E7\u00E3o" },
|
||||||
|
{ "resizable", "redimension\u00E1vel" },
|
||||||
|
{ "rootpane", "painel base" },
|
||||||
|
{ "rowheader", "cabe\u00E7alho da linha" },
|
||||||
|
{ "ruler", "r\u00E9gua" },
|
||||||
|
{ "scrollbar", "barra de rolagem" },
|
||||||
|
{ "scrollpane", "painel de rolagem" },
|
||||||
|
{ "selectable", "selecion\u00E1vel" },
|
||||||
|
{ "selected", "selecionado" },
|
||||||
|
{ "separator", "separador" },
|
||||||
|
{ "showing", "mostrando" },
|
||||||
|
{ "singleline", "linha \u00FAnica" },
|
||||||
|
{ "slider", "controle deslizante" },
|
||||||
|
{ "splitpane", "painel dividido" },
|
||||||
|
{ "subwindowOf", "subjanela de" },
|
||||||
|
{ "swingcomponent", "componente swing" },
|
||||||
|
{ "table", "tabela" },
|
||||||
|
{ "text", "texto" },
|
||||||
|
{ "togglebutton", "bot\u00E3o de altern\u00E2ncia" },
|
||||||
|
{ "toggleexpand", "alternar expandir" },
|
||||||
|
{ "toolbar", "barra de ferramentas" },
|
||||||
|
{ "tooltip", "dica de ferramenta" },
|
||||||
|
{ "transient", "transit\u00F3rio" },
|
||||||
|
{ "tree", "\u00E1rvore" },
|
||||||
|
{ "truncated", "truncado" },
|
||||||
|
{ "unknown", "desconhecido" },
|
||||||
|
{ "vertical", "vertical" },
|
||||||
|
{ "viewport", "janela de visualiza\u00E7\u00E3o" },
|
||||||
|
{ "visible", "vis\u00EDvel" },
|
||||||
|
{ "window", "janela" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_sv extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "aktiv" },
|
||||||
|
{ "alert", "avisering" },
|
||||||
|
{ "armed", "redo" },
|
||||||
|
{ "awtcomponent", "AWT-komponent" },
|
||||||
|
{ "busy", "upptagen" },
|
||||||
|
{ "canvas", "rityta" },
|
||||||
|
{ "checkbox", "kryssruta" },
|
||||||
|
{ "checked", "markerad" },
|
||||||
|
{ "childNodeOf", "underordnad nod f\u00F6r" },
|
||||||
|
{ "collapsed", "komprimerad" },
|
||||||
|
{ "colorchooser", "f\u00E4rgv\u00E4ljare" },
|
||||||
|
{ "columnheader", "kolumnrubrik" },
|
||||||
|
{ "combobox", "kombinationsruta" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "skrivbordsikon" },
|
||||||
|
{ "desktoppane", "skrivbordsruta" },
|
||||||
|
{ "dialog", "dialogruta" },
|
||||||
|
{ "directorypane", "katalogruta" },
|
||||||
|
{ "editable", "redigerbar" },
|
||||||
|
{ "editbar", "redigeringslist" },
|
||||||
|
{ "embeddedBy", "b\u00E4ddas in av" },
|
||||||
|
{ "embeds", "b\u00E4ddar in" },
|
||||||
|
{ "enabled", "aktiverad" },
|
||||||
|
{ "expandable", "ut\u00F6kningsbar" },
|
||||||
|
{ "expanded", "ut\u00F6kad" },
|
||||||
|
{ "filechooser", "filv\u00E4ljare" },
|
||||||
|
{ "filler", "utfyllnad" },
|
||||||
|
{ "flowsFrom", "fl\u00F6dar fr\u00E5n" },
|
||||||
|
{ "flowsTo", "fl\u00F6dar till" },
|
||||||
|
{ "focusable", "fokuseringsbar" },
|
||||||
|
{ "focused", "fokuserad" },
|
||||||
|
{ "footer", "sidfot" },
|
||||||
|
{ "frame", "ram" },
|
||||||
|
{ "glasspane", "glasruta" },
|
||||||
|
{ "header", "sidhuvud" },
|
||||||
|
{ "horizontal", "horisontell" },
|
||||||
|
{ "htmlcontainer", "HTML-container" },
|
||||||
|
{ "iconified", "minimerad" },
|
||||||
|
{ "indeterminate", "obest\u00E4mt" },
|
||||||
|
{ "internalframe", "intern ram" },
|
||||||
|
{ "label", "etikett" },
|
||||||
|
{ "labelFor", "etikett f\u00F6r" },
|
||||||
|
{ "labeledBy", "etikett av" },
|
||||||
|
{ "layeredpane", "staplad ruta" },
|
||||||
|
{ "list", "lista" },
|
||||||
|
{ "listitem", "listobjekt" },
|
||||||
|
{ "managesDescendants", "hanterar underordnade" },
|
||||||
|
{ "memberOf", "medlem i" },
|
||||||
|
{ "menu", "meny" },
|
||||||
|
{ "menubar", "menyrad" },
|
||||||
|
{ "menuitem", "menyalternativ" },
|
||||||
|
{ "modal", "modal" },
|
||||||
|
{ "multiline", "flera rader" },
|
||||||
|
{ "multiselectable", "flerval" },
|
||||||
|
{ "opaque", "ogenomskinlig" },
|
||||||
|
{ "optionpane", "alternativruta" },
|
||||||
|
{ "pagetab", "sidflik" },
|
||||||
|
{ "pagetablist", "sidflikslista" },
|
||||||
|
{ "panel", "panel" },
|
||||||
|
{ "paragraph", "stycke" },
|
||||||
|
{ "parentWindowOf", "\u00F6verordnat f\u00F6nster f\u00F6r" },
|
||||||
|
{ "passwordtext", "l\u00F6senordstext" },
|
||||||
|
{ "popupmenu", "snabbmeny" },
|
||||||
|
{ "pressed", "nedtryckt" },
|
||||||
|
{ "progressMonitor", "f\u00F6rlopps\u00F6vervakare" },
|
||||||
|
{ "progressbar", "statusrad" },
|
||||||
|
{ "pushbutton", "knapp" },
|
||||||
|
{ "radiobutton", "alternativknapp" },
|
||||||
|
{ "resizable", "storleks\u00E4ndringsbar" },
|
||||||
|
{ "rootpane", "grundruta" },
|
||||||
|
{ "rowheader", "radrubrik" },
|
||||||
|
{ "ruler", "linjal" },
|
||||||
|
{ "scrollbar", "rullningslist" },
|
||||||
|
{ "scrollpane", "rullningsruta" },
|
||||||
|
{ "selectable", "valbar" },
|
||||||
|
{ "selected", "vald" },
|
||||||
|
{ "separator", "avskiljare" },
|
||||||
|
{ "showing", "visar" },
|
||||||
|
{ "singleline", "en rad" },
|
||||||
|
{ "slider", "skjutreglage" },
|
||||||
|
{ "splitpane", "delad ruta" },
|
||||||
|
{ "subwindowOf", "delf\u00F6nster av" },
|
||||||
|
{ "swingcomponent", "swing-komponent" },
|
||||||
|
{ "table", "tabell" },
|
||||||
|
{ "text", "text" },
|
||||||
|
{ "togglebutton", "v\u00E4xlingsknapp" },
|
||||||
|
{ "toggleexpand", "v\u00E4xla expandering" },
|
||||||
|
{ "toolbar", "verktygsrad" },
|
||||||
|
{ "tooltip", "knappbeskrivning" },
|
||||||
|
{ "transient", "tillf\u00E4llig" },
|
||||||
|
{ "tree", "tr\u00E4d" },
|
||||||
|
{ "truncated", "kapad" },
|
||||||
|
{ "unknown", "ok\u00E4nd" },
|
||||||
|
{ "vertical", "vertikal" },
|
||||||
|
{ "viewport", "vyport" },
|
||||||
|
{ "visible", "synlig" },
|
||||||
|
{ "window", "f\u00F6nster" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_zh_CN extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "\u6D3B\u52A8" },
|
||||||
|
{ "alert", "\u9884\u8B66" },
|
||||||
|
{ "armed", "\u5F85\u547D" },
|
||||||
|
{ "awtcomponent", "AWT \u7EC4\u4EF6" },
|
||||||
|
{ "busy", "\u5FD9" },
|
||||||
|
{ "canvas", "\u753B\u5E03" },
|
||||||
|
{ "checkbox", "\u590D\u9009\u6846" },
|
||||||
|
{ "checked", "\u5DF2\u9009\u4E2D" },
|
||||||
|
{ "childNodeOf", "\u5B50\u8282\u70B9" },
|
||||||
|
{ "collapsed", "\u5DF2\u6536\u7F29" },
|
||||||
|
{ "colorchooser", "\u989C\u8272\u9009\u62E9\u5668" },
|
||||||
|
{ "columnheader", "\u5217\u6807\u9898" },
|
||||||
|
{ "combobox", "\u7EC4\u5408\u6846" },
|
||||||
|
{ "controlledBy", "controlledBy" },
|
||||||
|
{ "controllerFor", "controllerFor" },
|
||||||
|
{ "desktopicon", "\u684C\u9762\u56FE\u6807" },
|
||||||
|
{ "desktoppane", "\u684C\u9762\u7A97\u683C" },
|
||||||
|
{ "dialog", "\u5BF9\u8BDD" },
|
||||||
|
{ "directorypane", "\u76EE\u5F55\u7A97\u683C" },
|
||||||
|
{ "editable", "\u53EF\u7F16\u8F91" },
|
||||||
|
{ "editbar", "\u7F16\u8F91\u680F" },
|
||||||
|
{ "embeddedBy", "\u5D4C\u5165\u8005" },
|
||||||
|
{ "embeds", "\u5D4C\u5165\u9879" },
|
||||||
|
{ "enabled", "\u542F\u7528" },
|
||||||
|
{ "expandable", "\u53EF\u5C55\u5F00" },
|
||||||
|
{ "expanded", "\u5DF2\u5C55\u5F00" },
|
||||||
|
{ "filechooser", "\u6587\u4EF6\u9009\u62E9\u5668" },
|
||||||
|
{ "filler", "\u6F0F\u6597" },
|
||||||
|
{ "flowsFrom", "\u6D41\u81EA" },
|
||||||
|
{ "flowsTo", "\u6D41\u5411" },
|
||||||
|
{ "focusable", "\u53EF\u96C6\u4E2D" },
|
||||||
|
{ "focused", "\u5DF2\u96C6\u4E2D" },
|
||||||
|
{ "footer", "\u9875\u811A" },
|
||||||
|
{ "frame", "\u6846\u67B6" },
|
||||||
|
{ "glasspane", "\u73BB\u7483\u7A97\u683C" },
|
||||||
|
{ "header", "\u9875\u7709" },
|
||||||
|
{ "horizontal", "\u6C34\u5E73" },
|
||||||
|
{ "htmlcontainer", "HTML \u5BB9\u5668" },
|
||||||
|
{ "iconified", "\u56FE\u6807\u5F0F" },
|
||||||
|
{ "indeterminate", "\u4E0D\u786E\u5B9A" },
|
||||||
|
{ "internalframe", "\u5185\u90E8\u6846\u67B6" },
|
||||||
|
{ "label", "\u6807\u7B7E" },
|
||||||
|
{ "labelFor", "\u6807\u7B7E\u5C5E\u4E8E" },
|
||||||
|
{ "labeledBy", "\u6807\u7B7E\u5236\u4F5C\u8005" },
|
||||||
|
{ "layeredpane", "\u5206\u5C42\u7A97\u683C" },
|
||||||
|
{ "list", "\u5217\u8868" },
|
||||||
|
{ "listitem", "\u5217\u8868\u9879" },
|
||||||
|
{ "managesDescendants", "\u7BA1\u7406\u5B50\u9879" },
|
||||||
|
{ "memberOf", "\u5C5E\u4E8E" },
|
||||||
|
{ "menu", "\u83DC\u5355" },
|
||||||
|
{ "menubar", "\u83DC\u5355\u680F" },
|
||||||
|
{ "menuitem", "\u83DC\u5355\u9879" },
|
||||||
|
{ "modal", "\u6A21\u6001" },
|
||||||
|
{ "multiline", "\u591A\u884C" },
|
||||||
|
{ "multiselectable", "\u591A\u9009\u62E9" },
|
||||||
|
{ "opaque", "\u4E0D\u900F\u660E" },
|
||||||
|
{ "optionpane", "\u9009\u9879\u7A97\u683C" },
|
||||||
|
{ "pagetab", "\u9875\u6807\u7B7E" },
|
||||||
|
{ "pagetablist", "\u9875\u6807\u7B7E\u5217\u8868" },
|
||||||
|
{ "panel", "\u9762\u677F" },
|
||||||
|
{ "paragraph", "\u6BB5\u843D" },
|
||||||
|
{ "parentWindowOf", "\u7236\u7A97\u53E3" },
|
||||||
|
{ "passwordtext", "\u53E3\u4EE4\u6587\u672C" },
|
||||||
|
{ "popupmenu", "\u5F39\u51FA\u5F0F\u83DC\u5355" },
|
||||||
|
{ "pressed", "\u5DF2\u6309\u4E0B" },
|
||||||
|
{ "progressMonitor", "\u8FDB\u5EA6\u76D1\u89C6\u5668" },
|
||||||
|
{ "progressbar", "\u8FDB\u5EA6\u680F" },
|
||||||
|
{ "pushbutton", "\u6309\u94AE" },
|
||||||
|
{ "radiobutton", "\u5355\u9009\u6309\u94AE" },
|
||||||
|
{ "resizable", "\u53EF\u8C03\u6574\u5927\u5C0F" },
|
||||||
|
{ "rootpane", "\u6839\u7A97\u683C" },
|
||||||
|
{ "rowheader", "\u884C\u6807\u9898" },
|
||||||
|
{ "ruler", "\u6807\u5C3A" },
|
||||||
|
{ "scrollbar", "\u6EDA\u52A8\u6761" },
|
||||||
|
{ "scrollpane", "\u6EDA\u52A8\u7A97\u683C" },
|
||||||
|
{ "selectable", "\u53EF\u9009\u62E9" },
|
||||||
|
{ "selected", "\u6240\u9009" },
|
||||||
|
{ "separator", "\u5206\u9694\u6761" },
|
||||||
|
{ "showing", "\u6B63\u5728\u663E\u793A" },
|
||||||
|
{ "singleline", "\u5355\u884C" },
|
||||||
|
{ "slider", "\u6ED1\u5757" },
|
||||||
|
{ "splitpane", "\u62C6\u5206\u7A97\u683C" },
|
||||||
|
{ "subwindowOf", "\u5B50\u7A97\u53E3" },
|
||||||
|
{ "swingcomponent", "\u65CB\u8F6C\u7EC4\u4EF6" },
|
||||||
|
{ "table", "\u8868" },
|
||||||
|
{ "text", "\u6587\u672C" },
|
||||||
|
{ "togglebutton", "\u5207\u6362\u6309\u94AE" },
|
||||||
|
{ "toggleexpand", "\u5207\u6362\u5C55\u5F00" },
|
||||||
|
{ "toolbar", "\u5DE5\u5177\u680F" },
|
||||||
|
{ "tooltip", "\u5DE5\u5177\u63D0\u793A" },
|
||||||
|
{ "transient", "\u77AC\u65F6" },
|
||||||
|
{ "tree", "\u6811" },
|
||||||
|
{ "truncated", "\u5DF2\u622A\u65AD" },
|
||||||
|
{ "unknown", "\u672A\u77E5" },
|
||||||
|
{ "vertical", "\u5782\u76F4" },
|
||||||
|
{ "viewport", "\u89C6\u7A97" },
|
||||||
|
{ "visible", "\u53EF\u89C1" },
|
||||||
|
{ "window", "\u7A97\u53E3" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_zh_HK extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "\u4F5C\u7528\u4E2D" },
|
||||||
|
{ "alert", "\u8B66\u793A" },
|
||||||
|
{ "armed", "\u5DF2\u914D\u5099" },
|
||||||
|
{ "awtcomponent", "AWT \u5143\u4EF6" },
|
||||||
|
{ "busy", "\u5FD9\u788C\u4E2D" },
|
||||||
|
{ "canvas", "\u756B\u5E03" },
|
||||||
|
{ "checkbox", "\u6838\u53D6\u65B9\u584A" },
|
||||||
|
{ "checked", "\u5DF2\u6838\u9078" },
|
||||||
|
{ "childNodeOf", "\u5B50\u7BC0\u9EDE" },
|
||||||
|
{ "collapsed", "\u5DF2\u6536\u7E2E" },
|
||||||
|
{ "colorchooser", "\u8272\u5F69\u9078\u64C7\u5668" },
|
||||||
|
{ "columnheader", "\u76F4\u6B04\u6A19\u984C" },
|
||||||
|
{ "combobox", "\u4E0B\u62C9\u5F0F\u6E05\u55AE\u65B9\u584A" },
|
||||||
|
{ "controlledBy", "\u63A7\u5236\u8005" },
|
||||||
|
{ "controllerFor", "\u63A7\u5236\u5C0D\u8C61" },
|
||||||
|
{ "desktopicon", "\u684C\u9762\u5716\u793A" },
|
||||||
|
{ "desktoppane", "\u684C\u9762\u7A97\u683C" },
|
||||||
|
{ "dialog", "\u5C0D\u8A71\u65B9\u584A" },
|
||||||
|
{ "directorypane", "\u76EE\u9304\u7A97\u683C" },
|
||||||
|
{ "editable", "\u53EF\u7DE8\u8F2F" },
|
||||||
|
{ "editbar", "\u7DE8\u8F2F\u5217" },
|
||||||
|
{ "embeddedBy", "\u5167\u5D4C\u8005" },
|
||||||
|
{ "embeds", "\u5167\u5D4C" },
|
||||||
|
{ "enabled", "\u5DF2\u555F\u7528" },
|
||||||
|
{ "expandable", "\u53EF\u64F4\u5C55" },
|
||||||
|
{ "expanded", "\u5DF2\u64F4\u5C55" },
|
||||||
|
{ "filechooser", "\u6A94\u6848\u9078\u64C7\u5668" },
|
||||||
|
{ "filler", "\u586B\u5145\u7269" },
|
||||||
|
{ "flowsFrom", "\u6D41\u52D5\u81EA" },
|
||||||
|
{ "flowsTo", "\u6D41\u52D5\u81F3" },
|
||||||
|
{ "focusable", "\u53EF\u805A\u7126" },
|
||||||
|
{ "focused", "\u5DF2\u805A\u7126" },
|
||||||
|
{ "footer", "\u9801\u5C3E" },
|
||||||
|
{ "frame", "\u6846\u67B6" },
|
||||||
|
{ "glasspane", "\u6AA2\u8996\u7A97\u683C" },
|
||||||
|
{ "header", "\u9801\u9996" },
|
||||||
|
{ "horizontal", "\u6C34\u5E73" },
|
||||||
|
{ "htmlcontainer", "HTML \u5BB9\u5668" },
|
||||||
|
{ "iconified", "\u5DF2\u5716\u793A\u5316" },
|
||||||
|
{ "indeterminate", "\u4E0D\u78BA\u5B9A" },
|
||||||
|
{ "internalframe", "\u5167\u90E8\u6846\u67B6" },
|
||||||
|
{ "label", "\u6A19\u7C64" },
|
||||||
|
{ "labelFor", "\u6A19\u793A\u5C0D\u8C61" },
|
||||||
|
{ "labeledBy", "\u6A19\u793A\u8005" },
|
||||||
|
{ "layeredpane", "\u5206\u5C64\u7A97\u683C" },
|
||||||
|
{ "list", "\u6E05\u55AE" },
|
||||||
|
{ "listitem", "\u6E05\u55AE\u9805\u76EE" },
|
||||||
|
{ "managesDescendants", "\u7BA1\u7406\u5B50\u4EE3" },
|
||||||
|
{ "memberOf", "\u6240\u5C6C\u6210\u54E1" },
|
||||||
|
{ "menu", "\u529F\u80FD\u8868" },
|
||||||
|
{ "menubar", "\u529F\u80FD\u8868\u5217" },
|
||||||
|
{ "menuitem", "\u529F\u80FD\u8868\u9805\u76EE" },
|
||||||
|
{ "modal", "\u6A21\u614B" },
|
||||||
|
{ "multiline", "\u591A\u884C" },
|
||||||
|
{ "multiselectable", "\u53EF\u591A\u91CD\u9078\u53D6" },
|
||||||
|
{ "opaque", "\u4E0D\u900F\u660E" },
|
||||||
|
{ "optionpane", "\u9078\u9805\u7A97\u683C" },
|
||||||
|
{ "pagetab", "\u9801\u9762\u9801\u7C64" },
|
||||||
|
{ "pagetablist", "\u9801\u9762\u9801\u7C64\u6E05\u55AE" },
|
||||||
|
{ "panel", "\u9762\u677F" },
|
||||||
|
{ "paragraph", "\u6BB5\u843D" },
|
||||||
|
{ "parentWindowOf", "\u7236\u7CFB\u8996\u7A97" },
|
||||||
|
{ "passwordtext", "\u5BC6\u78BC\u6587\u5B57" },
|
||||||
|
{ "popupmenu", "\u5373\u73FE\u5F0F\u529F\u80FD\u8868" },
|
||||||
|
{ "pressed", "\u5DF2\u6309\u4E0B" },
|
||||||
|
{ "progressMonitor", "\u9032\u5EA6\u76E3\u8996\u5668" },
|
||||||
|
{ "progressbar", "\u9032\u5EA6\u5217" },
|
||||||
|
{ "pushbutton", "\u4E0B\u58D3\u6309\u9215" },
|
||||||
|
{ "radiobutton", "\u5713\u9215" },
|
||||||
|
{ "resizable", "\u53EF\u8ABF\u6574\u5927\u5C0F" },
|
||||||
|
{ "rootpane", "root \u7A97\u683C" },
|
||||||
|
{ "rowheader", "\u5217\u6A19\u984C" },
|
||||||
|
{ "ruler", "\u5C3A\u898F" },
|
||||||
|
{ "scrollbar", "\u6372\u8EF8" },
|
||||||
|
{ "scrollpane", "\u6372\u52D5\u7A97\u683C" },
|
||||||
|
{ "selectable", "\u53EF\u9078\u53D6" },
|
||||||
|
{ "selected", "\u5DF2\u9078\u53D6" },
|
||||||
|
{ "separator", "\u5206\u9694\u5143" },
|
||||||
|
{ "showing", "\u986F\u793A" },
|
||||||
|
{ "singleline", "\u55AE\u884C" },
|
||||||
|
{ "slider", "\u6ED1\u52D5\u8EF8" },
|
||||||
|
{ "splitpane", "\u5206\u5272\u7A97\u683C" },
|
||||||
|
{ "subwindowOf", "\u5B50\u8996\u7A97" },
|
||||||
|
{ "swingcomponent", "Swing \u5143\u4EF6" },
|
||||||
|
{ "table", "\u8868\u683C" },
|
||||||
|
{ "text", "\u6587\u5B57" },
|
||||||
|
{ "togglebutton", "\u5207\u63DB\u6309\u9215" },
|
||||||
|
{ "toggleexpand", "\u5207\u63DB\u64F4\u5C55" },
|
||||||
|
{ "toolbar", "\u5DE5\u5177\u5217" },
|
||||||
|
{ "tooltip", "\u5DE5\u5177\u63D0\u793A" },
|
||||||
|
{ "transient", "\u66AB\u6642\u7684" },
|
||||||
|
{ "tree", "\u6A39\u72C0\u7D50\u69CB" },
|
||||||
|
{ "truncated", "\u5DF2\u622A\u65B7" },
|
||||||
|
{ "unknown", "\u4E0D\u660E\u7684" },
|
||||||
|
{ "vertical", "\u5782\u76F4" },
|
||||||
|
{ "viewport", "\u6AA2\u8996\u5340" },
|
||||||
|
{ "visible", "\u53EF\u898B\u7684" },
|
||||||
|
{ "window", "\u8996\u7A97" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.sun.accessibility.internal.resources;
|
||||||
|
|
||||||
|
import java.util.ListResourceBundle;
|
||||||
|
|
||||||
|
public final class accessibility_zh_TW extends ListResourceBundle {
|
||||||
|
protected final Object[][] getContents() {
|
||||||
|
return new Object[][] {
|
||||||
|
{ "active", "\u4F5C\u7528\u4E2D" },
|
||||||
|
{ "alert", "\u8B66\u793A" },
|
||||||
|
{ "armed", "\u5DF2\u914D\u5099" },
|
||||||
|
{ "awtcomponent", "AWT \u5143\u4EF6" },
|
||||||
|
{ "busy", "\u5FD9\u788C\u4E2D" },
|
||||||
|
{ "canvas", "\u756B\u5E03" },
|
||||||
|
{ "checkbox", "\u6838\u53D6\u65B9\u584A" },
|
||||||
|
{ "checked", "\u5DF2\u6838\u9078" },
|
||||||
|
{ "childNodeOf", "\u5B50\u7BC0\u9EDE" },
|
||||||
|
{ "collapsed", "\u5DF2\u6536\u7E2E" },
|
||||||
|
{ "colorchooser", "\u8272\u5F69\u9078\u64C7\u5668" },
|
||||||
|
{ "columnheader", "\u76F4\u6B04\u6A19\u984C" },
|
||||||
|
{ "combobox", "\u4E0B\u62C9\u5F0F\u6E05\u55AE\u65B9\u584A" },
|
||||||
|
{ "controlledBy", "\u63A7\u5236\u8005" },
|
||||||
|
{ "controllerFor", "\u63A7\u5236\u5C0D\u8C61" },
|
||||||
|
{ "desktopicon", "\u684C\u9762\u5716\u793A" },
|
||||||
|
{ "desktoppane", "\u684C\u9762\u7A97\u683C" },
|
||||||
|
{ "dialog", "\u5C0D\u8A71\u65B9\u584A" },
|
||||||
|
{ "directorypane", "\u76EE\u9304\u7A97\u683C" },
|
||||||
|
{ "editable", "\u53EF\u7DE8\u8F2F" },
|
||||||
|
{ "editbar", "\u7DE8\u8F2F\u5217" },
|
||||||
|
{ "embeddedBy", "\u5167\u5D4C\u8005" },
|
||||||
|
{ "embeds", "\u5167\u5D4C" },
|
||||||
|
{ "enabled", "\u5DF2\u555F\u7528" },
|
||||||
|
{ "expandable", "\u53EF\u64F4\u5C55" },
|
||||||
|
{ "expanded", "\u5DF2\u64F4\u5C55" },
|
||||||
|
{ "filechooser", "\u6A94\u6848\u9078\u64C7\u5668" },
|
||||||
|
{ "filler", "\u586B\u5145\u7269" },
|
||||||
|
{ "flowsFrom", "\u6D41\u52D5\u81EA" },
|
||||||
|
{ "flowsTo", "\u6D41\u52D5\u81F3" },
|
||||||
|
{ "focusable", "\u53EF\u805A\u7126" },
|
||||||
|
{ "focused", "\u5DF2\u805A\u7126" },
|
||||||
|
{ "footer", "\u9801\u5C3E" },
|
||||||
|
{ "frame", "\u6846\u67B6" },
|
||||||
|
{ "glasspane", "\u6AA2\u8996\u7A97\u683C" },
|
||||||
|
{ "header", "\u9801\u9996" },
|
||||||
|
{ "horizontal", "\u6C34\u5E73" },
|
||||||
|
{ "htmlcontainer", "HTML \u5BB9\u5668" },
|
||||||
|
{ "iconified", "\u5DF2\u5716\u793A\u5316" },
|
||||||
|
{ "indeterminate", "\u4E0D\u78BA\u5B9A" },
|
||||||
|
{ "internalframe", "\u5167\u90E8\u6846\u67B6" },
|
||||||
|
{ "label", "\u6A19\u7C64" },
|
||||||
|
{ "labelFor", "\u6A19\u793A\u5C0D\u8C61" },
|
||||||
|
{ "labeledBy", "\u6A19\u793A\u8005" },
|
||||||
|
{ "layeredpane", "\u5206\u5C64\u7A97\u683C" },
|
||||||
|
{ "list", "\u6E05\u55AE" },
|
||||||
|
{ "listitem", "\u6E05\u55AE\u9805\u76EE" },
|
||||||
|
{ "managesDescendants", "\u7BA1\u7406\u5B50\u4EE3" },
|
||||||
|
{ "memberOf", "\u6240\u5C6C\u6210\u54E1" },
|
||||||
|
{ "menu", "\u529F\u80FD\u8868" },
|
||||||
|
{ "menubar", "\u529F\u80FD\u8868\u5217" },
|
||||||
|
{ "menuitem", "\u529F\u80FD\u8868\u9805\u76EE" },
|
||||||
|
{ "modal", "\u6A21\u614B" },
|
||||||
|
{ "multiline", "\u591A\u884C" },
|
||||||
|
{ "multiselectable", "\u53EF\u591A\u91CD\u9078\u53D6" },
|
||||||
|
{ "opaque", "\u4E0D\u900F\u660E" },
|
||||||
|
{ "optionpane", "\u9078\u9805\u7A97\u683C" },
|
||||||
|
{ "pagetab", "\u9801\u9762\u9801\u7C64" },
|
||||||
|
{ "pagetablist", "\u9801\u9762\u9801\u7C64\u6E05\u55AE" },
|
||||||
|
{ "panel", "\u9762\u677F" },
|
||||||
|
{ "paragraph", "\u6BB5\u843D" },
|
||||||
|
{ "parentWindowOf", "\u7236\u7CFB\u8996\u7A97" },
|
||||||
|
{ "passwordtext", "\u5BC6\u78BC\u6587\u5B57" },
|
||||||
|
{ "popupmenu", "\u5373\u73FE\u5F0F\u529F\u80FD\u8868" },
|
||||||
|
{ "pressed", "\u5DF2\u6309\u4E0B" },
|
||||||
|
{ "progressMonitor", "\u9032\u5EA6\u76E3\u8996\u5668" },
|
||||||
|
{ "progressbar", "\u9032\u5EA6\u5217" },
|
||||||
|
{ "pushbutton", "\u4E0B\u58D3\u6309\u9215" },
|
||||||
|
{ "radiobutton", "\u5713\u9215" },
|
||||||
|
{ "resizable", "\u53EF\u8ABF\u6574\u5927\u5C0F" },
|
||||||
|
{ "rootpane", "root \u7A97\u683C" },
|
||||||
|
{ "rowheader", "\u5217\u6A19\u984C" },
|
||||||
|
{ "ruler", "\u5C3A\u898F" },
|
||||||
|
{ "scrollbar", "\u6372\u8EF8" },
|
||||||
|
{ "scrollpane", "\u6372\u52D5\u7A97\u683C" },
|
||||||
|
{ "selectable", "\u53EF\u9078\u53D6" },
|
||||||
|
{ "selected", "\u5DF2\u9078\u53D6" },
|
||||||
|
{ "separator", "\u5206\u9694\u5143" },
|
||||||
|
{ "showing", "\u986F\u793A" },
|
||||||
|
{ "singleline", "\u55AE\u884C" },
|
||||||
|
{ "slider", "\u6ED1\u52D5\u8EF8" },
|
||||||
|
{ "splitpane", "\u5206\u5272\u7A97\u683C" },
|
||||||
|
{ "subwindowOf", "\u5B50\u8996\u7A97" },
|
||||||
|
{ "swingcomponent", "Swing \u5143\u4EF6" },
|
||||||
|
{ "table", "\u8868\u683C" },
|
||||||
|
{ "text", "\u6587\u5B57" },
|
||||||
|
{ "togglebutton", "\u5207\u63DB\u6309\u9215" },
|
||||||
|
{ "toggleexpand", "\u5207\u63DB\u64F4\u5C55" },
|
||||||
|
{ "toolbar", "\u5DE5\u5177\u5217" },
|
||||||
|
{ "tooltip", "\u5DE5\u5177\u63D0\u793A" },
|
||||||
|
{ "transient", "\u66AB\u6642\u7684" },
|
||||||
|
{ "tree", "\u6A39\u72C0\u7D50\u69CB" },
|
||||||
|
{ "truncated", "\u5DF2\u622A\u65B7" },
|
||||||
|
{ "unknown", "\u4E0D\u660E\u7684" },
|
||||||
|
{ "vertical", "\u5782\u76F4" },
|
||||||
|
{ "viewport", "\u6AA2\u8996\u5340" },
|
||||||
|
{ "visible", "\u53EF\u898B\u7684" },
|
||||||
|
{ "window", "\u8996\u7A97" },
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.activation.registries;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.logging.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logging related methods.
|
||||||
|
*/
|
||||||
|
public class LogSupport {
|
||||||
|
private static boolean debug = false;
|
||||||
|
private static Logger logger;
|
||||||
|
private static final Level level = Level.FINE;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
debug = Boolean.getBoolean("javax.activation.debug");
|
||||||
|
} catch (Throwable t) {
|
||||||
|
// ignore any errors
|
||||||
|
}
|
||||||
|
logger = Logger.getLogger("javax.activation");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor.
|
||||||
|
*/
|
||||||
|
private LogSupport() {
|
||||||
|
// private constructor, can't create instances
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void log(String msg) {
|
||||||
|
if (debug)
|
||||||
|
System.out.println(msg);
|
||||||
|
logger.log(level, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void log(String msg, Throwable t) {
|
||||||
|
if (debug)
|
||||||
|
System.out.println(msg + "; Exception: " + t);
|
||||||
|
logger.log(level, msg, t);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isLoggable() {
|
||||||
|
return debug || logger.isLoggable(level);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,563 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.activation.registries;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class MailcapFile {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Map indexed by MIME type (string) that references
|
||||||
|
* a Map of commands for each type. The comand Map
|
||||||
|
* is indexed by the command name and references a List of
|
||||||
|
* class names (strings) for each command.
|
||||||
|
*/
|
||||||
|
private Map type_hash = new HashMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Another Map like above, but for fallback entries.
|
||||||
|
*/
|
||||||
|
private Map fallback_hash = new HashMap();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A Map indexed by MIME type (string) that references
|
||||||
|
* a List of native commands (string) corresponding to the type.
|
||||||
|
*/
|
||||||
|
private Map native_commands = new HashMap();
|
||||||
|
|
||||||
|
private static boolean addReverse = false;
|
||||||
|
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
addReverse = Boolean.getBoolean("javax.activation.addreverse");
|
||||||
|
} catch (Throwable t) {
|
||||||
|
// ignore any errors
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The constructor that takes a filename as an argument.
|
||||||
|
*
|
||||||
|
* @param new_fname The file name of the mailcap file.
|
||||||
|
*/
|
||||||
|
public MailcapFile(String new_fname) throws IOException {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("new MailcapFile: file " + new_fname);
|
||||||
|
FileReader reader = null;
|
||||||
|
try {
|
||||||
|
reader = new FileReader(new_fname);
|
||||||
|
parse(new BufferedReader(reader));
|
||||||
|
} finally {
|
||||||
|
if (reader != null) {
|
||||||
|
try {
|
||||||
|
reader.close();
|
||||||
|
} catch (IOException ex) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The constructor that takes an input stream as an argument.
|
||||||
|
*
|
||||||
|
* @param is the input stream
|
||||||
|
*/
|
||||||
|
public MailcapFile(InputStream is) throws IOException {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("new MailcapFile: InputStream");
|
||||||
|
parse(new BufferedReader(new InputStreamReader(is, "iso-8859-1")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mailcap file default constructor.
|
||||||
|
*/
|
||||||
|
public MailcapFile() {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("new MailcapFile: default");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Map of MailcapEntries based on the MIME type.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* <strong>Semantics:</strong> First check for the literal mime type,
|
||||||
|
* if that fails looks for wildcard <type>/\* and return that. Return the
|
||||||
|
* list of all that hit.
|
||||||
|
*/
|
||||||
|
public Map getMailcapList(String mime_type) {
|
||||||
|
Map search_result = null;
|
||||||
|
Map wildcard_result = null;
|
||||||
|
|
||||||
|
// first try the literal
|
||||||
|
search_result = (Map)type_hash.get(mime_type);
|
||||||
|
|
||||||
|
// ok, now try the wildcard
|
||||||
|
int separator = mime_type.indexOf('/');
|
||||||
|
String subtype = mime_type.substring(separator + 1);
|
||||||
|
if (!subtype.equals("*")) {
|
||||||
|
String type = mime_type.substring(0, separator + 1) + "*";
|
||||||
|
wildcard_result = (Map)type_hash.get(type);
|
||||||
|
|
||||||
|
if (wildcard_result != null) { // damn, we have to merge!!!
|
||||||
|
if (search_result != null)
|
||||||
|
search_result =
|
||||||
|
mergeResults(search_result, wildcard_result);
|
||||||
|
else
|
||||||
|
search_result = wildcard_result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return search_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the Map of fallback MailcapEntries based on the MIME type.
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* <strong>Semantics:</strong> First check for the literal mime type,
|
||||||
|
* if that fails looks for wildcard <type>/\* and return that. Return the
|
||||||
|
* list of all that hit.
|
||||||
|
*/
|
||||||
|
public Map getMailcapFallbackList(String mime_type) {
|
||||||
|
Map search_result = null;
|
||||||
|
Map wildcard_result = null;
|
||||||
|
|
||||||
|
// first try the literal
|
||||||
|
search_result = (Map)fallback_hash.get(mime_type);
|
||||||
|
|
||||||
|
// ok, now try the wildcard
|
||||||
|
int separator = mime_type.indexOf('/');
|
||||||
|
String subtype = mime_type.substring(separator + 1);
|
||||||
|
if (!subtype.equals("*")) {
|
||||||
|
String type = mime_type.substring(0, separator + 1) + "*";
|
||||||
|
wildcard_result = (Map)fallback_hash.get(type);
|
||||||
|
|
||||||
|
if (wildcard_result != null) { // damn, we have to merge!!!
|
||||||
|
if (search_result != null)
|
||||||
|
search_result =
|
||||||
|
mergeResults(search_result, wildcard_result);
|
||||||
|
else
|
||||||
|
search_result = wildcard_result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return search_result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all the MIME types known to this mailcap file.
|
||||||
|
*/
|
||||||
|
public String[] getMimeTypes() {
|
||||||
|
Set types = new HashSet(type_hash.keySet());
|
||||||
|
types.addAll(fallback_hash.keySet());
|
||||||
|
types.addAll(native_commands.keySet());
|
||||||
|
String[] mts = new String[types.size()];
|
||||||
|
mts = (String[])types.toArray(mts);
|
||||||
|
return mts;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all the native comands for the given MIME type.
|
||||||
|
*/
|
||||||
|
public String[] getNativeCommands(String mime_type) {
|
||||||
|
String[] cmds = null;
|
||||||
|
List v =
|
||||||
|
(List)native_commands.get(mime_type.toLowerCase(Locale.ENGLISH));
|
||||||
|
if (v != null) {
|
||||||
|
cmds = new String[v.size()];
|
||||||
|
cmds = (String[])v.toArray(cmds);
|
||||||
|
}
|
||||||
|
return cmds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merge the first hash into the second.
|
||||||
|
* This merge will only effect the hashtable that is
|
||||||
|
* returned, we don't want to touch the one passed in since
|
||||||
|
* its integrity must be maintained.
|
||||||
|
*/
|
||||||
|
private Map mergeResults(Map first, Map second) {
|
||||||
|
Iterator verb_enum = second.keySet().iterator();
|
||||||
|
Map clonedHash = new HashMap(first);
|
||||||
|
|
||||||
|
// iterate through the verbs in the second map
|
||||||
|
while (verb_enum.hasNext()) {
|
||||||
|
String verb = (String)verb_enum.next();
|
||||||
|
List cmdVector = (List)clonedHash.get(verb);
|
||||||
|
if (cmdVector == null) {
|
||||||
|
clonedHash.put(verb, second.get(verb));
|
||||||
|
} else {
|
||||||
|
// merge the two
|
||||||
|
List oldV = (List)second.get(verb);
|
||||||
|
cmdVector = new ArrayList(cmdVector);
|
||||||
|
cmdVector.addAll(oldV);
|
||||||
|
clonedHash.put(verb, cmdVector);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clonedHash;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* appendToMailcap: Append to this Mailcap DB, use the mailcap
|
||||||
|
* format:
|
||||||
|
* Comment == "# <i>comment string</i>
|
||||||
|
* Entry == "mimetype; javabeanclass<nl>
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* # this is a comment
|
||||||
|
* image/gif jaf.viewers.ImageViewer
|
||||||
|
*/
|
||||||
|
public void appendToMailcap(String mail_cap) {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("appendToMailcap: " + mail_cap);
|
||||||
|
try {
|
||||||
|
parse(new StringReader(mail_cap));
|
||||||
|
} catch (IOException ex) {
|
||||||
|
// can't happen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* parse file into a hash table of MC Type Entry Obj
|
||||||
|
*/
|
||||||
|
private void parse(Reader reader) throws IOException {
|
||||||
|
BufferedReader buf_reader = new BufferedReader(reader);
|
||||||
|
String line = null;
|
||||||
|
String continued = null;
|
||||||
|
|
||||||
|
while ((line = buf_reader.readLine()) != null) {
|
||||||
|
// LogSupport.log("parsing line: " + line);
|
||||||
|
|
||||||
|
line = line.trim();
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (line.charAt(0) == '#')
|
||||||
|
continue;
|
||||||
|
if (line.charAt(line.length() - 1) == '\\') {
|
||||||
|
if (continued != null)
|
||||||
|
continued += line.substring(0, line.length() - 1);
|
||||||
|
else
|
||||||
|
continued = line.substring(0, line.length() - 1);
|
||||||
|
} else if (continued != null) {
|
||||||
|
// handle the two strings
|
||||||
|
continued = continued + line;
|
||||||
|
// LogSupport.log("parse: " + continued);
|
||||||
|
try {
|
||||||
|
parseLine(continued);
|
||||||
|
} catch (MailcapParseException e) {
|
||||||
|
//e.printStackTrace();
|
||||||
|
}
|
||||||
|
continued = null;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// LogSupport.log("parse: " + line);
|
||||||
|
try {
|
||||||
|
parseLine(line);
|
||||||
|
// LogSupport.log("hash.size = " + type_hash.size());
|
||||||
|
} catch (MailcapParseException e) {
|
||||||
|
//e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (StringIndexOutOfBoundsException e) {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A routine to parse individual entries in a Mailcap file.
|
||||||
|
*
|
||||||
|
* Note that this routine does not handle line continuations.
|
||||||
|
* They should have been handled prior to calling this routine.
|
||||||
|
*/
|
||||||
|
protected void parseLine(String mailcapEntry)
|
||||||
|
throws MailcapParseException, IOException {
|
||||||
|
MailcapTokenizer tokenizer = new MailcapTokenizer(mailcapEntry);
|
||||||
|
tokenizer.setIsAutoquoting(false);
|
||||||
|
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("parse: " + mailcapEntry);
|
||||||
|
// parse the primary type
|
||||||
|
int currentToken = tokenizer.nextToken();
|
||||||
|
if (currentToken != MailcapTokenizer.STRING_TOKEN) {
|
||||||
|
reportParseError(MailcapTokenizer.STRING_TOKEN, currentToken,
|
||||||
|
tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
String primaryType =
|
||||||
|
tokenizer.getCurrentTokenValue().toLowerCase(Locale.ENGLISH);
|
||||||
|
String subType = "*";
|
||||||
|
|
||||||
|
// parse the '/' between primary and sub
|
||||||
|
// if it's not present that's ok, we just don't have a subtype
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
if ((currentToken != MailcapTokenizer.SLASH_TOKEN) &&
|
||||||
|
(currentToken != MailcapTokenizer.SEMICOLON_TOKEN)) {
|
||||||
|
reportParseError(MailcapTokenizer.SLASH_TOKEN,
|
||||||
|
MailcapTokenizer.SEMICOLON_TOKEN, currentToken,
|
||||||
|
tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
// only need to look for a sub type if we got a '/'
|
||||||
|
if (currentToken == MailcapTokenizer.SLASH_TOKEN) {
|
||||||
|
// parse the sub type
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
if (currentToken != MailcapTokenizer.STRING_TOKEN) {
|
||||||
|
reportParseError(MailcapTokenizer.STRING_TOKEN,
|
||||||
|
currentToken, tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
subType =
|
||||||
|
tokenizer.getCurrentTokenValue().toLowerCase(Locale.ENGLISH);
|
||||||
|
|
||||||
|
// get the next token to simplify the next step
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
String mimeType = primaryType + "/" + subType;
|
||||||
|
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log(" Type: " + mimeType);
|
||||||
|
|
||||||
|
// now setup the commands hashtable
|
||||||
|
Map commands = new LinkedHashMap(); // keep commands in order found
|
||||||
|
|
||||||
|
// parse the ';' that separates the type from the parameters
|
||||||
|
if (currentToken != MailcapTokenizer.SEMICOLON_TOKEN) {
|
||||||
|
reportParseError(MailcapTokenizer.SEMICOLON_TOKEN,
|
||||||
|
currentToken, tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
// eat it
|
||||||
|
|
||||||
|
// parse the required view command
|
||||||
|
tokenizer.setIsAutoquoting(true);
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
tokenizer.setIsAutoquoting(false);
|
||||||
|
if ((currentToken != MailcapTokenizer.STRING_TOKEN) &&
|
||||||
|
(currentToken != MailcapTokenizer.SEMICOLON_TOKEN)) {
|
||||||
|
reportParseError(MailcapTokenizer.STRING_TOKEN,
|
||||||
|
MailcapTokenizer.SEMICOLON_TOKEN, currentToken,
|
||||||
|
tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentToken == MailcapTokenizer.STRING_TOKEN) {
|
||||||
|
// have a native comand, save the entire mailcap entry
|
||||||
|
//String nativeCommand = tokenizer.getCurrentTokenValue();
|
||||||
|
List v = (List)native_commands.get(mimeType);
|
||||||
|
if (v == null) {
|
||||||
|
v = new ArrayList();
|
||||||
|
v.add(mailcapEntry);
|
||||||
|
native_commands.put(mimeType, v);
|
||||||
|
} else {
|
||||||
|
// XXX - check for duplicates?
|
||||||
|
v.add(mailcapEntry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// only have to get the next token if the current one isn't a ';'
|
||||||
|
if (currentToken != MailcapTokenizer.SEMICOLON_TOKEN) {
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
// look for a ';' which will indicate whether
|
||||||
|
// a parameter list is present or not
|
||||||
|
if (currentToken == MailcapTokenizer.SEMICOLON_TOKEN) {
|
||||||
|
boolean isFallback = false;
|
||||||
|
do {
|
||||||
|
// eat the ';'
|
||||||
|
|
||||||
|
// parse the parameter name
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
if (currentToken != MailcapTokenizer.STRING_TOKEN) {
|
||||||
|
reportParseError(MailcapTokenizer.STRING_TOKEN,
|
||||||
|
currentToken, tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
String paramName = tokenizer.getCurrentTokenValue().
|
||||||
|
toLowerCase(Locale.ENGLISH);
|
||||||
|
|
||||||
|
// parse the '=' which separates the name from the value
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
if ((currentToken != MailcapTokenizer.EQUALS_TOKEN) &&
|
||||||
|
(currentToken != MailcapTokenizer.SEMICOLON_TOKEN) &&
|
||||||
|
(currentToken != MailcapTokenizer.EOI_TOKEN)) {
|
||||||
|
reportParseError(MailcapTokenizer.EQUALS_TOKEN,
|
||||||
|
MailcapTokenizer.SEMICOLON_TOKEN,
|
||||||
|
MailcapTokenizer.EOI_TOKEN,
|
||||||
|
currentToken, tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
// we only have a useful command if it is named
|
||||||
|
if (currentToken == MailcapTokenizer.EQUALS_TOKEN) {
|
||||||
|
// eat it
|
||||||
|
|
||||||
|
// parse the parameter value (which is autoquoted)
|
||||||
|
tokenizer.setIsAutoquoting(true);
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
tokenizer.setIsAutoquoting(false);
|
||||||
|
if (currentToken != MailcapTokenizer.STRING_TOKEN) {
|
||||||
|
reportParseError(MailcapTokenizer.STRING_TOKEN,
|
||||||
|
currentToken, tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
String paramValue =
|
||||||
|
tokenizer.getCurrentTokenValue();
|
||||||
|
|
||||||
|
// add the class to the list iff it is one we care about
|
||||||
|
if (paramName.startsWith("x-java-")) {
|
||||||
|
String commandName = paramName.substring(7);
|
||||||
|
// 7 == "x-java-".length
|
||||||
|
|
||||||
|
if (commandName.equals("fallback-entry") &&
|
||||||
|
paramValue.equalsIgnoreCase("true")) {
|
||||||
|
isFallback = true;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// setup the class entry list
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log(" Command: " + commandName +
|
||||||
|
", Class: " + paramValue);
|
||||||
|
List classes = (List)commands.get(commandName);
|
||||||
|
if (classes == null) {
|
||||||
|
classes = new ArrayList();
|
||||||
|
commands.put(commandName, classes);
|
||||||
|
}
|
||||||
|
if (addReverse)
|
||||||
|
classes.add(0, paramValue);
|
||||||
|
else
|
||||||
|
classes.add(paramValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set up the next iteration
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
}
|
||||||
|
} while (currentToken == MailcapTokenizer.SEMICOLON_TOKEN);
|
||||||
|
|
||||||
|
Map masterHash = isFallback ? fallback_hash : type_hash;
|
||||||
|
Map curcommands =
|
||||||
|
(Map)masterHash.get(mimeType);
|
||||||
|
if (curcommands == null) {
|
||||||
|
masterHash.put(mimeType, commands);
|
||||||
|
} else {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("Merging commands for type " + mimeType);
|
||||||
|
// have to merge current and new commands
|
||||||
|
// first, merge list of classes for commands already known
|
||||||
|
Iterator cn = curcommands.keySet().iterator();
|
||||||
|
while (cn.hasNext()) {
|
||||||
|
String cmdName = (String)cn.next();
|
||||||
|
List ccv = (List)curcommands.get(cmdName);
|
||||||
|
List cv = (List)commands.get(cmdName);
|
||||||
|
if (cv == null)
|
||||||
|
continue;
|
||||||
|
// add everything in cv to ccv, if it's not already there
|
||||||
|
Iterator cvn = cv.iterator();
|
||||||
|
while (cvn.hasNext()) {
|
||||||
|
String clazz = (String)cvn.next();
|
||||||
|
if (!ccv.contains(clazz))
|
||||||
|
if (addReverse)
|
||||||
|
ccv.add(0, clazz);
|
||||||
|
else
|
||||||
|
ccv.add(clazz);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// now, add commands not previously known
|
||||||
|
cn = commands.keySet().iterator();
|
||||||
|
while (cn.hasNext()) {
|
||||||
|
String cmdName = (String)cn.next();
|
||||||
|
if (curcommands.containsKey(cmdName))
|
||||||
|
continue;
|
||||||
|
List cv = (List)commands.get(cmdName);
|
||||||
|
curcommands.put(cmdName, cv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (currentToken != MailcapTokenizer.EOI_TOKEN) {
|
||||||
|
reportParseError(MailcapTokenizer.EOI_TOKEN,
|
||||||
|
MailcapTokenizer.SEMICOLON_TOKEN,
|
||||||
|
currentToken, tokenizer.getCurrentTokenValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void reportParseError(int expectedToken, int actualToken,
|
||||||
|
String actualTokenValue) throws MailcapParseException {
|
||||||
|
throw new MailcapParseException("Encountered a " +
|
||||||
|
MailcapTokenizer.nameForToken(actualToken) + " token (" +
|
||||||
|
actualTokenValue + ") while expecting a " +
|
||||||
|
MailcapTokenizer.nameForToken(expectedToken) + " token.");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void reportParseError(int expectedToken,
|
||||||
|
int otherExpectedToken, int actualToken, String actualTokenValue)
|
||||||
|
throws MailcapParseException {
|
||||||
|
throw new MailcapParseException("Encountered a " +
|
||||||
|
MailcapTokenizer.nameForToken(actualToken) + " token (" +
|
||||||
|
actualTokenValue + ") while expecting a " +
|
||||||
|
MailcapTokenizer.nameForToken(expectedToken) + " or a " +
|
||||||
|
MailcapTokenizer.nameForToken(otherExpectedToken) + " token.");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void reportParseError(int expectedToken,
|
||||||
|
int otherExpectedToken, int anotherExpectedToken, int actualToken,
|
||||||
|
String actualTokenValue) throws MailcapParseException {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("PARSE ERROR: " + "Encountered a " +
|
||||||
|
MailcapTokenizer.nameForToken(actualToken) + " token (" +
|
||||||
|
actualTokenValue + ") while expecting a " +
|
||||||
|
MailcapTokenizer.nameForToken(expectedToken) + ", a " +
|
||||||
|
MailcapTokenizer.nameForToken(otherExpectedToken) + ", or a " +
|
||||||
|
MailcapTokenizer.nameForToken(anotherExpectedToken) + " token.");
|
||||||
|
throw new MailcapParseException("Encountered a " +
|
||||||
|
MailcapTokenizer.nameForToken(actualToken) + " token (" +
|
||||||
|
actualTokenValue + ") while expecting a " +
|
||||||
|
MailcapTokenizer.nameForToken(expectedToken) + ", a " +
|
||||||
|
MailcapTokenizer.nameForToken(otherExpectedToken) + ", or a " +
|
||||||
|
MailcapTokenizer.nameForToken(anotherExpectedToken) + " token.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** for debugging
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
Map masterHash = new HashMap();
|
||||||
|
for (int i = 0; i < args.length; ++i) {
|
||||||
|
System.out.println("Entry " + i + ": " + args[i]);
|
||||||
|
parseLine(args[i], masterHash);
|
||||||
|
}
|
||||||
|
|
||||||
|
Enumeration types = masterHash.keys();
|
||||||
|
while (types.hasMoreElements()) {
|
||||||
|
String key = (String)types.nextElement();
|
||||||
|
System.out.println("MIME Type: " + key);
|
||||||
|
|
||||||
|
Map commandHash = (Map)masterHash.get(key);
|
||||||
|
Enumeration commands = commandHash.keys();
|
||||||
|
while (commands.hasMoreElements()) {
|
||||||
|
String command = (String)commands.nextElement();
|
||||||
|
System.out.println(" Command: " + command);
|
||||||
|
|
||||||
|
Vector classes = (Vector)commandHash.get(command);
|
||||||
|
for (int i = 0; i < classes.size(); ++i) {
|
||||||
|
System.out.println(" Class: " +
|
||||||
|
(String)classes.elementAt(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.activation.registries;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A class to encapsulate Mailcap parsing related exceptions
|
||||||
|
*/
|
||||||
|
public class MailcapParseException extends Exception {
|
||||||
|
|
||||||
|
public MailcapParseException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MailcapParseException(String inInfo) {
|
||||||
|
super(inInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,321 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.activation.registries;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A tokenizer for strings in the form of "foo/bar; prop1=val1; ... ".
|
||||||
|
* Useful for parsing MIME content types.
|
||||||
|
*/
|
||||||
|
public class MailcapTokenizer {
|
||||||
|
|
||||||
|
public static final int UNKNOWN_TOKEN = 0;
|
||||||
|
public static final int START_TOKEN = 1;
|
||||||
|
public static final int STRING_TOKEN = 2;
|
||||||
|
public static final int EOI_TOKEN = 5;
|
||||||
|
public static final int SLASH_TOKEN = '/';
|
||||||
|
public static final int SEMICOLON_TOKEN = ';';
|
||||||
|
public static final int EQUALS_TOKEN = '=';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @parameter inputString the string to tokenize
|
||||||
|
*/
|
||||||
|
public MailcapTokenizer(String inputString) {
|
||||||
|
data = inputString;
|
||||||
|
dataIndex = 0;
|
||||||
|
dataLength = inputString.length();
|
||||||
|
|
||||||
|
currentToken = START_TOKEN;
|
||||||
|
currentTokenValue = "";
|
||||||
|
|
||||||
|
isAutoquoting = false;
|
||||||
|
autoquoteChar = ';';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether auto-quoting is on or off.
|
||||||
|
*
|
||||||
|
* Auto-quoting means that all characters after the first
|
||||||
|
* non-whitespace, non-control character up to the auto-quote
|
||||||
|
* terminator character or EOI (minus any whitespace immediatley
|
||||||
|
* preceeding it) is considered a token.
|
||||||
|
*
|
||||||
|
* This is required for handling command strings in a mailcap entry.
|
||||||
|
*/
|
||||||
|
public void setIsAutoquoting(boolean value) {
|
||||||
|
isAutoquoting = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve current token.
|
||||||
|
*
|
||||||
|
* @returns The current token value
|
||||||
|
*/
|
||||||
|
public int getCurrentToken() {
|
||||||
|
return currentToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Get a String that describes the given token.
|
||||||
|
*/
|
||||||
|
public static String nameForToken(int token) {
|
||||||
|
String name = "really unknown";
|
||||||
|
|
||||||
|
switch(token) {
|
||||||
|
case UNKNOWN_TOKEN:
|
||||||
|
name = "unknown";
|
||||||
|
break;
|
||||||
|
case START_TOKEN:
|
||||||
|
name = "start";
|
||||||
|
break;
|
||||||
|
case STRING_TOKEN:
|
||||||
|
name = "string";
|
||||||
|
break;
|
||||||
|
case EOI_TOKEN:
|
||||||
|
name = "EOI";
|
||||||
|
break;
|
||||||
|
case SLASH_TOKEN:
|
||||||
|
name = "'/'";
|
||||||
|
break;
|
||||||
|
case SEMICOLON_TOKEN:
|
||||||
|
name = "';'";
|
||||||
|
break;
|
||||||
|
case EQUALS_TOKEN:
|
||||||
|
name = "'='";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Retrieve current token value.
|
||||||
|
*
|
||||||
|
* @returns A String containing the current token value
|
||||||
|
*/
|
||||||
|
public String getCurrentTokenValue() {
|
||||||
|
return currentTokenValue;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Process the next token.
|
||||||
|
*
|
||||||
|
* @returns the next token
|
||||||
|
*/
|
||||||
|
public int nextToken() {
|
||||||
|
if (dataIndex < dataLength) {
|
||||||
|
// skip white space
|
||||||
|
while ((dataIndex < dataLength) &&
|
||||||
|
(isWhiteSpaceChar(data.charAt(dataIndex)))) {
|
||||||
|
++dataIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dataIndex < dataLength) {
|
||||||
|
// examine the current character and see what kind of token we have
|
||||||
|
char c = data.charAt(dataIndex);
|
||||||
|
if (isAutoquoting) {
|
||||||
|
if (c == ';' || c == '=') {
|
||||||
|
currentToken = c;
|
||||||
|
currentTokenValue = new Character(c).toString();
|
||||||
|
++dataIndex;
|
||||||
|
} else {
|
||||||
|
processAutoquoteToken();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isStringTokenChar(c)) {
|
||||||
|
processStringToken();
|
||||||
|
} else if ((c == '/') || (c == ';') || (c == '=')) {
|
||||||
|
currentToken = c;
|
||||||
|
currentTokenValue = new Character(c).toString();
|
||||||
|
++dataIndex;
|
||||||
|
} else {
|
||||||
|
currentToken = UNKNOWN_TOKEN;
|
||||||
|
currentTokenValue = new Character(c).toString();
|
||||||
|
++dataIndex;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentToken = EOI_TOKEN;
|
||||||
|
currentTokenValue = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
currentToken = EOI_TOKEN;
|
||||||
|
currentTokenValue = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return currentToken;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processStringToken() {
|
||||||
|
// capture the initial index
|
||||||
|
int initialIndex = dataIndex;
|
||||||
|
|
||||||
|
// skip to 1st non string token character
|
||||||
|
while ((dataIndex < dataLength) &&
|
||||||
|
isStringTokenChar(data.charAt(dataIndex))) {
|
||||||
|
++dataIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentToken = STRING_TOKEN;
|
||||||
|
currentTokenValue = data.substring(initialIndex, dataIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processAutoquoteToken() {
|
||||||
|
// capture the initial index
|
||||||
|
int initialIndex = dataIndex;
|
||||||
|
|
||||||
|
// now skip to the 1st non-escaped autoquote termination character
|
||||||
|
// XXX - doesn't actually consider escaping
|
||||||
|
boolean foundTerminator = false;
|
||||||
|
while ((dataIndex < dataLength) && !foundTerminator) {
|
||||||
|
char c = data.charAt(dataIndex);
|
||||||
|
if (c != autoquoteChar) {
|
||||||
|
++dataIndex;
|
||||||
|
} else {
|
||||||
|
foundTerminator = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
currentToken = STRING_TOKEN;
|
||||||
|
currentTokenValue =
|
||||||
|
fixEscapeSequences(data.substring(initialIndex, dataIndex));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isSpecialChar(char c) {
|
||||||
|
boolean lAnswer = false;
|
||||||
|
|
||||||
|
switch(c) {
|
||||||
|
case '(':
|
||||||
|
case ')':
|
||||||
|
case '<':
|
||||||
|
case '>':
|
||||||
|
case '@':
|
||||||
|
case ',':
|
||||||
|
case ';':
|
||||||
|
case ':':
|
||||||
|
case '\\':
|
||||||
|
case '"':
|
||||||
|
case '/':
|
||||||
|
case '[':
|
||||||
|
case ']':
|
||||||
|
case '?':
|
||||||
|
case '=':
|
||||||
|
lAnswer = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return lAnswer;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isControlChar(char c) {
|
||||||
|
return Character.isISOControl(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isWhiteSpaceChar(char c) {
|
||||||
|
return Character.isWhitespace(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isStringTokenChar(char c) {
|
||||||
|
return !isSpecialChar(c) && !isControlChar(c) && !isWhiteSpaceChar(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String fixEscapeSequences(String inputString) {
|
||||||
|
int inputLength = inputString.length();
|
||||||
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
buffer.ensureCapacity(inputLength);
|
||||||
|
|
||||||
|
for (int i = 0; i < inputLength; ++i) {
|
||||||
|
char currentChar = inputString.charAt(i);
|
||||||
|
if (currentChar != '\\') {
|
||||||
|
buffer.append(currentChar);
|
||||||
|
} else {
|
||||||
|
if (i < inputLength - 1) {
|
||||||
|
char nextChar = inputString.charAt(i + 1);
|
||||||
|
buffer.append(nextChar);
|
||||||
|
|
||||||
|
// force a skip over the next character too
|
||||||
|
++i;
|
||||||
|
} else {
|
||||||
|
buffer.append(currentChar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String data;
|
||||||
|
private int dataIndex;
|
||||||
|
private int dataLength;
|
||||||
|
private int currentToken;
|
||||||
|
private String currentTokenValue;
|
||||||
|
private boolean isAutoquoting;
|
||||||
|
private char autoquoteChar;
|
||||||
|
|
||||||
|
/*
|
||||||
|
public static void main(String[] args) {
|
||||||
|
for (int i = 0; i < args.length; ++i) {
|
||||||
|
MailcapTokenizer tokenizer = new MailcapTokenizer(args[i]);
|
||||||
|
|
||||||
|
System.out.println("Original: |" + args[i] + "|");
|
||||||
|
|
||||||
|
int currentToken = tokenizer.nextToken();
|
||||||
|
while (currentToken != EOI_TOKEN) {
|
||||||
|
switch(currentToken) {
|
||||||
|
case UNKNOWN_TOKEN:
|
||||||
|
System.out.println(" Unknown Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
case START_TOKEN:
|
||||||
|
System.out.println(" Start Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
case STRING_TOKEN:
|
||||||
|
System.out.println(" String Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
case EOI_TOKEN:
|
||||||
|
System.out.println(" EOI Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
case SLASH_TOKEN:
|
||||||
|
System.out.println(" Slash Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
case SEMICOLON_TOKEN:
|
||||||
|
System.out.println(" Semicolon Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
case EQUALS_TOKEN:
|
||||||
|
System.out.println(" Equals Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.out.println(" Really Unknown Token: |" + tokenizer.getCurrentTokenValue() + "|");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
currentToken = tokenizer.nextToken();
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.println("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 1998, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.activation.registries;
|
||||||
|
|
||||||
|
import java.lang.*;
|
||||||
|
|
||||||
|
public class MimeTypeEntry {
|
||||||
|
private String type;
|
||||||
|
private String extension;
|
||||||
|
|
||||||
|
public MimeTypeEntry(String mime_type, String file_ext) {
|
||||||
|
type = mime_type;
|
||||||
|
extension = file_ext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMIMEType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFileExtension() {
|
||||||
|
return extension;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return "MIMETypeEntry: " + type + ", " + extension;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,317 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.activation.registries;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class MimeTypeFile {
|
||||||
|
private String fname = null;
|
||||||
|
private Hashtable type_hash = new Hashtable();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The construtor that takes a filename as an argument.
|
||||||
|
*
|
||||||
|
* @param new_fname The file name of the mime types file.
|
||||||
|
*/
|
||||||
|
public MimeTypeFile(String new_fname) throws IOException {
|
||||||
|
File mime_file = null;
|
||||||
|
FileReader fr = null;
|
||||||
|
|
||||||
|
fname = new_fname; // remember the file name
|
||||||
|
|
||||||
|
mime_file = new File(fname); // get a file object
|
||||||
|
|
||||||
|
fr = new FileReader(mime_file);
|
||||||
|
|
||||||
|
try {
|
||||||
|
parse(new BufferedReader(fr));
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
fr.close(); // close it
|
||||||
|
} catch (IOException e) {
|
||||||
|
// ignore it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public MimeTypeFile(InputStream is) throws IOException {
|
||||||
|
parse(new BufferedReader(new InputStreamReader(is, "iso-8859-1")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an empty DB.
|
||||||
|
*/
|
||||||
|
public MimeTypeFile() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* get the MimeTypeEntry based on the file extension
|
||||||
|
*/
|
||||||
|
public MimeTypeEntry getMimeTypeEntry(String file_ext) {
|
||||||
|
return (MimeTypeEntry)type_hash.get((Object)file_ext);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the MIME type string corresponding to the file extension.
|
||||||
|
*/
|
||||||
|
public String getMIMETypeString(String file_ext) {
|
||||||
|
MimeTypeEntry entry = this.getMimeTypeEntry(file_ext);
|
||||||
|
|
||||||
|
if (entry != null)
|
||||||
|
return entry.getMIMEType();
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appends string of entries to the types registry, must be valid
|
||||||
|
* .mime.types format.
|
||||||
|
* A mime.types entry is one of two forms:
|
||||||
|
*
|
||||||
|
* type/subtype ext1 ext2 ...
|
||||||
|
* or
|
||||||
|
* type=type/subtype desc="description of type" exts=ext1,ext2,...
|
||||||
|
*
|
||||||
|
* Example:
|
||||||
|
* # this is a test
|
||||||
|
* audio/basic au
|
||||||
|
* text/plain txt text
|
||||||
|
* type=application/postscript exts=ps,eps
|
||||||
|
*/
|
||||||
|
public void appendToRegistry(String mime_types) {
|
||||||
|
try {
|
||||||
|
parse(new BufferedReader(new StringReader(mime_types)));
|
||||||
|
} catch (IOException ex) {
|
||||||
|
// can't happen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a stream of mime.types entries.
|
||||||
|
*/
|
||||||
|
private void parse(BufferedReader buf_reader) throws IOException {
|
||||||
|
String line = null, prev = null;
|
||||||
|
|
||||||
|
while ((line = buf_reader.readLine()) != null) {
|
||||||
|
if (prev == null)
|
||||||
|
prev = line;
|
||||||
|
else
|
||||||
|
prev += line;
|
||||||
|
int end = prev.length();
|
||||||
|
if (prev.length() > 0 && prev.charAt(end - 1) == '\\') {
|
||||||
|
prev = prev.substring(0, end - 1);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
this.parseEntry(prev);
|
||||||
|
prev = null;
|
||||||
|
}
|
||||||
|
if (prev != null)
|
||||||
|
this.parseEntry(prev);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse single mime.types entry.
|
||||||
|
*/
|
||||||
|
private void parseEntry(String line) {
|
||||||
|
String mime_type = null;
|
||||||
|
String file_ext = null;
|
||||||
|
line = line.trim();
|
||||||
|
|
||||||
|
if (line.length() == 0) // empty line...
|
||||||
|
return; // BAIL!
|
||||||
|
|
||||||
|
// check to see if this is a comment line?
|
||||||
|
if (line.charAt(0) == '#')
|
||||||
|
return; // then we are done!
|
||||||
|
|
||||||
|
// is it a new format line or old format?
|
||||||
|
if (line.indexOf('=') > 0) {
|
||||||
|
// new format
|
||||||
|
LineTokenizer lt = new LineTokenizer(line);
|
||||||
|
while (lt.hasMoreTokens()) {
|
||||||
|
String name = lt.nextToken();
|
||||||
|
String value = null;
|
||||||
|
if (lt.hasMoreTokens() && lt.nextToken().equals("=") &&
|
||||||
|
lt.hasMoreTokens())
|
||||||
|
value = lt.nextToken();
|
||||||
|
if (value == null) {
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("Bad .mime.types entry: " + line);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (name.equals("type"))
|
||||||
|
mime_type = value;
|
||||||
|
else if (name.equals("exts")) {
|
||||||
|
StringTokenizer st = new StringTokenizer(value, ",");
|
||||||
|
while (st.hasMoreTokens()) {
|
||||||
|
file_ext = st.nextToken();
|
||||||
|
MimeTypeEntry entry =
|
||||||
|
new MimeTypeEntry(mime_type, file_ext);
|
||||||
|
type_hash.put(file_ext, entry);
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("Added: " + entry.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// old format
|
||||||
|
// count the tokens
|
||||||
|
StringTokenizer strtok = new StringTokenizer(line);
|
||||||
|
int num_tok = strtok.countTokens();
|
||||||
|
|
||||||
|
if (num_tok == 0) // empty line
|
||||||
|
return;
|
||||||
|
|
||||||
|
mime_type = strtok.nextToken(); // get the MIME type
|
||||||
|
|
||||||
|
while (strtok.hasMoreTokens()) {
|
||||||
|
MimeTypeEntry entry = null;
|
||||||
|
|
||||||
|
file_ext = strtok.nextToken();
|
||||||
|
entry = new MimeTypeEntry(mime_type, file_ext);
|
||||||
|
type_hash.put(file_ext, entry);
|
||||||
|
if (LogSupport.isLoggable())
|
||||||
|
LogSupport.log("Added: " + entry.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// for debugging
|
||||||
|
/*
|
||||||
|
public static void main(String[] argv) throws Exception {
|
||||||
|
MimeTypeFile mf = new MimeTypeFile(argv[0]);
|
||||||
|
System.out.println("ext " + argv[1] + " type " +
|
||||||
|
mf.getMIMETypeString(argv[1]));
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
class LineTokenizer {
|
||||||
|
private int currentPosition;
|
||||||
|
private int maxPosition;
|
||||||
|
private String str;
|
||||||
|
private Vector stack = new Vector();
|
||||||
|
private static final String singles = "="; // single character tokens
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructs a tokenizer for the specified string.
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* @param str a string to be parsed.
|
||||||
|
*/
|
||||||
|
public LineTokenizer(String str) {
|
||||||
|
currentPosition = 0;
|
||||||
|
this.str = str;
|
||||||
|
maxPosition = str.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Skips white space.
|
||||||
|
*/
|
||||||
|
private void skipWhiteSpace() {
|
||||||
|
while ((currentPosition < maxPosition) &&
|
||||||
|
Character.isWhitespace(str.charAt(currentPosition))) {
|
||||||
|
currentPosition++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests if there are more tokens available from this tokenizer's string.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if there are more tokens available from this
|
||||||
|
* tokenizer's string; <code>false</code> otherwise.
|
||||||
|
*/
|
||||||
|
public boolean hasMoreTokens() {
|
||||||
|
if (stack.size() > 0)
|
||||||
|
return true;
|
||||||
|
skipWhiteSpace();
|
||||||
|
return (currentPosition < maxPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the next token from this tokenizer.
|
||||||
|
*
|
||||||
|
* @return the next token from this tokenizer.
|
||||||
|
* @exception NoSuchElementException if there are no more tokens in this
|
||||||
|
* tokenizer's string.
|
||||||
|
*/
|
||||||
|
public String nextToken() {
|
||||||
|
int size = stack.size();
|
||||||
|
if (size > 0) {
|
||||||
|
String t = (String)stack.elementAt(size - 1);
|
||||||
|
stack.removeElementAt(size - 1);
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
skipWhiteSpace();
|
||||||
|
|
||||||
|
if (currentPosition >= maxPosition) {
|
||||||
|
throw new NoSuchElementException();
|
||||||
|
}
|
||||||
|
|
||||||
|
int start = currentPosition;
|
||||||
|
char c = str.charAt(start);
|
||||||
|
if (c == '"') {
|
||||||
|
currentPosition++;
|
||||||
|
boolean filter = false;
|
||||||
|
while (currentPosition < maxPosition) {
|
||||||
|
c = str.charAt(currentPosition++);
|
||||||
|
if (c == '\\') {
|
||||||
|
currentPosition++;
|
||||||
|
filter = true;
|
||||||
|
} else if (c == '"') {
|
||||||
|
String s;
|
||||||
|
|
||||||
|
if (filter) {
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
for (int i = start + 1; i < currentPosition - 1; i++) {
|
||||||
|
c = str.charAt(i);
|
||||||
|
if (c != '\\')
|
||||||
|
sb.append(c);
|
||||||
|
}
|
||||||
|
s = sb.toString();
|
||||||
|
} else
|
||||||
|
s = str.substring(start + 1, currentPosition - 1);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (singles.indexOf(c) >= 0) {
|
||||||
|
currentPosition++;
|
||||||
|
} else {
|
||||||
|
while ((currentPosition < maxPosition) &&
|
||||||
|
singles.indexOf(str.charAt(currentPosition)) < 0 &&
|
||||||
|
!Character.isWhitespace(str.charAt(currentPosition))) {
|
||||||
|
currentPosition++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str.substring(start, currentPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void pushToken(String token) {
|
||||||
|
stack.addElement(token);
|
||||||
|
}
|
||||||
|
}
|
||||||
462
src/main/resources/jdk8/com/sun/awt/AWTUtilities.java
Normal file
462
src/main/resources/jdk8/com/sun/awt/AWTUtilities.java
Normal file
@@ -0,0 +1,462 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.awt;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
import sun.awt.AWTAccessor;
|
||||||
|
import sun.awt.SunToolkit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A collection of utility methods for AWT.
|
||||||
|
*
|
||||||
|
* The functionality provided by the static methods of the class includes:
|
||||||
|
* <ul>
|
||||||
|
* <li>Setting shapes on top-level windows
|
||||||
|
* <li>Setting a constant alpha value for each pixel of a top-level window
|
||||||
|
* <li>Making a window non-opaque, after that it paints only explicitly
|
||||||
|
* painted pixels on the screen, with arbitrary alpha values for every pixel.
|
||||||
|
* <li>Setting a 'mixing-cutout' shape for a component.
|
||||||
|
* </ul>
|
||||||
|
* <p>
|
||||||
|
* A "top-level window" is an instance of the {@code Window} class (or its
|
||||||
|
* descendant, such as {@code JFrame}).
|
||||||
|
* <p>
|
||||||
|
* Some of the mentioned features may not be supported by the native platform.
|
||||||
|
* To determine whether a particular feature is supported, the user must use
|
||||||
|
* the {@code isTranslucencySupported()} method of the class passing a desired
|
||||||
|
* translucency kind (a member of the {@code Translucency} enum) as an
|
||||||
|
* argument.
|
||||||
|
* <p>
|
||||||
|
* The per-pixel alpha feature also requires the user to create her/his
|
||||||
|
* windows using a translucency-capable graphics configuration.
|
||||||
|
* The {@code isTranslucencyCapable()} method must
|
||||||
|
* be used to verify whether any given GraphicsConfiguration supports
|
||||||
|
* the trasnlcency effects.
|
||||||
|
* <p>
|
||||||
|
* <b>WARNING</b>: This class is an implementation detail and only meant
|
||||||
|
* for limited use outside of the core platform. This API may change
|
||||||
|
* drastically between update release, and it may even be
|
||||||
|
* removed or be moved in some other package(s)/class(es).
|
||||||
|
*/
|
||||||
|
public final class AWTUtilities {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The AWTUtilities class should not be instantiated
|
||||||
|
*/
|
||||||
|
private AWTUtilities() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Kinds of translucency supported by the underlying system.
|
||||||
|
* @see #isTranslucencySupported
|
||||||
|
*/
|
||||||
|
public static enum Translucency {
|
||||||
|
/**
|
||||||
|
* Represents support in the underlying system for windows each pixel
|
||||||
|
* of which is guaranteed to be either completely opaque, with
|
||||||
|
* an alpha value of 1.0, or completely transparent, with an alpha
|
||||||
|
* value of 0.0.
|
||||||
|
*/
|
||||||
|
PERPIXEL_TRANSPARENT,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents support in the underlying system for windows all of
|
||||||
|
* the pixels of which have the same alpha value between or including
|
||||||
|
* 0.0 and 1.0.
|
||||||
|
*/
|
||||||
|
TRANSLUCENT,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents support in the underlying system for windows that
|
||||||
|
* contain or might contain pixels with arbitrary alpha values
|
||||||
|
* between and including 0.0 and 1.0.
|
||||||
|
*/
|
||||||
|
PERPIXEL_TRANSLUCENT;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the given level of translucency is supported by
|
||||||
|
* the underlying system.
|
||||||
|
*
|
||||||
|
* Note that this method may sometimes return the value
|
||||||
|
* indicating that the particular level is supported, but
|
||||||
|
* the native windowing system may still not support the
|
||||||
|
* given level of translucency (due to the bugs in
|
||||||
|
* the windowing system).
|
||||||
|
*
|
||||||
|
* @param translucencyKind a kind of translucency support
|
||||||
|
* (either PERPIXEL_TRANSPARENT,
|
||||||
|
* TRANSLUCENT, or PERPIXEL_TRANSLUCENT)
|
||||||
|
* @return whether the given translucency kind is supported
|
||||||
|
*/
|
||||||
|
public static boolean isTranslucencySupported(Translucency translucencyKind) {
|
||||||
|
switch (translucencyKind) {
|
||||||
|
case PERPIXEL_TRANSPARENT:
|
||||||
|
return isWindowShapingSupported();
|
||||||
|
case TRANSLUCENT:
|
||||||
|
return isWindowOpacitySupported();
|
||||||
|
case PERPIXEL_TRANSLUCENT:
|
||||||
|
return isWindowTranslucencySupported();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the windowing system supports changing the opacity
|
||||||
|
* value of top-level windows.
|
||||||
|
* Note that this method may sometimes return true, but the native
|
||||||
|
* windowing system may still not support the concept of
|
||||||
|
* translucency (due to the bugs in the windowing system).
|
||||||
|
*/
|
||||||
|
private static boolean isWindowOpacitySupported() {
|
||||||
|
Toolkit curToolkit = Toolkit.getDefaultToolkit();
|
||||||
|
if (!(curToolkit instanceof SunToolkit)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ((SunToolkit)curToolkit).isWindowOpacitySupported();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the opacity of the window. The opacity is at the range [0..1].
|
||||||
|
* Note that setting the opacity level of 0 may or may not disable
|
||||||
|
* the mouse event handling on this window. This is
|
||||||
|
* a platform-dependent behavior.
|
||||||
|
*
|
||||||
|
* In order for this method to enable the translucency effect,
|
||||||
|
* the isTranslucencySupported() method should indicate that the
|
||||||
|
* TRANSLUCENT level of translucency is supported.
|
||||||
|
*
|
||||||
|
* <p>Also note that the window must not be in the full-screen mode
|
||||||
|
* when setting the opacity value < 1.0f. Otherwise
|
||||||
|
* the IllegalArgumentException is thrown.
|
||||||
|
*
|
||||||
|
* @param window the window to set the opacity level to
|
||||||
|
* @param opacity the opacity level to set to the window
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
* @throws IllegalArgumentException if the opacity is out of
|
||||||
|
* the range [0..1]
|
||||||
|
* @throws IllegalArgumentException if the window is in full screen mode,
|
||||||
|
* and the opacity is less than 1.0f
|
||||||
|
* @throws UnsupportedOperationException if the TRANSLUCENT translucency
|
||||||
|
* kind is not supported
|
||||||
|
*/
|
||||||
|
public static void setWindowOpacity(Window window, float opacity) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
|
||||||
|
AWTAccessor.getWindowAccessor().setOpacity(window, opacity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the opacity of the window. If the opacity has not
|
||||||
|
* yet being set, this method returns 1.0.
|
||||||
|
*
|
||||||
|
* @param window the window to get the opacity level from
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
*/
|
||||||
|
public static float getWindowOpacity(Window window) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return AWTAccessor.getWindowAccessor().getOpacity(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the windowing system supports changing the shape
|
||||||
|
* of top-level windows.
|
||||||
|
* Note that this method may sometimes return true, but the native
|
||||||
|
* windowing system may still not support the concept of
|
||||||
|
* shaping (due to the bugs in the windowing system).
|
||||||
|
*/
|
||||||
|
public static boolean isWindowShapingSupported() {
|
||||||
|
Toolkit curToolkit = Toolkit.getDefaultToolkit();
|
||||||
|
if (!(curToolkit instanceof SunToolkit)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ((SunToolkit)curToolkit).isWindowShapingSupported();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an object that implements the Shape interface and represents
|
||||||
|
* the shape previously set with the call to the setWindowShape() method.
|
||||||
|
* If no shape has been set yet, or the shape has been reset to null,
|
||||||
|
* this method returns null.
|
||||||
|
*
|
||||||
|
* @param window the window to get the shape from
|
||||||
|
* @return the current shape of the window
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
*/
|
||||||
|
public static Shape getWindowShape(Window window) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
return AWTAccessor.getWindowAccessor().getShape(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a shape for the given window.
|
||||||
|
* If the shape argument is null, this methods restores
|
||||||
|
* the default shape making the window rectangular.
|
||||||
|
* <p>Note that in order to set a shape, the window must be undecorated.
|
||||||
|
* If the window is decorated, this method ignores the {@code shape}
|
||||||
|
* argument and resets the shape to null.
|
||||||
|
* <p>Also note that the window must not be in the full-screen mode
|
||||||
|
* when setting a non-null shape. Otherwise the IllegalArgumentException
|
||||||
|
* is thrown.
|
||||||
|
* <p>Depending on the platform, the method may return without
|
||||||
|
* effecting the shape of the window if the window has a non-null warning
|
||||||
|
* string ({@link Window#getWarningString()}). In this case the passed
|
||||||
|
* shape object is ignored.
|
||||||
|
*
|
||||||
|
* @param window the window to set the shape to
|
||||||
|
* @param shape the shape to set to the window
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
* @throws IllegalArgumentException if the window is in full screen mode,
|
||||||
|
* and the shape is not null
|
||||||
|
* @throws UnsupportedOperationException if the PERPIXEL_TRANSPARENT
|
||||||
|
* translucency kind is not supported
|
||||||
|
*/
|
||||||
|
public static void setWindowShape(Window window, Shape shape) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
AWTAccessor.getWindowAccessor().setShape(window, shape);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isWindowTranslucencySupported() {
|
||||||
|
/*
|
||||||
|
* Per-pixel alpha is supported if all the conditions are TRUE:
|
||||||
|
* 1. The toolkit is a sort of SunToolkit
|
||||||
|
* 2. The toolkit supports translucency in general
|
||||||
|
* (isWindowTranslucencySupported())
|
||||||
|
* 3. There's at least one translucency-capable
|
||||||
|
* GraphicsConfiguration
|
||||||
|
*/
|
||||||
|
|
||||||
|
Toolkit curToolkit = Toolkit.getDefaultToolkit();
|
||||||
|
if (!(curToolkit instanceof SunToolkit)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!((SunToolkit)curToolkit).isWindowTranslucencySupported()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
GraphicsEnvironment env =
|
||||||
|
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||||
|
|
||||||
|
// If the default GC supports translucency return true.
|
||||||
|
// It is important to optimize the verification this way,
|
||||||
|
// see CR 6661196 for more details.
|
||||||
|
if (isTranslucencyCapable(env.getDefaultScreenDevice()
|
||||||
|
.getDefaultConfiguration()))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ... otherwise iterate through all the GCs.
|
||||||
|
GraphicsDevice[] devices = env.getScreenDevices();
|
||||||
|
|
||||||
|
for (int i = 0; i < devices.length; i++) {
|
||||||
|
GraphicsConfiguration[] configs = devices[i].getConfigurations();
|
||||||
|
for (int j = 0; j < configs.length; j++) {
|
||||||
|
if (isTranslucencyCapable(configs[j])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enables the per-pixel alpha support for the given window.
|
||||||
|
* Once the window becomes non-opaque (the isOpaque is set to false),
|
||||||
|
* the drawing sub-system is starting to respect the alpha value of each
|
||||||
|
* separate pixel. If a pixel gets painted with alpha color component
|
||||||
|
* equal to zero, it becomes visually transparent, if the alpha of the
|
||||||
|
* pixel is equal to 255, the pixel is fully opaque. Interim values
|
||||||
|
* of the alpha color component make the pixel semi-transparent (i.e.
|
||||||
|
* translucent).
|
||||||
|
* <p>Note that in order for the window to support the per-pixel alpha
|
||||||
|
* mode, the window must be created using the GraphicsConfiguration
|
||||||
|
* for which the {@link #isTranslucencyCapable}
|
||||||
|
* method returns true.
|
||||||
|
* <p>Also note that some native systems enable the per-pixel translucency
|
||||||
|
* mode for any window created using the translucency-compatible
|
||||||
|
* graphics configuration. However, it is highly recommended to always
|
||||||
|
* invoke the setWindowOpaque() method for these windows, at least for
|
||||||
|
* the sake of cross-platform compatibility reasons.
|
||||||
|
* <p>Also note that the window must not be in the full-screen mode
|
||||||
|
* when making it non-opaque. Otherwise the IllegalArgumentException
|
||||||
|
* is thrown.
|
||||||
|
* <p>If the window is a {@code Frame} or a {@code Dialog}, the window must
|
||||||
|
* be undecorated prior to enabling the per-pixel translucency effect (see
|
||||||
|
* {@link Frame#setUndecorated()} and/or {@link Dialog#setUndecorated()}).
|
||||||
|
* If the window becomes decorated through a subsequent call to the
|
||||||
|
* corresponding {@code setUndecorated()} method, the per-pixel
|
||||||
|
* translucency effect will be disabled and the opaque property reset to
|
||||||
|
* {@code true}.
|
||||||
|
* <p>Depending on the platform, the method may return without
|
||||||
|
* effecting the opaque property of the window if the window has a non-null
|
||||||
|
* warning string ({@link Window#getWarningString()}). In this case
|
||||||
|
* the passed 'isOpaque' value is ignored.
|
||||||
|
*
|
||||||
|
* @param window the window to set the shape to
|
||||||
|
* @param isOpaque whether the window must be opaque (true),
|
||||||
|
* or translucent (false)
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
* @throws IllegalArgumentException if the window uses
|
||||||
|
* a GraphicsConfiguration for which the
|
||||||
|
* {@code isTranslucencyCapable()}
|
||||||
|
* method returns false
|
||||||
|
* @throws IllegalArgumentException if the window is in full screen mode,
|
||||||
|
* and the isOpaque is false
|
||||||
|
* @throws IllegalArgumentException if the window is decorated and the
|
||||||
|
* isOpaque argument is {@code false}.
|
||||||
|
* @throws UnsupportedOperationException if the PERPIXEL_TRANSLUCENT
|
||||||
|
* translucency kind is not supported
|
||||||
|
*/
|
||||||
|
public static void setWindowOpaque(Window window, boolean isOpaque) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
if (!isOpaque && !isTranslucencySupported(Translucency.PERPIXEL_TRANSLUCENT)) {
|
||||||
|
throw new UnsupportedOperationException(
|
||||||
|
"The PERPIXEL_TRANSLUCENT translucency kind is not supported");
|
||||||
|
}
|
||||||
|
AWTAccessor.getWindowAccessor().setOpaque(window, isOpaque);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns whether the window is opaque or translucent.
|
||||||
|
*
|
||||||
|
* @param window the window to set the shape to
|
||||||
|
* @return whether the window is currently opaque (true)
|
||||||
|
* or translucent (false)
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
*/
|
||||||
|
public static boolean isWindowOpaque(Window window) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.isOpaque();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies whether a given GraphicsConfiguration supports
|
||||||
|
* the PERPIXEL_TRANSLUCENT kind of translucency.
|
||||||
|
* All windows that are intended to be used with the {@link #setWindowOpaque}
|
||||||
|
* method must be created using a GraphicsConfiguration for which this method
|
||||||
|
* returns true.
|
||||||
|
* <p>Note that some native systems enable the per-pixel translucency
|
||||||
|
* mode for any window created using a translucency-capable
|
||||||
|
* graphics configuration. However, it is highly recommended to always
|
||||||
|
* invoke the setWindowOpaque() method for these windows, at least
|
||||||
|
* for the sake of cross-platform compatibility reasons.
|
||||||
|
*
|
||||||
|
* @param gc GraphicsConfiguration
|
||||||
|
* @throws NullPointerException if the gc argument is null
|
||||||
|
* @return whether the given GraphicsConfiguration supports
|
||||||
|
* the translucency effects.
|
||||||
|
*/
|
||||||
|
public static boolean isTranslucencyCapable(GraphicsConfiguration gc) {
|
||||||
|
if (gc == null) {
|
||||||
|
throw new NullPointerException("The gc argument should not be null");
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
return gc.isTranslucencyCapable();
|
||||||
|
*/
|
||||||
|
Toolkit curToolkit = Toolkit.getDefaultToolkit();
|
||||||
|
if (!(curToolkit instanceof SunToolkit)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return ((SunToolkit)curToolkit).isTranslucencyCapable(gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets a 'mixing-cutout' shape for the given component.
|
||||||
|
*
|
||||||
|
* By default a lightweight component is treated as an opaque rectangle for
|
||||||
|
* the purposes of the Heavyweight/Lightweight Components Mixing feature.
|
||||||
|
* This method enables developers to set an arbitrary shape to be cut out
|
||||||
|
* from heavyweight components positioned underneath the lightweight
|
||||||
|
* component in the z-order.
|
||||||
|
* <p>
|
||||||
|
* The {@code shape} argument may have the following values:
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code null} - reverts the default cutout shape (the rectangle equal
|
||||||
|
* to the component's {@code getBounds()})
|
||||||
|
* <li><i>empty-shape</i> - does not cut out anything from heavyweight
|
||||||
|
* components. This makes the given lightweight component effectively
|
||||||
|
* transparent. Note that descendants of the lightweight component still
|
||||||
|
* affect the shapes of heavyweight components. An example of an
|
||||||
|
* <i>empty-shape</i> is {@code new Rectangle()}.
|
||||||
|
* <li><i>non-empty-shape</i> - the given shape will be cut out from
|
||||||
|
* heavyweight components.
|
||||||
|
* </ul>
|
||||||
|
* <p>
|
||||||
|
* The most common example when the 'mixing-cutout' shape is needed is a
|
||||||
|
* glass pane component. The {@link JRootPane#setGlassPane()} method
|
||||||
|
* automatically sets the <i>empty-shape</i> as the 'mixing-cutout' shape
|
||||||
|
* for the given glass pane component. If a developer needs some other
|
||||||
|
* 'mixing-cutout' shape for the glass pane (which is rare), this must be
|
||||||
|
* changed manually after installing the glass pane to the root pane.
|
||||||
|
* <p>
|
||||||
|
* Note that the 'mixing-cutout' shape neither affects painting, nor the
|
||||||
|
* mouse events handling for the given component. It is used exclusively
|
||||||
|
* for the purposes of the Heavyweight/Lightweight Components Mixing
|
||||||
|
* feature.
|
||||||
|
*
|
||||||
|
* @param component the component that needs non-default
|
||||||
|
* 'mixing-cutout' shape
|
||||||
|
* @param shape the new 'mixing-cutout' shape
|
||||||
|
* @throws NullPointerException if the component argument is {@code null}
|
||||||
|
*/
|
||||||
|
public static void setComponentMixingCutoutShape(Component component,
|
||||||
|
Shape shape)
|
||||||
|
{
|
||||||
|
if (component == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The component argument should not be null.");
|
||||||
|
}
|
||||||
|
|
||||||
|
AWTAccessor.getComponentAccessor().setMixingCutoutShape(component,
|
||||||
|
shape);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
169
src/main/resources/jdk8/com/sun/awt/SecurityWarning.java
Normal file
169
src/main/resources/jdk8/com/sun/awt/SecurityWarning.java
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.sun.awt;
|
||||||
|
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.geom.*;
|
||||||
|
|
||||||
|
import sun.awt.AWTAccessor;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Security Warning control interface.
|
||||||
|
*
|
||||||
|
* This class provides a couple of methods that help a developer relocate
|
||||||
|
* the AWT security warning to an appropriate position relative to the current
|
||||||
|
* window size. A "top-level window" is an instance of the {@code Window}
|
||||||
|
* class (or its descendant, such as {@code JFrame}). The security warning
|
||||||
|
* is applied to all windows created by an untrusted code. All such windows
|
||||||
|
* have a non-null "warning string" (see {@link Window#getWarningString()}).
|
||||||
|
* <p>
|
||||||
|
* <b>WARNING</b>: This class is an implementation detail and only meant
|
||||||
|
* for limited use outside of the core platform. This API may change
|
||||||
|
* drastically between update release, and it may even be
|
||||||
|
* removed or be moved to some other packages or classes.
|
||||||
|
*/
|
||||||
|
public final class SecurityWarning {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The SecurityWarning class should not be instantiated
|
||||||
|
*/
|
||||||
|
private SecurityWarning() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the size of the security warning.
|
||||||
|
*
|
||||||
|
* The returned value is not valid until the peer has been created. Before
|
||||||
|
* invoking this method a developer must call the {@link Window#pack()},
|
||||||
|
* {@link Window#setVisible()}, or some other method that creates the peer.
|
||||||
|
*
|
||||||
|
* @param window the window to get the security warning size for
|
||||||
|
*
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
* @throws IllegalArgumentException if the window is trusted (i.e.
|
||||||
|
* the {@code getWarningString()} returns null)
|
||||||
|
*/
|
||||||
|
public static Dimension getSize(Window window) {
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
if (window.getWarningString() == null) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"The window must have a non-null warning string.");
|
||||||
|
}
|
||||||
|
// We don't check for a non-null peer since it may be destroyed
|
||||||
|
// after assigning a valid value to the security warning size.
|
||||||
|
|
||||||
|
return AWTAccessor.getWindowAccessor().getSecurityWarningSize(window);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the position of the security warning.
|
||||||
|
* <p>
|
||||||
|
* The {@code alignmentX} and {@code alignmentY} arguments specify the
|
||||||
|
* origin of the coordinate system used to calculate the position of the
|
||||||
|
* security warning. The values must be in the range [0.0f...1.0f]. The
|
||||||
|
* {@code 0.0f} value represents the left (top) edge of the rectangular
|
||||||
|
* bounds of the window. The {@code 1.0f} value represents the right
|
||||||
|
* (bottom) edge of the bounds. Whenever the size of the window changes,
|
||||||
|
* the origin of the coordinate system gets relocated accordingly. For
|
||||||
|
* convenience a developer may use the {@code Component.*_ALIGNMENT}
|
||||||
|
* constants to pass predefined values for these arguments.
|
||||||
|
* <p>
|
||||||
|
* The {@code point} argument specifies the location of the security
|
||||||
|
* warning in the coordinate system described above. If both {@code x} and
|
||||||
|
* {@code y} coordinates of the point are equal to zero, the warning will
|
||||||
|
* be located right in the origin of the coordinate system. On the other
|
||||||
|
* hand, if both {@code alignmentX} and {@code alignmentY} are equal to
|
||||||
|
* zero (i.e. the origin of the coordinate system is placed at the top-left
|
||||||
|
* corner of the window), then the {@code point} argument represents the
|
||||||
|
* absolute location of the security warning relative to the location of
|
||||||
|
* the window. The "absolute" in this case means that the position of the
|
||||||
|
* security warning is not effected by resizing of the window.
|
||||||
|
* <p>
|
||||||
|
* Note that the security warning managment code guarantees that:
|
||||||
|
* <ul>
|
||||||
|
* <li>The security warning cannot be located farther than two pixels from
|
||||||
|
* the rectangular bounds of the window (see {@link Window#getBounds}), and
|
||||||
|
* <li>The security warning is always visible on the screen.
|
||||||
|
* </ul>
|
||||||
|
* If either of the conditions is violated, the calculated position of the
|
||||||
|
* security warning is adjusted by the system to meet both these
|
||||||
|
* conditions.
|
||||||
|
* <p>
|
||||||
|
* The default position of the security warning is in the upper-right
|
||||||
|
* corner of the window, two pixels to the right from the right edge. This
|
||||||
|
* corresponds to the following arguments passed to this method:
|
||||||
|
* <ul>
|
||||||
|
* <li>{@code alignmentX = Component.RIGHT_ALIGNMENT}
|
||||||
|
* <li>{@code alignmentY = Component.TOP_ALIGNMENT}
|
||||||
|
* <li>{@code point = (2, 0)}
|
||||||
|
* </ul>
|
||||||
|
*
|
||||||
|
* @param window the window to set the position of the security warning for
|
||||||
|
* @param alignmentX the horizontal origin of the coordinate system
|
||||||
|
* @param alignmentY the vertical origin of the coordinate system
|
||||||
|
* @param point the position of the security warning in the specified
|
||||||
|
* coordinate system
|
||||||
|
*
|
||||||
|
* @throws NullPointerException if the window argument is null
|
||||||
|
* @throws NullPointerException if the point argument is null
|
||||||
|
* @throws IllegalArgumentException if the window is trusted (i.e.
|
||||||
|
* the {@code getWarningString()} returns null
|
||||||
|
* @throws IllegalArgumentException if the alignmentX or alignmentY
|
||||||
|
* arguments are not within the range [0.0f ... 1.0f]
|
||||||
|
*/
|
||||||
|
public static void setPosition(Window window, Point2D point,
|
||||||
|
float alignmentX, float alignmentY)
|
||||||
|
{
|
||||||
|
if (window == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The window argument should not be null.");
|
||||||
|
}
|
||||||
|
if (window.getWarningString() == null) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"The window must have a non-null warning string.");
|
||||||
|
}
|
||||||
|
if (point == null) {
|
||||||
|
throw new NullPointerException(
|
||||||
|
"The point argument must not be null");
|
||||||
|
}
|
||||||
|
if (alignmentX < 0.0f || alignmentX > 1.0f) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"alignmentX must be in the range [0.0f ... 1.0f].");
|
||||||
|
}
|
||||||
|
if (alignmentY < 0.0f || alignmentY > 1.0f) {
|
||||||
|
throw new IllegalArgumentException(
|
||||||
|
"alignmentY must be in the range [0.0f ... 1.0f].");
|
||||||
|
}
|
||||||
|
|
||||||
|
AWTAccessor.getWindowAccessor().setSecurityWarningPosition(window,
|
||||||
|
point, alignmentX, alignmentY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
378
src/main/resources/jdk8/com/sun/beans/TypeResolver.java
Normal file
378
src/main/resources/jdk8/com/sun/beans/TypeResolver.java
Normal file
@@ -0,0 +1,378 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.lang.reflect.GenericArrayType;
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.lang.reflect.TypeVariable;
|
||||||
|
import java.lang.reflect.WildcardType;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl;
|
||||||
|
import sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is utility class to resolve types.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Eamonn McManus
|
||||||
|
* @author Sergey Malenkov
|
||||||
|
*/
|
||||||
|
public final class TypeResolver {
|
||||||
|
|
||||||
|
private static final WeakCache<Type, Map<Type, Type>> CACHE = new WeakCache<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces the given {@code type} in an inherited method
|
||||||
|
* with the actual type it has in the given {@code inClass}.
|
||||||
|
*
|
||||||
|
* <p>Although type parameters are not inherited by subclasses in the Java
|
||||||
|
* language, they <em>are</em> effectively inherited when using reflection.
|
||||||
|
* For example, if you declare an interface like this...</p>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* public interface StringToIntMap extends Map<String,Integer> {}
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <p>...then StringToIntMap.class.getMethods() will show that it has methods
|
||||||
|
* like put(K,V) even though StringToIntMap has no type parameters. The K
|
||||||
|
* and V variables are the ones declared by Map, so
|
||||||
|
* {@link TypeVariable#getGenericDeclaration()} will return Map.class.</p>
|
||||||
|
*
|
||||||
|
* <p>The purpose of this method is to take a Type from a possibly-inherited
|
||||||
|
* method and replace it with the correct Type for the inheriting class.
|
||||||
|
* So given parameters of K and StringToIntMap.class in the above example,
|
||||||
|
* this method will return String.</p>
|
||||||
|
*
|
||||||
|
* @param inClass the base class used to resolve
|
||||||
|
* @param type the type to resolve
|
||||||
|
* @return a resolved type
|
||||||
|
*
|
||||||
|
* @see #getActualType(Class)
|
||||||
|
* @see #resolve(Type,Type)
|
||||||
|
*/
|
||||||
|
public static Type resolveInClass(Class<?> inClass, Type type) {
|
||||||
|
return resolve(getActualType(inClass), type);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces all {@code types} in the given array
|
||||||
|
* with the actual types they have in the given {@code inClass}.
|
||||||
|
*
|
||||||
|
* @param inClass the base class used to resolve
|
||||||
|
* @param types the array of types to resolve
|
||||||
|
* @return an array of resolved types
|
||||||
|
*
|
||||||
|
* @see #getActualType(Class)
|
||||||
|
* @see #resolve(Type,Type[])
|
||||||
|
*/
|
||||||
|
public static Type[] resolveInClass(Class<?> inClass, Type[] types) {
|
||||||
|
return resolve(getActualType(inClass), types);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces type variables of the given {@code formal} type
|
||||||
|
* with the types they stand for in the given {@code actual} type.
|
||||||
|
*
|
||||||
|
* <p>A ParameterizedType is a class with type parameters, and the values
|
||||||
|
* of those parameters. For example, Map<K,V> is a generic class, and
|
||||||
|
* a corresponding ParameterizedType might look like
|
||||||
|
* Map<K=String,V=Integer>. Given such a ParameterizedType, this method
|
||||||
|
* will replace K with String, or List<K> with List<String;, or
|
||||||
|
* List<? super K> with List<? super String>.</p>
|
||||||
|
*
|
||||||
|
* <p>The {@code actual} argument to this method can also be a Class.
|
||||||
|
* In this case, either it is equivalent to a ParameterizedType with
|
||||||
|
* no parameters (for example, Integer.class), or it is equivalent to
|
||||||
|
* a "raw" ParameterizedType (for example, Map.class). In the latter
|
||||||
|
* case, every type parameter declared or inherited by the class is replaced
|
||||||
|
* by its "erasure". For a type parameter declared as <T>, the erasure
|
||||||
|
* is Object. For a type parameter declared as <T extends Number>,
|
||||||
|
* the erasure is Number.</p>
|
||||||
|
*
|
||||||
|
* <p>Although type parameters are not inherited by subclasses in the Java
|
||||||
|
* language, they <em>are</em> effectively inherited when using reflection.
|
||||||
|
* For example, if you declare an interface like this...</p>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* public interface StringToIntMap extends Map<String,Integer> {}
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <p>...then StringToIntMap.class.getMethods() will show that it has methods
|
||||||
|
* like put(K,V) even though StringToIntMap has no type parameters. The K
|
||||||
|
* and V variables are the ones declared by Map, so
|
||||||
|
* {@link TypeVariable#getGenericDeclaration()} will return {@link Map Map.class}.</p>
|
||||||
|
*
|
||||||
|
* <p>For this reason, this method replaces inherited type parameters too.
|
||||||
|
* Therefore if this method is called with {@code actual} being
|
||||||
|
* StringToIntMap.class and {@code formal} being the K from Map,
|
||||||
|
* it will return {@link String String.class}.</p>
|
||||||
|
*
|
||||||
|
* <p>In the case where {@code actual} is a "raw" ParameterizedType, the
|
||||||
|
* inherited type parameters will also be replaced by their erasures.
|
||||||
|
* The erasure of a Class is the Class itself, so a "raw" subinterface of
|
||||||
|
* StringToIntMap will still show the K from Map as String.class. But
|
||||||
|
* in a case like this...
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* public interface StringToIntListMap extends Map<String,List<Integer>> {}
|
||||||
|
* public interface RawStringToIntListMap extends StringToIntListMap {}
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <p>...the V inherited from Map will show up as List<Integer> in
|
||||||
|
* StringToIntListMap, but as plain List in RawStringToIntListMap.</p>
|
||||||
|
*
|
||||||
|
* @param actual the type that supplies bindings for type variables
|
||||||
|
* @param formal the type where occurrences of the variables
|
||||||
|
* in {@code actual} will be replaced by the corresponding bound values
|
||||||
|
* @return a resolved type
|
||||||
|
*/
|
||||||
|
public static Type resolve(Type actual, Type formal) {
|
||||||
|
if (formal instanceof Class) {
|
||||||
|
return formal;
|
||||||
|
}
|
||||||
|
if (formal instanceof GenericArrayType) {
|
||||||
|
Type comp = ((GenericArrayType) formal).getGenericComponentType();
|
||||||
|
comp = resolve(actual, comp);
|
||||||
|
return (comp instanceof Class)
|
||||||
|
? Array.newInstance((Class<?>) comp, 0).getClass()
|
||||||
|
: GenericArrayTypeImpl.make(comp);
|
||||||
|
}
|
||||||
|
if (formal instanceof ParameterizedType) {
|
||||||
|
ParameterizedType fpt = (ParameterizedType) formal;
|
||||||
|
Type[] actuals = resolve(actual, fpt.getActualTypeArguments());
|
||||||
|
return ParameterizedTypeImpl.make(
|
||||||
|
(Class<?>) fpt.getRawType(), actuals, fpt.getOwnerType());
|
||||||
|
}
|
||||||
|
if (formal instanceof WildcardType) {
|
||||||
|
WildcardType fwt = (WildcardType) formal;
|
||||||
|
Type[] upper = resolve(actual, fwt.getUpperBounds());
|
||||||
|
Type[] lower = resolve(actual, fwt.getLowerBounds());
|
||||||
|
return new WildcardTypeImpl(upper, lower);
|
||||||
|
}
|
||||||
|
if (formal instanceof TypeVariable) {
|
||||||
|
Map<Type, Type> map;
|
||||||
|
synchronized (CACHE) {
|
||||||
|
map = CACHE.get(actual);
|
||||||
|
if (map == null) {
|
||||||
|
map = new HashMap<>();
|
||||||
|
prepare(map, actual);
|
||||||
|
CACHE.put(actual, map);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Type result = map.get(formal);
|
||||||
|
if (result == null || result.equals(formal)) {
|
||||||
|
return formal;
|
||||||
|
}
|
||||||
|
result = fixGenericArray(result);
|
||||||
|
// A variable can be bound to another variable that is itself bound
|
||||||
|
// to something. For example, given:
|
||||||
|
// class Super<T> {...}
|
||||||
|
// class Mid<X> extends Super<T> {...}
|
||||||
|
// class Sub extends Mid<String>
|
||||||
|
// the variable T is bound to X, which is in turn bound to String.
|
||||||
|
// So if we have to resolve T, we need the tail recursion here.
|
||||||
|
return resolve(actual, result);
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Bad Type kind: " + formal.getClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces type variables of all formal types in the given array
|
||||||
|
* with the types they stand for in the given {@code actual} type.
|
||||||
|
*
|
||||||
|
* @param actual the type that supplies bindings for type variables
|
||||||
|
* @param formals the array of types to resolve
|
||||||
|
* @return an array of resolved types
|
||||||
|
*/
|
||||||
|
public static Type[] resolve(Type actual, Type[] formals) {
|
||||||
|
int length = formals.length;
|
||||||
|
Type[] actuals = new Type[length];
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
actuals[i] = resolve(actual, formals[i]);
|
||||||
|
}
|
||||||
|
return actuals;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts the given {@code type} to the corresponding class.
|
||||||
|
* This method implements the concept of type erasure,
|
||||||
|
* that is described in section 4.6 of
|
||||||
|
* <cite>The Java™ Language Specification</cite>.
|
||||||
|
*
|
||||||
|
* @param type the array of types to convert
|
||||||
|
* @return a corresponding class
|
||||||
|
*/
|
||||||
|
public static Class<?> erase(Type type) {
|
||||||
|
if (type instanceof Class) {
|
||||||
|
return (Class<?>) type;
|
||||||
|
}
|
||||||
|
if (type instanceof ParameterizedType) {
|
||||||
|
ParameterizedType pt = (ParameterizedType) type;
|
||||||
|
return (Class<?>) pt.getRawType();
|
||||||
|
}
|
||||||
|
if (type instanceof TypeVariable) {
|
||||||
|
TypeVariable tv = (TypeVariable)type;
|
||||||
|
Type[] bounds = tv.getBounds();
|
||||||
|
return (0 < bounds.length)
|
||||||
|
? erase(bounds[0])
|
||||||
|
: Object.class;
|
||||||
|
}
|
||||||
|
if (type instanceof WildcardType) {
|
||||||
|
WildcardType wt = (WildcardType)type;
|
||||||
|
Type[] bounds = wt.getUpperBounds();
|
||||||
|
return (0 < bounds.length)
|
||||||
|
? erase(bounds[0])
|
||||||
|
: Object.class;
|
||||||
|
}
|
||||||
|
if (type instanceof GenericArrayType) {
|
||||||
|
GenericArrayType gat = (GenericArrayType)type;
|
||||||
|
return Array.newInstance(erase(gat.getGenericComponentType()), 0).getClass();
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unknown Type kind: " + type.getClass());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts all {@code types} in the given array
|
||||||
|
* to the corresponding classes.
|
||||||
|
*
|
||||||
|
* @param types the array of types to convert
|
||||||
|
* @return an array of corresponding classes
|
||||||
|
*
|
||||||
|
* @see #erase(Type)
|
||||||
|
*/
|
||||||
|
public static Class[] erase(Type[] types) {
|
||||||
|
int length = types.length;
|
||||||
|
Class[] classes = new Class[length];
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
classes[i] = TypeResolver.erase(types[i]);
|
||||||
|
}
|
||||||
|
return classes;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fills the map from type parameters
|
||||||
|
* to types as seen by the given {@code type}.
|
||||||
|
* The method is recursive because the {@code type}
|
||||||
|
* inherits mappings from its parent classes and interfaces.
|
||||||
|
* The {@code type} can be either a {@link Class Class}
|
||||||
|
* or a {@link ParameterizedType ParameterizedType}.
|
||||||
|
* If it is a {@link Class Class}, it is either equivalent
|
||||||
|
* to a {@link ParameterizedType ParameterizedType} with no parameters,
|
||||||
|
* or it represents the erasure of a {@link ParameterizedType ParameterizedType}.
|
||||||
|
*
|
||||||
|
* @param map the mappings of all type variables
|
||||||
|
* @param type the next type in the hierarchy
|
||||||
|
*/
|
||||||
|
private static void prepare(Map<Type, Type> map, Type type) {
|
||||||
|
Class<?> raw = (Class<?>)((type instanceof Class<?>)
|
||||||
|
? type
|
||||||
|
: ((ParameterizedType)type).getRawType());
|
||||||
|
|
||||||
|
TypeVariable<?>[] formals = raw.getTypeParameters();
|
||||||
|
|
||||||
|
Type[] actuals = (type instanceof Class<?>)
|
||||||
|
? formals
|
||||||
|
: ((ParameterizedType)type).getActualTypeArguments();
|
||||||
|
|
||||||
|
assert formals.length == actuals.length;
|
||||||
|
for (int i = 0; i < formals.length; i++) {
|
||||||
|
map.put(formals[i], actuals[i]);
|
||||||
|
}
|
||||||
|
Type gSuperclass = raw.getGenericSuperclass();
|
||||||
|
if (gSuperclass != null) {
|
||||||
|
prepare(map, gSuperclass);
|
||||||
|
}
|
||||||
|
for (Type gInterface : raw.getGenericInterfaces()) {
|
||||||
|
prepare(map, gInterface);
|
||||||
|
}
|
||||||
|
// If type is the raw version of a parameterized class, we type-erase
|
||||||
|
// all of its type variables, including inherited ones.
|
||||||
|
if (type instanceof Class<?> && formals.length > 0) {
|
||||||
|
for (Map.Entry<Type, Type> entry : map.entrySet()) {
|
||||||
|
entry.setValue(erase(entry.getValue()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces a {@link GenericArrayType GenericArrayType}
|
||||||
|
* with plain array class where it is possible.
|
||||||
|
* Bug <a href="http://bugs.sun.com/view_bug.do?bug_id=5041784">5041784</a>
|
||||||
|
* is that arrays of non-generic type sometimes show up
|
||||||
|
* as {@link GenericArrayType GenericArrayType} when using reflection.
|
||||||
|
* For example, a {@code String[]} might show up
|
||||||
|
* as a {@link GenericArrayType GenericArrayType}
|
||||||
|
* where {@link GenericArrayType#getGenericComponentType getGenericComponentType}
|
||||||
|
* is {@code String.class}. This violates the specification,
|
||||||
|
* which says that {@link GenericArrayType GenericArrayType}
|
||||||
|
* is used when the component type is a type variable or parameterized type.
|
||||||
|
* We fit the specification here.
|
||||||
|
*
|
||||||
|
* @param type the type to fix
|
||||||
|
* @return a corresponding type for the generic array type,
|
||||||
|
* or the same type as {@code type}
|
||||||
|
*/
|
||||||
|
private static Type fixGenericArray(Type type) {
|
||||||
|
if (type instanceof GenericArrayType) {
|
||||||
|
Type comp = ((GenericArrayType)type).getGenericComponentType();
|
||||||
|
comp = fixGenericArray(comp);
|
||||||
|
if (comp instanceof Class) {
|
||||||
|
return Array.newInstance((Class<?>)comp, 0).getClass();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces a {@link Class Class} with type parameters
|
||||||
|
* with a {@link ParameterizedType ParameterizedType}
|
||||||
|
* where every parameter is bound to itself.
|
||||||
|
* When calling {@link #resolveInClass} in the context of {@code inClass},
|
||||||
|
* we can't just pass {@code inClass} as the {@code actual} parameter,
|
||||||
|
* because if {@code inClass} has type parameters
|
||||||
|
* that would be interpreted as accessing the raw type,
|
||||||
|
* so we would get unwanted erasure.
|
||||||
|
* This is why we bind each parameter to itself.
|
||||||
|
* If {@code inClass} does have type parameters and has methods
|
||||||
|
* where those parameters appear in the return type or argument types,
|
||||||
|
* we will correctly leave those types alone.
|
||||||
|
*
|
||||||
|
* @param inClass the base class used to resolve
|
||||||
|
* @return a parameterized type for the class,
|
||||||
|
* or the same class as {@code inClass}
|
||||||
|
*/
|
||||||
|
private static Type getActualType(Class<?> inClass) {
|
||||||
|
Type[] params = inClass.getTypeParameters();
|
||||||
|
return (params.length == 0)
|
||||||
|
? inClass
|
||||||
|
: ParameterizedTypeImpl.make(
|
||||||
|
inClass, params, inClass.getEnclosingClass());
|
||||||
|
}
|
||||||
|
}
|
||||||
91
src/main/resources/jdk8/com/sun/beans/WeakCache.java
Normal file
91
src/main/resources/jdk8/com/sun/beans/WeakCache.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans;
|
||||||
|
|
||||||
|
import java.lang.ref.Reference;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.WeakHashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A hashtable-based cache with weak keys and weak values.
|
||||||
|
* An entry in the map will be automatically removed
|
||||||
|
* when its key is no longer in the ordinary use.
|
||||||
|
* A value will be automatically removed as well
|
||||||
|
* when it is no longer in the ordinary use.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
public final class WeakCache<K, V> {
|
||||||
|
private final Map<K, Reference<V>> map = new WeakHashMap<K, Reference<V>>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a value to which the specified {@code key} is mapped,
|
||||||
|
* or {@code null} if this map contains no mapping for the {@code key}.
|
||||||
|
*
|
||||||
|
* @param key the key whose associated value is returned
|
||||||
|
* @return a value to which the specified {@code key} is mapped
|
||||||
|
*/
|
||||||
|
public V get(K key) {
|
||||||
|
Reference<V> reference = this.map.get(key);
|
||||||
|
if (reference == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
V value = reference.get();
|
||||||
|
if (value == null) {
|
||||||
|
this.map.remove(key);
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Associates the specified {@code value} with the specified {@code key}.
|
||||||
|
* Removes the mapping for the specified {@code key} from this cache
|
||||||
|
* if it is present and the specified {@code value} is {@code null}.
|
||||||
|
* If the cache previously contained a mapping for the {@code key},
|
||||||
|
* the old value is replaced by the specified {@code value}.
|
||||||
|
*
|
||||||
|
* @param key the key with which the specified value is associated
|
||||||
|
* @param value the value to be associated with the specified key
|
||||||
|
*/
|
||||||
|
public void put(K key, V value) {
|
||||||
|
if (value != null) {
|
||||||
|
this.map.put(key, new WeakReference<V>(value));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.map.remove(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all of the mappings from this cache.
|
||||||
|
*/
|
||||||
|
public void clear() {
|
||||||
|
this.map.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
161
src/main/resources/jdk8/com/sun/beans/WildcardTypeImpl.java
Normal file
161
src/main/resources/jdk8/com/sun/beans/WildcardTypeImpl.java
Normal file
@@ -0,0 +1,161 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.lang.reflect.WildcardType;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class implements {@link WildcardType WildcardType} compatibly with the JDK's
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
|
||||||
|
* Unfortunately we can't use the JDK's
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl} here as we do for
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl ParameterizedTypeImpl} and
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.GenericArrayTypeImpl GenericArrayTypeImpl},
|
||||||
|
* because {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}'s
|
||||||
|
* constructor takes parameters representing intermediate structures obtained during class-file parsing.
|
||||||
|
* We could reconstruct versions of those structures but it would be more trouble than it's worth.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Eamonn McManus
|
||||||
|
* @author Sergey Malenkov
|
||||||
|
*/
|
||||||
|
final class WildcardTypeImpl implements WildcardType {
|
||||||
|
private final Type[] upperBounds;
|
||||||
|
private final Type[] lowerBounds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a wildcard type with the requested bounds.
|
||||||
|
* Note that the array arguments are not cloned
|
||||||
|
* because instances of this class are never constructed
|
||||||
|
* from outside the containing package.
|
||||||
|
*
|
||||||
|
* @param upperBounds the array of types representing
|
||||||
|
* the upper bound(s) of this type variable
|
||||||
|
* @param lowerBounds the array of types representing
|
||||||
|
* the lower bound(s) of this type variable
|
||||||
|
*/
|
||||||
|
WildcardTypeImpl(Type[] upperBounds, Type[] lowerBounds) {
|
||||||
|
this.upperBounds = upperBounds;
|
||||||
|
this.lowerBounds = lowerBounds;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of {@link Type Type} objects
|
||||||
|
* representing the upper bound(s) of this type variable.
|
||||||
|
* Note that if no upper bound is explicitly declared,
|
||||||
|
* the upper bound is {@link Object Object}.
|
||||||
|
*
|
||||||
|
* @return an array of types representing
|
||||||
|
* the upper bound(s) of this type variable
|
||||||
|
*/
|
||||||
|
public Type[] getUpperBounds() {
|
||||||
|
return this.upperBounds.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of {@link Type Type} objects
|
||||||
|
* representing the lower bound(s) of this type variable.
|
||||||
|
* Note that if no lower bound is explicitly declared,
|
||||||
|
* the lower bound is the type of {@code null}.
|
||||||
|
* In this case, a zero length array is returned.
|
||||||
|
*
|
||||||
|
* @return an array of types representing
|
||||||
|
* the lower bound(s) of this type variable
|
||||||
|
*/
|
||||||
|
public Type[] getLowerBounds() {
|
||||||
|
return this.lowerBounds.clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether some other object is "equal to" this one.
|
||||||
|
* It is implemented compatibly with the JDK's
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
|
||||||
|
*
|
||||||
|
* @param object the reference object with which to compare
|
||||||
|
* @return {@code true} if this object is the same as the object argument;
|
||||||
|
* {@code false} otherwise
|
||||||
|
* @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#equals
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object object) {
|
||||||
|
if (object instanceof WildcardType) {
|
||||||
|
WildcardType type = (WildcardType) object;
|
||||||
|
return Arrays.equals(this.upperBounds, type.getUpperBounds())
|
||||||
|
&& Arrays.equals(this.lowerBounds, type.getLowerBounds());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a hash code value for the object.
|
||||||
|
* It is implemented compatibly with the JDK's
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
|
||||||
|
*
|
||||||
|
* @return a hash code value for this object
|
||||||
|
* @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#hashCode
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
return Arrays.hashCode(this.upperBounds)
|
||||||
|
^ Arrays.hashCode(this.lowerBounds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a string representation of the object.
|
||||||
|
* It is implemented compatibly with the JDK's
|
||||||
|
* {@link sun.reflect.generics.reflectiveObjects.WildcardTypeImpl WildcardTypeImpl}.
|
||||||
|
*
|
||||||
|
* @return a string representation of the object
|
||||||
|
* @see sun.reflect.generics.reflectiveObjects.WildcardTypeImpl#toString
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb;
|
||||||
|
Type[] bounds;
|
||||||
|
if (this.lowerBounds.length == 0) {
|
||||||
|
if (this.upperBounds.length == 0 || Object.class == this.upperBounds[0]) {
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
bounds = this.upperBounds;
|
||||||
|
sb = new StringBuilder("? extends ");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bounds = this.lowerBounds;
|
||||||
|
sb = new StringBuilder("? super ");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < bounds.length; i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
sb.append(" & ");
|
||||||
|
}
|
||||||
|
sb.append((bounds[i] instanceof Class)
|
||||||
|
? ((Class) bounds[i]).getName()
|
||||||
|
: bounds[i].toString());
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This is base class that simplifies access to entities (fields or properties).
|
||||||
|
* The {@code name} attribute specifies the name of the accessible entity.
|
||||||
|
* The element defines getter if it contains no argument
|
||||||
|
* or setter if it contains one argument.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
abstract class AccessorElementHandler extends ElementHandler {
|
||||||
|
private String name;
|
||||||
|
private ValueObject value;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the name of the accessible entity
|
||||||
|
* <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("name")) { // NON-NLS: the attribute name
|
||||||
|
this.name = value;
|
||||||
|
} else {
|
||||||
|
super.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the argument that is used to set 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.value != null) {
|
||||||
|
throw new IllegalStateException("Could not add argument to evaluated element");
|
||||||
|
}
|
||||||
|
setValue(this.name, argument);
|
||||||
|
this.value = ValueObjectImpl.VOID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of this element.
|
||||||
|
*
|
||||||
|
* @return the value of this element
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected final ValueObject getValueObject() {
|
||||||
|
if (this.value == null) {
|
||||||
|
this.value = ValueObjectImpl.create(getValue(this.name));
|
||||||
|
}
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the entity with specified {@code name}.
|
||||||
|
*
|
||||||
|
* @param name the name of the accessible entity
|
||||||
|
* @return the value of the specified entity
|
||||||
|
*/
|
||||||
|
protected abstract Object getValue(String name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the new value for the entity with specified {@code name}.
|
||||||
|
*
|
||||||
|
* @param name the name of the accessible entity
|
||||||
|
* @param value the new value for the specified entity
|
||||||
|
*/
|
||||||
|
protected abstract void setValue(String name, Object value);
|
||||||
|
}
|
||||||
@@ -0,0 +1,147 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <array> element,
|
||||||
|
* that is used to array creation.
|
||||||
|
* The {@code length} attribute specifies the length of the array.
|
||||||
|
* The {@code class} attribute specifies the elements type.
|
||||||
|
* The {@link Object} type is used by default.
|
||||||
|
* For example:<pre>
|
||||||
|
* <array length="10"/></pre>
|
||||||
|
* is equivalent to {@code new Component[10]} in Java code.
|
||||||
|
* The {@code set} and {@code get} methods,
|
||||||
|
* as defined in the {@link java.util.List} interface,
|
||||||
|
* can be used as if they could be applied to array instances.
|
||||||
|
* The {@code index} attribute can thus be used with arrays.
|
||||||
|
* For example:<pre>
|
||||||
|
* <array length="3" class="java.lang.String">
|
||||||
|
* <void index="1">
|
||||||
|
* <string>Hello, world</string>
|
||||||
|
* </void>
|
||||||
|
* </array></pre>
|
||||||
|
* is equivalent to the following Java code:<pre>
|
||||||
|
* String[] s = new String[3];
|
||||||
|
* s[1] = "Hello, world";</pre>
|
||||||
|
* It is possible to omit the {@code length} attribute and
|
||||||
|
* specify the values directly, without using {@code void} tags.
|
||||||
|
* The length of the array is equal to the number of values specified.
|
||||||
|
* For example:<pre>
|
||||||
|
* <array id="array" class="int">
|
||||||
|
* <int>123</int>
|
||||||
|
* <int>456</int>
|
||||||
|
* </array></pre>
|
||||||
|
* is equivalent to {@code int[] array = {123, 456}} in Java code.
|
||||||
|
* <p>The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>length
|
||||||
|
* <dd>the array length
|
||||||
|
* <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
|
||||||
|
*/
|
||||||
|
final class ArrayElementHandler extends NewElementHandler {
|
||||||
|
private Integer length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>length
|
||||||
|
* <dd>the array length
|
||||||
|
* <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("length")) { // NON-NLS: the attribute name
|
||||||
|
this.length = Integer.valueOf(value);
|
||||||
|
} else {
|
||||||
|
super.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the value of this element
|
||||||
|
* if the lentgh attribute is set.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void startElement() {
|
||||||
|
if (this.length != null) {
|
||||||
|
getValueObject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 can be used
|
||||||
|
* as an argument of the element that contained in this one,
|
||||||
|
* {@code false} otherwise
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean isArgument() {
|
||||||
|
return true; // hack for compatibility
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates an instance of the array.
|
||||||
|
*
|
||||||
|
* @param type the base class
|
||||||
|
* @param args the array of arguments
|
||||||
|
* @return the value of this element
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected ValueObject getValueObject(Class<?> type, Object[] args) {
|
||||||
|
if (type == null) {
|
||||||
|
type = Object.class;
|
||||||
|
}
|
||||||
|
if (this.length != null) {
|
||||||
|
return ValueObjectImpl.create(Array.newInstance(type, this.length));
|
||||||
|
}
|
||||||
|
Object array = Array.newInstance(type, args.length);
|
||||||
|
for (int i = 0; i < args.length; i++) {
|
||||||
|
Array.set(array, i, args[i]);
|
||||||
|
}
|
||||||
|
return ValueObjectImpl.create(array);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <boolean> element.
|
||||||
|
* This element specifies {@code boolean} values.
|
||||||
|
* The class {@link Boolean} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <boolean>true</boolean></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="valueOf" class="java.lang.Boolean">
|
||||||
|
* <string>true</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Boolean.valueOf("true")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class BooleanElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code boolean} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code boolean} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
if (Boolean.TRUE.toString().equalsIgnoreCase(argument)) {
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
if (Boolean.FALSE.toString().equalsIgnoreCase(argument)) {
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
throw new IllegalArgumentException("Unsupported boolean argument: " + argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <byte> element.
|
||||||
|
* This element specifies {@code byte} values.
|
||||||
|
* The class {@link Byte} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <byte>127</byte></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="decode" class="java.lang.Byte">
|
||||||
|
* <string>127</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Byte.decode("127")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class ByteElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code byte} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code byte} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return Byte.decode(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <char> element.
|
||||||
|
* This element specifies {@code char} values.
|
||||||
|
* The class {@link Character} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <char>X</char></pre>
|
||||||
|
* which is equivalent to {@code Character.valueOf('X')} in Java code.
|
||||||
|
* <p>The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>code
|
||||||
|
* <dd>this attribute specifies character code
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
* The {@code code} attribute can be used for characters
|
||||||
|
* that are illegal in XML document, for example:<pre>
|
||||||
|
* <char code="0"/></pre>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class CharElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>code
|
||||||
|
* <dd>this attribute specifies character code
|
||||||
|
* <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("code")) { // NON-NLS: the attribute name
|
||||||
|
int code = Integer.decode(value);
|
||||||
|
for (char ch : Character.toChars(code)) {
|
||||||
|
addCharacter(ch);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
super.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code char} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code char} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
if (argument.length() != 1) {
|
||||||
|
throw new IllegalArgumentException("Wrong characters count");
|
||||||
|
}
|
||||||
|
return Character.valueOf(argument.charAt(0));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <class> element.
|
||||||
|
* This element specifies {@link Class} values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <class>java.lang.Class</class></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="forName" class="java.lang.Class">
|
||||||
|
* <string>java.lang.Class</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Class.forName("java.lang.Class")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class ClassElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates class by the name from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code Class} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return getOwner().findClass(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,411 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
import com.sun.beans.finder.ClassFinder;
|
||||||
|
|
||||||
|
import java.beans.ExceptionListener;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.StringReader;
|
||||||
|
|
||||||
|
import java.lang.ref.Reference;
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.security.AccessControlContext;
|
||||||
|
import java.security.AccessController;
|
||||||
|
import java.security.PrivilegedAction;
|
||||||
|
|
||||||
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
import javax.xml.parsers.SAXParserFactory;
|
||||||
|
|
||||||
|
import org.xml.sax.Attributes;
|
||||||
|
import org.xml.sax.InputSource;
|
||||||
|
import org.xml.sax.SAXException;
|
||||||
|
import org.xml.sax.helpers.DefaultHandler;
|
||||||
|
|
||||||
|
import sun.misc.SharedSecrets;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The main class to parse JavaBeans XML archive.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*
|
||||||
|
* @see ElementHandler
|
||||||
|
*/
|
||||||
|
public final class DocumentHandler extends DefaultHandler {
|
||||||
|
private final AccessControlContext acc = AccessController.getContext();
|
||||||
|
private final Map<String, Class<? extends ElementHandler>> handlers = new HashMap<>();
|
||||||
|
private final Map<String, Object> environment = new HashMap<>();
|
||||||
|
private final List<Object> objects = new ArrayList<>();
|
||||||
|
|
||||||
|
private Reference<ClassLoader> loader;
|
||||||
|
private ExceptionListener listener;
|
||||||
|
private Object owner;
|
||||||
|
|
||||||
|
private ElementHandler handler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates new instance of document handler.
|
||||||
|
*/
|
||||||
|
public DocumentHandler() {
|
||||||
|
setElementHandler("java", JavaElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("null", NullElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("array", ArrayElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("class", ClassElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("string", StringElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("object", ObjectElementHandler.class); // NON-NLS: the element name
|
||||||
|
|
||||||
|
setElementHandler("void", VoidElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("char", CharElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("byte", ByteElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("short", ShortElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("int", IntElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("long", LongElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("float", FloatElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("double", DoubleElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("boolean", BooleanElementHandler.class); // NON-NLS: the element name
|
||||||
|
|
||||||
|
// some handlers for new elements
|
||||||
|
setElementHandler("new", NewElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("var", VarElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("true", TrueElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("false", FalseElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("field", FieldElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("method", MethodElementHandler.class); // NON-NLS: the element name
|
||||||
|
setElementHandler("property", PropertyElementHandler.class); // NON-NLS: the element name
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the class loader used to instantiate objects.
|
||||||
|
* If the class loader has not been explicitly set
|
||||||
|
* then {@code null} is returned.
|
||||||
|
*
|
||||||
|
* @return the class loader used to instantiate objects
|
||||||
|
*/
|
||||||
|
public ClassLoader getClassLoader() {
|
||||||
|
return (this.loader != null)
|
||||||
|
? this.loader.get()
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the class loader used to instantiate objects.
|
||||||
|
* If the class loader is not set
|
||||||
|
* then default class loader will be used.
|
||||||
|
*
|
||||||
|
* @param loader a classloader to use
|
||||||
|
*/
|
||||||
|
public void setClassLoader(ClassLoader loader) {
|
||||||
|
this.loader = new WeakReference<ClassLoader>(loader);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the exception listener for parsing.
|
||||||
|
* The exception listener is notified
|
||||||
|
* when handler catches recoverable exceptions.
|
||||||
|
* If the exception listener has not been explicitly set
|
||||||
|
* then default exception listener is returned.
|
||||||
|
*
|
||||||
|
* @return the exception listener for parsing
|
||||||
|
*/
|
||||||
|
public ExceptionListener getExceptionListener() {
|
||||||
|
return this.listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the exception listener for parsing.
|
||||||
|
* The exception listener is notified
|
||||||
|
* when handler catches recoverable exceptions.
|
||||||
|
*
|
||||||
|
* @param listener the exception listener for parsing
|
||||||
|
*/
|
||||||
|
public void setExceptionListener(ExceptionListener listener) {
|
||||||
|
this.listener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the owner of this document handler.
|
||||||
|
*
|
||||||
|
* @return the owner of this document handler
|
||||||
|
*/
|
||||||
|
public Object getOwner() {
|
||||||
|
return this.owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the owner of this document handler.
|
||||||
|
*
|
||||||
|
* @param owner the owner of this document handler
|
||||||
|
*/
|
||||||
|
public void setOwner(Object owner) {
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the handler for the element with specified name.
|
||||||
|
*
|
||||||
|
* @param name the name of the element
|
||||||
|
* @return the corresponding element handler
|
||||||
|
*/
|
||||||
|
public Class<? extends ElementHandler> getElementHandler(String name) {
|
||||||
|
Class<? extends ElementHandler> type = this.handlers.get(name);
|
||||||
|
if (type == null) {
|
||||||
|
throw new IllegalArgumentException("Unsupported element: " + name);
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the handler for the element with specified name.
|
||||||
|
*
|
||||||
|
* @param name the name of the element
|
||||||
|
* @param handler the corresponding element handler
|
||||||
|
*/
|
||||||
|
public void setElementHandler(String name, Class<? extends ElementHandler> handler) {
|
||||||
|
this.handlers.put(name, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates whether the variable with specified identifier is defined.
|
||||||
|
*
|
||||||
|
* @param id the identifier
|
||||||
|
* @return @{code true} if the variable is defined;
|
||||||
|
* @{code false} otherwise
|
||||||
|
*/
|
||||||
|
public boolean hasVariable(String id) {
|
||||||
|
return this.environment.containsKey(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the variable with specified identifier.
|
||||||
|
*
|
||||||
|
* @param id the identifier
|
||||||
|
* @return the value of the variable
|
||||||
|
*/
|
||||||
|
public Object getVariable(String id) {
|
||||||
|
if (!this.environment.containsKey(id)) {
|
||||||
|
throw new IllegalArgumentException("Unbound variable: " + id);
|
||||||
|
}
|
||||||
|
return this.environment.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets new value of the variable with specified identifier.
|
||||||
|
*
|
||||||
|
* @param id the identifier
|
||||||
|
* @param value new value of the variable
|
||||||
|
*/
|
||||||
|
public void setVariable(String id, Object value) {
|
||||||
|
this.environment.put(id, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the array of readed objects.
|
||||||
|
*
|
||||||
|
* @return the array of readed objects
|
||||||
|
*/
|
||||||
|
public Object[] getObjects() {
|
||||||
|
return this.objects.toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the object to the list of readed objects.
|
||||||
|
*
|
||||||
|
* @param object the object that is readed from XML document
|
||||||
|
*/
|
||||||
|
void addObject(Object object) {
|
||||||
|
this.objects.add(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disables any external entities.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public InputSource resolveEntity(String publicId, String systemId) {
|
||||||
|
return new InputSource(new StringReader(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prepares this handler to read objects from XML document.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void startDocument() {
|
||||||
|
this.objects.clear();
|
||||||
|
this.handler = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses opening tag of XML element
|
||||||
|
* using corresponding element handler.
|
||||||
|
*
|
||||||
|
* @param uri the namespace URI, or the empty string
|
||||||
|
* if the element has no namespace URI or
|
||||||
|
* if namespace processing is not being performed
|
||||||
|
* @param localName the local name (without prefix), or the empty string
|
||||||
|
* if namespace processing is not being performed
|
||||||
|
* @param qName the qualified name (with prefix), or the empty string
|
||||||
|
* if qualified names are not available
|
||||||
|
* @param attributes the attributes attached to the element
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
|
||||||
|
ElementHandler parent = this.handler;
|
||||||
|
try {
|
||||||
|
this.handler = getElementHandler(qName).newInstance();
|
||||||
|
this.handler.setOwner(this);
|
||||||
|
this.handler.setParent(parent);
|
||||||
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
throw new SAXException(exception);
|
||||||
|
}
|
||||||
|
for (int i = 0; i < attributes.getLength(); i++)
|
||||||
|
try {
|
||||||
|
String name = attributes.getQName(i);
|
||||||
|
String value = attributes.getValue(i);
|
||||||
|
this.handler.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
catch (RuntimeException exception) {
|
||||||
|
handleException(exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.handler.startElement();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses closing tag of XML element
|
||||||
|
* using corresponding element handler.
|
||||||
|
*
|
||||||
|
* @param uri the namespace URI, or the empty string
|
||||||
|
* if the element has no namespace URI or
|
||||||
|
* if namespace processing is not being performed
|
||||||
|
* @param localName the local name (without prefix), or the empty string
|
||||||
|
* if namespace processing is not being performed
|
||||||
|
* @param qName the qualified name (with prefix), or the empty string
|
||||||
|
* if qualified names are not available
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void endElement(String uri, String localName, String qName) {
|
||||||
|
try {
|
||||||
|
this.handler.endElement();
|
||||||
|
}
|
||||||
|
catch (RuntimeException exception) {
|
||||||
|
handleException(exception);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
this.handler = this.handler.getParent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses character data inside XML element.
|
||||||
|
*
|
||||||
|
* @param chars the array of characters
|
||||||
|
* @param start the start position in the character array
|
||||||
|
* @param length the number of characters to use
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void characters(char[] chars, int start, int length) {
|
||||||
|
if (this.handler != null) {
|
||||||
|
try {
|
||||||
|
while (0 < length--) {
|
||||||
|
this.handler.addCharacter(chars[start++]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (RuntimeException exception) {
|
||||||
|
handleException(exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handles an exception using current exception listener.
|
||||||
|
*
|
||||||
|
* @param exception an exception to handle
|
||||||
|
* @see #setExceptionListener
|
||||||
|
*/
|
||||||
|
public void handleException(Exception exception) {
|
||||||
|
if (this.listener == null) {
|
||||||
|
throw new IllegalStateException(exception);
|
||||||
|
}
|
||||||
|
this.listener.exceptionThrown(exception);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts parsing of the specified input source.
|
||||||
|
*
|
||||||
|
* @param input the input source to parse
|
||||||
|
*/
|
||||||
|
public void parse(final InputSource input) {
|
||||||
|
if ((this.acc == null) && (null != System.getSecurityManager())) {
|
||||||
|
throw new SecurityException("AccessControlContext is not set");
|
||||||
|
}
|
||||||
|
AccessControlContext stack = AccessController.getContext();
|
||||||
|
SharedSecrets.getJavaSecurityAccess().doIntersectionPrivilege(new PrivilegedAction<Void>() {
|
||||||
|
public Void run() {
|
||||||
|
try {
|
||||||
|
SAXParserFactory.newInstance().newSAXParser().parse(input, DocumentHandler.this);
|
||||||
|
}
|
||||||
|
catch (ParserConfigurationException exception) {
|
||||||
|
handleException(exception);
|
||||||
|
}
|
||||||
|
catch (SAXException wrapper) {
|
||||||
|
Exception exception = wrapper.getException();
|
||||||
|
if (exception == null) {
|
||||||
|
exception = wrapper;
|
||||||
|
}
|
||||||
|
handleException(exception);
|
||||||
|
}
|
||||||
|
catch (IOException exception) {
|
||||||
|
handleException(exception);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}, stack, this.acc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resolves class by name using current class loader.
|
||||||
|
* This method handles exception using current exception listener.
|
||||||
|
*
|
||||||
|
* @param name the name of the class
|
||||||
|
* @return the object that represents the class
|
||||||
|
*/
|
||||||
|
public Class<?> findClass(String name) {
|
||||||
|
try {
|
||||||
|
return ClassFinder.resolveClass(name, getClassLoader());
|
||||||
|
}
|
||||||
|
catch (ClassNotFoundException exception) {
|
||||||
|
handleException(exception);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <double> element.
|
||||||
|
* This element specifies {@code double} values.
|
||||||
|
* The class {@link Double} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <double>1.23e45</double></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="valueOf" class="java.lang.Double">
|
||||||
|
* <string>1.23e45</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Double.valueOf("1.23e45")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class DoubleElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code double} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code double} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return Double.valueOf(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,224 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The base class for element handlers.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*
|
||||||
|
* @see DocumentHandler
|
||||||
|
*/
|
||||||
|
public abstract class ElementHandler {
|
||||||
|
private DocumentHandler owner;
|
||||||
|
private ElementHandler parent;
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the document handler that creates this element handler.
|
||||||
|
*
|
||||||
|
* @return the owner document handler
|
||||||
|
*/
|
||||||
|
public final DocumentHandler getOwner() {
|
||||||
|
return this.owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the document handler that creates this element handler.
|
||||||
|
* The owner document handler should be set after instantiation.
|
||||||
|
* Such approach is used to simplify the extensibility.
|
||||||
|
*
|
||||||
|
* @param owner the owner document handler
|
||||||
|
* @see DocumentHandler#startElement
|
||||||
|
*/
|
||||||
|
final void setOwner(DocumentHandler owner) {
|
||||||
|
if (owner == null) {
|
||||||
|
throw new IllegalArgumentException("Every element should have owner");
|
||||||
|
}
|
||||||
|
this.owner = owner;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the element handler that contains this one.
|
||||||
|
*
|
||||||
|
* @return the parent element handler
|
||||||
|
*/
|
||||||
|
public final ElementHandler getParent() {
|
||||||
|
return this.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the element handler that contains this one.
|
||||||
|
* The parent element handler should be set after instantiation.
|
||||||
|
* Such approach is used to simplify the extensibility.
|
||||||
|
*
|
||||||
|
* @param parent the parent element handler
|
||||||
|
* @see DocumentHandler#startElement
|
||||||
|
*/
|
||||||
|
final void setParent(ElementHandler parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the variable with specified identifier.
|
||||||
|
*
|
||||||
|
* @param id the identifier
|
||||||
|
* @return the value of the variable
|
||||||
|
*/
|
||||||
|
protected final Object getVariable(String id) {
|
||||||
|
if (id.equals(this.id)) {
|
||||||
|
ValueObject value = getValueObject();
|
||||||
|
if (value.isVoid()) {
|
||||||
|
throw new IllegalStateException("The element does not return value");
|
||||||
|
}
|
||||||
|
return value.getValue();
|
||||||
|
}
|
||||||
|
return (this.parent != null)
|
||||||
|
? this.parent.getVariable(id)
|
||||||
|
: this.owner.getVariable(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the parent element.
|
||||||
|
*
|
||||||
|
* @return the value of the parent element
|
||||||
|
*/
|
||||||
|
protected Object getContextBean() {
|
||||||
|
if (this.parent != null) {
|
||||||
|
ValueObject value = this.parent.getValueObject();
|
||||||
|
if (!value.isVoid()) {
|
||||||
|
return value.getValue();
|
||||||
|
}
|
||||||
|
throw new IllegalStateException("The outer element does not return value");
|
||||||
|
} else {
|
||||||
|
Object value = this.owner.getOwner();
|
||||||
|
if (value != null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
throw new IllegalStateException("The topmost element does not have context");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* By default, the following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <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
|
||||||
|
*/
|
||||||
|
public void addAttribute(String name, String value) {
|
||||||
|
if (name.equals("id")) { // NON-NLS: the attribute name
|
||||||
|
this.id = value;
|
||||||
|
} else {
|
||||||
|
throw new IllegalArgumentException("Unsupported attribute: " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called before parsing of the element's body.
|
||||||
|
* All attributes are parsed at this point.
|
||||||
|
* By default, do nothing.
|
||||||
|
*/
|
||||||
|
public void startElement() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is called after parsing of the element's body.
|
||||||
|
* By default, it calculates the value of this element.
|
||||||
|
* The following tasks are executing for any non-void value:
|
||||||
|
* <ol>
|
||||||
|
* <li>If the {@code id} attribute is set
|
||||||
|
* the value of the variable with the specified identifier
|
||||||
|
* is set to the value of this element.</li>
|
||||||
|
* <li>This element is used as an argument of parent element if it is possible.</li>
|
||||||
|
* </ol>
|
||||||
|
*
|
||||||
|
* @see #isArgument
|
||||||
|
*/
|
||||||
|
public void endElement() {
|
||||||
|
// do nothing if no value returned
|
||||||
|
ValueObject value = getValueObject();
|
||||||
|
if (!value.isVoid()) {
|
||||||
|
if (this.id != null) {
|
||||||
|
this.owner.setVariable(this.id, value.getValue());
|
||||||
|
}
|
||||||
|
if (isArgument()) {
|
||||||
|
if (this.parent != null) {
|
||||||
|
this.parent.addArgument(value.getValue());
|
||||||
|
} else {
|
||||||
|
this.owner.addObject(value.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the character that contained in this element.
|
||||||
|
* By default, only whitespaces are acceptable.
|
||||||
|
*
|
||||||
|
* @param ch the character
|
||||||
|
*/
|
||||||
|
public void addCharacter(char ch) {
|
||||||
|
if ((ch != ' ') && (ch != '\n') && (ch != '\t') && (ch != '\r')) {
|
||||||
|
throw new IllegalStateException("Illegal character with code " + (int) ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the argument that is used to calculate the value of this element.
|
||||||
|
* By default, no arguments are acceptable.
|
||||||
|
*
|
||||||
|
* @param argument the value of the element that contained in this one
|
||||||
|
*/
|
||||||
|
protected void addArgument(Object argument) {
|
||||||
|
throw new IllegalStateException("Could not add argument to simple element");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 can be used
|
||||||
|
* as an argument of the element that contained in this one,
|
||||||
|
* {@code false} otherwise
|
||||||
|
*/
|
||||||
|
protected boolean isArgument() {
|
||||||
|
return this.id == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of this element.
|
||||||
|
*
|
||||||
|
* @return the value of this element
|
||||||
|
*/
|
||||||
|
protected abstract ValueObject getValueObject();
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <false> element.
|
||||||
|
* This element specifies {@code false} value.
|
||||||
|
* It should not contain body or inner elements.
|
||||||
|
* For example:<pre>
|
||||||
|
* <false/></pre>
|
||||||
|
* is equivalent to {@code false} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class FalseElementHandler extends NullElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code Boolean.FALSE}
|
||||||
|
* as a value of <false> element.
|
||||||
|
*
|
||||||
|
* @return {@code Boolean.FALSE} by default
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue() {
|
||||||
|
return Boolean.FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
import com.sun.beans.finder.FieldFinder;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <field> element.
|
||||||
|
* This element simplifies access to the fields.
|
||||||
|
* If the {@code class} attribute is specified
|
||||||
|
* this element accesses static field of specified class.
|
||||||
|
* This element defines getter if it contains no argument.
|
||||||
|
* It returns the value of the field in this case.
|
||||||
|
* For example:<pre>
|
||||||
|
* <field name="TYPE" class="java.lang.Long"/></pre>
|
||||||
|
* is equivalent to {@code Long.TYPE} in Java code.
|
||||||
|
* This element defines setter if it contains one argument.
|
||||||
|
* It does not return the value of the field in this case.
|
||||||
|
* For example:<pre>
|
||||||
|
* <field name="id"><int>0</int></field></pre>
|
||||||
|
* is equivalent to {@code id = 0} in Java code.
|
||||||
|
* <p>The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the field name
|
||||||
|
* <dt>class
|
||||||
|
* <dd>the type is used for static fields only
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class FieldElementHandler extends AccessorElementHandler {
|
||||||
|
private Class<?> type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the field name
|
||||||
|
* <dt>class
|
||||||
|
* <dd>the type is used for static fields only
|
||||||
|
* <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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 super.isArgument() && (this.type != null); // only static accessor can be used an argument
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the context of the field.
|
||||||
|
* The context of the static field is the class object.
|
||||||
|
* The context of the non-static field is the value of the parent element.
|
||||||
|
*
|
||||||
|
* @return the context of the field
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected Object getContextBean() {
|
||||||
|
return (this.type != null)
|
||||||
|
? this.type
|
||||||
|
: super.getContextBean();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the field with specified {@code name}.
|
||||||
|
*
|
||||||
|
* @param name the name of the field
|
||||||
|
* @return the value of the specified field
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected Object getValue(String name) {
|
||||||
|
try {
|
||||||
|
return getFieldValue(getContextBean(), name);
|
||||||
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
getOwner().handleException(exception);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the new value for the field with specified {@code name}.
|
||||||
|
*
|
||||||
|
* @param name the name of the field
|
||||||
|
* @param value the new value for the specified field
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void setValue(String name, Object value) {
|
||||||
|
try {
|
||||||
|
setFieldValue(getContextBean(), name, value);
|
||||||
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
getOwner().handleException(exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the field with specified {@code name}
|
||||||
|
* in specified context and returns its value.
|
||||||
|
*
|
||||||
|
* @param bean the context bean that contains field
|
||||||
|
* @param name the name of the field
|
||||||
|
* @return the value of the field
|
||||||
|
* @throws IllegalAccessException if the field is not accesible
|
||||||
|
* @throws NoSuchFieldException if the field is not found
|
||||||
|
*/
|
||||||
|
static Object getFieldValue(Object bean, String name) throws IllegalAccessException, NoSuchFieldException {
|
||||||
|
return findField(bean, name).get(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the field with specified {@code name}
|
||||||
|
* in specified context and updates its value.
|
||||||
|
*
|
||||||
|
* @param bean the context bean that contains field
|
||||||
|
* @param name the name of the field
|
||||||
|
* @param value the new value for the field
|
||||||
|
* @throws IllegalAccessException if the field is not accesible
|
||||||
|
* @throws NoSuchFieldException if the field is not found
|
||||||
|
*/
|
||||||
|
private static void setFieldValue(Object bean, String name, Object value) throws IllegalAccessException, NoSuchFieldException {
|
||||||
|
findField(bean, name).set(bean, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the field
|
||||||
|
* with specified {@code name} in specified context.
|
||||||
|
*
|
||||||
|
* @param bean the context bean that contains field
|
||||||
|
* @param name the name of the field
|
||||||
|
* @return field object that represents found field
|
||||||
|
* @throws NoSuchFieldException if the field is not found
|
||||||
|
*/
|
||||||
|
private static Field findField(Object bean, String name) throws NoSuchFieldException {
|
||||||
|
return (bean instanceof Class<?>)
|
||||||
|
? FieldFinder.findStaticField((Class<?>) bean, name)
|
||||||
|
: FieldFinder.findField(bean.getClass(), name);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <float> element.
|
||||||
|
* This element specifies {@code float} values.
|
||||||
|
* The class {@link Float} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <float>-1.23</float></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="valueOf" class="java.lang.Float">
|
||||||
|
* <string>-1.23</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Float.valueOf("-1.23")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class FloatElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code float} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code float} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return Float.valueOf(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <int> element.
|
||||||
|
* This element specifies {@code int} values.
|
||||||
|
* The class {@link Integer} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <int>-1</int></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="decode" class="java.lang.Integer">
|
||||||
|
* <string>-1</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Integer.decode("-1")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class IntElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code int} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code int} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return Integer.decode(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,151 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
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 <java> 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 <java> 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 <java> 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <long> element.
|
||||||
|
* This element specifies {@code long} values.
|
||||||
|
* The class {@link Long} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <long>0xFFFF</long></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="decode" class="java.lang.Long">
|
||||||
|
* <string>0xFFFF</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Long.decode("0xFFFF")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class LongElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code long} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code long} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return Long.decode(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
import com.sun.beans.finder.MethodFinder;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import sun.reflect.misc.MethodUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <method> element.
|
||||||
|
* It describes invocation of the method.
|
||||||
|
* The {@code name} attribute denotes
|
||||||
|
* the name of the method to invoke.
|
||||||
|
* If the {@code class} attribute is specified
|
||||||
|
* this element invokes static method of specified class.
|
||||||
|
* The inner elements specifies the arguments of the method.
|
||||||
|
* For example:<pre>
|
||||||
|
* <method name="valueOf" class="java.lang.Long">
|
||||||
|
* <string>10</string>
|
||||||
|
* </method></pre>
|
||||||
|
* is equivalent to {@code Long.valueOf("10")} in Java code.
|
||||||
|
* <p>The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the method name
|
||||||
|
* <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
|
||||||
|
*/
|
||||||
|
final class MethodElementHandler extends NewElementHandler {
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the method name
|
||||||
|
* <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("name")) { // NON-NLS: the attribute name
|
||||||
|
this.name = value;
|
||||||
|
} else {
|
||||||
|
super.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of method execution.
|
||||||
|
*
|
||||||
|
* @param type the base class
|
||||||
|
* @param args the array of arguments
|
||||||
|
* @return the value of this element
|
||||||
|
* @throws Exception if calculation is failed
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected ValueObject getValueObject(Class<?> type, Object[] args) throws Exception {
|
||||||
|
Object bean = getContextBean();
|
||||||
|
Class<?>[] types = getArgumentTypes(args);
|
||||||
|
Method method = (type != null)
|
||||||
|
? MethodFinder.findStaticMethod(type, this.name, types)
|
||||||
|
: MethodFinder.findMethod(bean.getClass(), this.name, types);
|
||||||
|
|
||||||
|
if (method.isVarArgs()) {
|
||||||
|
args = getArguments(args, method.getParameterTypes());
|
||||||
|
}
|
||||||
|
Object value = MethodUtil.invoke(method, bean, args);
|
||||||
|
return method.getReturnType().equals(void.class)
|
||||||
|
? ValueObjectImpl.VOID
|
||||||
|
: ValueObjectImpl.create(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,205 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
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 new Long("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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <null> element.
|
||||||
|
* This element specifies {@code null} value.
|
||||||
|
* It should not contain body or inner elements.
|
||||||
|
* For example:<pre>
|
||||||
|
* <null/></pre>
|
||||||
|
* is equivalent to {@code null} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
class NullElementHandler extends ElementHandler implements ValueObject {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of this element.
|
||||||
|
*
|
||||||
|
* @return the value of this element
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected final ValueObject getValueObject() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code null}
|
||||||
|
* as a value of <null> element.
|
||||||
|
* This method should be overridden in those handlers
|
||||||
|
* that extend behavior of this element.
|
||||||
|
*
|
||||||
|
* @return {@code null} by default
|
||||||
|
*/
|
||||||
|
public Object getValue() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code void} state of this value object.
|
||||||
|
*
|
||||||
|
* @return {@code false} always
|
||||||
|
*/
|
||||||
|
public final boolean isVoid() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
import java.beans.Expression;
|
||||||
|
|
||||||
|
import static java.util.Locale.ENGLISH;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <object> element.
|
||||||
|
* This element looks like <void> element,
|
||||||
|
* but its value is always used as an argument for element
|
||||||
|
* that contains this one.
|
||||||
|
* <p>The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>class
|
||||||
|
* <dd>the type is used for static methods and fields
|
||||||
|
* <dt>method
|
||||||
|
* <dd>the method name
|
||||||
|
* <dt>property
|
||||||
|
* <dd>the property name
|
||||||
|
* <dt>index
|
||||||
|
* <dd>the property index
|
||||||
|
* <dt>field
|
||||||
|
* <dd>the field name
|
||||||
|
* <dt>idref
|
||||||
|
* <dd>the identifier to refer to the variable
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
class ObjectElementHandler extends NewElementHandler {
|
||||||
|
private String idref;
|
||||||
|
private String field;
|
||||||
|
private Integer index;
|
||||||
|
private String property;
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>class
|
||||||
|
* <dd>the type is used for static methods and fields
|
||||||
|
* <dt>method
|
||||||
|
* <dd>the method name
|
||||||
|
* <dt>property
|
||||||
|
* <dd>the property name
|
||||||
|
* <dt>index
|
||||||
|
* <dd>the property index
|
||||||
|
* <dt>field
|
||||||
|
* <dd>the field name
|
||||||
|
* <dt>idref
|
||||||
|
* <dd>the identifier to refer to the variable
|
||||||
|
* <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 final void addAttribute(String name, String value) {
|
||||||
|
if (name.equals("idref")) { // NON-NLS: the attribute name
|
||||||
|
this.idref = value;
|
||||||
|
} else if (name.equals("field")) { // NON-NLS: the attribute name
|
||||||
|
this.field = value;
|
||||||
|
} else if (name.equals("index")) { // NON-NLS: the attribute name
|
||||||
|
this.index = Integer.valueOf(value);
|
||||||
|
addArgument(this.index); // hack for compatibility
|
||||||
|
} else if (name.equals("property")) { // NON-NLS: the attribute name
|
||||||
|
this.property = value;
|
||||||
|
} else if (name.equals("method")) { // NON-NLS: the attribute name
|
||||||
|
this.method = value;
|
||||||
|
} else {
|
||||||
|
super.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Calculates the value of this element
|
||||||
|
* if the field attribute or the idref attribute is set.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public final void startElement() {
|
||||||
|
if ((this.field != null) || (this.idref != null)) {
|
||||||
|
getValueObject();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 can be used
|
||||||
|
* as an argument of the element that contained in this one,
|
||||||
|
* {@code false} otherwise
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected boolean isArgument() {
|
||||||
|
return true; // hack for compatibility
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the value 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
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected final ValueObject getValueObject(Class<?> type, Object[] args) throws Exception {
|
||||||
|
if (this.field != null) {
|
||||||
|
return ValueObjectImpl.create(FieldElementHandler.getFieldValue(getContextBean(), this.field));
|
||||||
|
}
|
||||||
|
if (this.idref != null) {
|
||||||
|
return ValueObjectImpl.create(getVariable(this.idref));
|
||||||
|
}
|
||||||
|
Object bean = getContextBean();
|
||||||
|
String name;
|
||||||
|
if (this.index != null) {
|
||||||
|
name = (args.length == 2)
|
||||||
|
? PropertyElementHandler.SETTER
|
||||||
|
: PropertyElementHandler.GETTER;
|
||||||
|
} else if (this.property != null) {
|
||||||
|
name = (args.length == 1)
|
||||||
|
? PropertyElementHandler.SETTER
|
||||||
|
: PropertyElementHandler.GETTER;
|
||||||
|
|
||||||
|
if (0 < this.property.length()) {
|
||||||
|
name += this.property.substring(0, 1).toUpperCase(ENGLISH) + this.property.substring(1);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
name = (this.method != null) && (0 < this.method.length())
|
||||||
|
? this.method
|
||||||
|
: "new"; // NON-NLS: the constructor marker
|
||||||
|
}
|
||||||
|
Expression expression = new Expression(bean, name, args);
|
||||||
|
return ValueObjectImpl.create(expression.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,289 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
import com.sun.beans.finder.MethodFinder;
|
||||||
|
|
||||||
|
import java.beans.IndexedPropertyDescriptor;
|
||||||
|
import java.beans.IntrospectionException;
|
||||||
|
import java.beans.Introspector;
|
||||||
|
import java.beans.PropertyDescriptor;
|
||||||
|
|
||||||
|
import java.lang.reflect.Array;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import sun.reflect.misc.MethodUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <property> element.
|
||||||
|
* This element simplifies access to the properties.
|
||||||
|
* If the {@code index} attribute is specified
|
||||||
|
* this element uses additional {@code int} parameter.
|
||||||
|
* If the {@code name} attribute is not specified
|
||||||
|
* this element uses method "get" as getter
|
||||||
|
* and method "set" as setter.
|
||||||
|
* This element defines getter if it contains no argument.
|
||||||
|
* It returns the value of the property in this case.
|
||||||
|
* For example:<pre>
|
||||||
|
* <property name="object" index="10"/></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="getObject">
|
||||||
|
* <int>10</int>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code getObject(10)} in Java code.
|
||||||
|
* This element defines setter if it contains one argument.
|
||||||
|
* It does not return the value of the property in this case.
|
||||||
|
* For example:<pre>
|
||||||
|
* <property><int>0</int></property></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="set">
|
||||||
|
* <int>0</int>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code set(0)} in Java code.
|
||||||
|
* <p>The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the property name
|
||||||
|
* <dt>index
|
||||||
|
* <dd>the property index
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class PropertyElementHandler extends AccessorElementHandler {
|
||||||
|
static final String GETTER = "get"; // NON-NLS: the getter prefix
|
||||||
|
static final String SETTER = "set"; // NON-NLS: the setter prefix
|
||||||
|
|
||||||
|
private Integer index;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses attributes of the element.
|
||||||
|
* The following attributes are supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>name
|
||||||
|
* <dd>the property name
|
||||||
|
* <dt>index
|
||||||
|
* <dd>the property index
|
||||||
|
* <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("index")) { // NON-NLS: the attribute name
|
||||||
|
this.index = Integer.valueOf(value);
|
||||||
|
} else {
|
||||||
|
super.addAttribute(name, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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; // non-static accessor cannot be used an argument
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of the property with specified {@code name}.
|
||||||
|
*
|
||||||
|
* @param name the name of the property
|
||||||
|
* @return the value of the specified property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected Object getValue(String name) {
|
||||||
|
try {
|
||||||
|
return getPropertyValue(getContextBean(), name, this.index);
|
||||||
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
getOwner().handleException(exception);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the new value for the property with specified {@code name}.
|
||||||
|
*
|
||||||
|
* @param name the name of the property
|
||||||
|
* @param value the new value for the specified property
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void setValue(String name, Object value) {
|
||||||
|
try {
|
||||||
|
setPropertyValue(getContextBean(), name, this.index, value);
|
||||||
|
}
|
||||||
|
catch (Exception exception) {
|
||||||
|
getOwner().handleException(exception);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the getter for the property
|
||||||
|
* with specified {@code name} in specified class
|
||||||
|
* and returns value of the property.
|
||||||
|
*
|
||||||
|
* @param bean the context bean that contains property
|
||||||
|
* @param name the name of the property
|
||||||
|
* @param index the index of the indexed property
|
||||||
|
* @return the value of the property
|
||||||
|
* @throws IllegalAccessException if the property is not accesible
|
||||||
|
* @throws IntrospectionException if the bean introspection is failed
|
||||||
|
* @throws InvocationTargetException if the getter cannot be invoked
|
||||||
|
* @throws NoSuchMethodException if the getter is not found
|
||||||
|
*/
|
||||||
|
private static Object getPropertyValue(Object bean, String name, Integer index) throws IllegalAccessException, IntrospectionException, InvocationTargetException, NoSuchMethodException {
|
||||||
|
Class<?> type = bean.getClass();
|
||||||
|
if (index == null) {
|
||||||
|
return MethodUtil.invoke(findGetter(type, name), bean, new Object[] {});
|
||||||
|
} else if (type.isArray() && (name == null)) {
|
||||||
|
return Array.get(bean, index);
|
||||||
|
} else {
|
||||||
|
return MethodUtil.invoke(findGetter(type, name, int.class), bean, new Object[] {index});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the setter for the property
|
||||||
|
* with specified {@code name} in specified class
|
||||||
|
* and updates value of the property.
|
||||||
|
*
|
||||||
|
* @param bean the context bean that contains property
|
||||||
|
* @param name the name of the property
|
||||||
|
* @param index the index of the indexed property
|
||||||
|
* @param value the new value for the property
|
||||||
|
* @throws IllegalAccessException if the property is not accesible
|
||||||
|
* @throws IntrospectionException if the bean introspection is failed
|
||||||
|
* @throws InvocationTargetException if the setter cannot be invoked
|
||||||
|
* @throws NoSuchMethodException if the setter is not found
|
||||||
|
*/
|
||||||
|
private static void setPropertyValue(Object bean, String name, Integer index, Object value) throws IllegalAccessException, IntrospectionException, InvocationTargetException, NoSuchMethodException {
|
||||||
|
Class<?> type = bean.getClass();
|
||||||
|
Class<?> param = (value != null)
|
||||||
|
? value.getClass()
|
||||||
|
: null;
|
||||||
|
|
||||||
|
if (index == null) {
|
||||||
|
MethodUtil.invoke(findSetter(type, name, param), bean, new Object[] {value});
|
||||||
|
} else if (type.isArray() && (name == null)) {
|
||||||
|
Array.set(bean, index, value);
|
||||||
|
} else {
|
||||||
|
MethodUtil.invoke(findSetter(type, name, int.class, param), bean, new Object[] {index, value});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the getter for the property
|
||||||
|
* with specified {@code name} in specified class.
|
||||||
|
*
|
||||||
|
* @param type the class that contains method
|
||||||
|
* @param name the name of the property
|
||||||
|
* @param args the method arguments
|
||||||
|
* @return method object that represents found getter
|
||||||
|
* @throws IntrospectionException if the bean introspection is failed
|
||||||
|
* @throws NoSuchMethodException if method is not found
|
||||||
|
*/
|
||||||
|
private static Method findGetter(Class<?> type, String name, Class<?>...args) throws IntrospectionException, NoSuchMethodException {
|
||||||
|
if (name == null) {
|
||||||
|
return MethodFinder.findInstanceMethod(type, GETTER, args);
|
||||||
|
}
|
||||||
|
PropertyDescriptor pd = getProperty(type, name);
|
||||||
|
if (args.length == 0) {
|
||||||
|
Method method = pd.getReadMethod();
|
||||||
|
if (method != null) {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
} else if (pd instanceof IndexedPropertyDescriptor) {
|
||||||
|
IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
|
||||||
|
Method method = ipd.getIndexedReadMethod();
|
||||||
|
if (method != null) {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IntrospectionException("Could not find getter for the " + name + " property");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the setter for the property
|
||||||
|
* with specified {@code name} in specified class.
|
||||||
|
*
|
||||||
|
* @param type the class that contains method
|
||||||
|
* @param name the name of the property
|
||||||
|
* @param args the method arguments
|
||||||
|
* @return method object that represents found setter
|
||||||
|
* @throws IntrospectionException if the bean introspection is failed
|
||||||
|
* @throws NoSuchMethodException if method is not found
|
||||||
|
*/
|
||||||
|
private static Method findSetter(Class<?> type, String name, Class<?>...args) throws IntrospectionException, NoSuchMethodException {
|
||||||
|
if (name == null) {
|
||||||
|
return MethodFinder.findInstanceMethod(type, SETTER, args);
|
||||||
|
}
|
||||||
|
PropertyDescriptor pd = getProperty(type, name);
|
||||||
|
if (args.length == 1) {
|
||||||
|
Method method = pd.getWriteMethod();
|
||||||
|
if (method != null) {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
} else if (pd instanceof IndexedPropertyDescriptor) {
|
||||||
|
IndexedPropertyDescriptor ipd = (IndexedPropertyDescriptor) pd;
|
||||||
|
Method method = ipd.getIndexedWriteMethod();
|
||||||
|
if (method != null) {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IntrospectionException("Could not find setter for the " + name + " property");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Performs the search of the descriptor for the property
|
||||||
|
* with specified {@code name} in specified class.
|
||||||
|
*
|
||||||
|
* @param type the class to introspect
|
||||||
|
* @param name the property name
|
||||||
|
* @return descriptor for the named property
|
||||||
|
* @throws IntrospectionException if property descriptor is not found
|
||||||
|
*/
|
||||||
|
private static PropertyDescriptor getProperty(Class<?> type, String name) throws IntrospectionException {
|
||||||
|
for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) {
|
||||||
|
if (name.equals(pd.getName())) {
|
||||||
|
return pd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new IntrospectionException("Could not find the " + name + " property descriptor");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <short> element.
|
||||||
|
* This element specifies {@code short} values.
|
||||||
|
* The class {@link Short} is used as wrapper for these values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* The body parsing is described in the class {@link StringElementHandler}.
|
||||||
|
* For example:<pre>
|
||||||
|
* <short>200</short></pre>
|
||||||
|
* is shortcut to<pre>
|
||||||
|
* <method name="decode" class="java.lang.Short">
|
||||||
|
* <string>200</string>
|
||||||
|
* </method></pre>
|
||||||
|
* which is equivalent to {@code Short.decode("200")} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class ShortElementHandler extends StringElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates {@code short} value from
|
||||||
|
* the text of the body of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated {@code short} value
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue(String argument) {
|
||||||
|
return Short.decode(argument);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <string> element.
|
||||||
|
* This element specifies {@link String} values.
|
||||||
|
* The result value is created from text of the body of this element.
|
||||||
|
* For example:<pre>
|
||||||
|
* <string>description</string></pre>
|
||||||
|
* is equivalent to {@code "description"} in Java code.
|
||||||
|
* The value of inner element is calculated
|
||||||
|
* before adding to the string using {@link String#valueOf(Object)}.
|
||||||
|
* Note that all characters are used including whitespaces (' ', '\t', '\n', '\r').
|
||||||
|
* So the value of the element<pre>
|
||||||
|
* <string><true></string></pre>
|
||||||
|
* is not equal to the value of the element<pre>
|
||||||
|
* <string>
|
||||||
|
* <true>
|
||||||
|
* </string></pre>
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
public class StringElementHandler extends ElementHandler {
|
||||||
|
private StringBuilder sb = new StringBuilder();
|
||||||
|
private ValueObject value = ValueObjectImpl.NULL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the character that contained in this element.
|
||||||
|
*
|
||||||
|
* @param ch the character
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public final void addCharacter(char ch) {
|
||||||
|
if (this.sb == null) {
|
||||||
|
throw new IllegalStateException("Could not add chararcter to evaluated string element");
|
||||||
|
}
|
||||||
|
this.sb.append(ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the string value of the argument to the string 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.sb == null) {
|
||||||
|
throw new IllegalStateException("Could not add argument to evaluated string element");
|
||||||
|
}
|
||||||
|
this.sb.append(argument);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the value of this element.
|
||||||
|
*
|
||||||
|
* @return the value of this element
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected final ValueObject getValueObject() {
|
||||||
|
if (this.sb != null) {
|
||||||
|
try {
|
||||||
|
this.value = ValueObjectImpl.create(getValue(this.sb.toString()));
|
||||||
|
}
|
||||||
|
catch (RuntimeException exception) {
|
||||||
|
getOwner().handleException(exception);
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
this.sb = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the text of the body of this element.
|
||||||
|
* This method evaluates value from text of the body,
|
||||||
|
* and should be overridden in those handlers
|
||||||
|
* that extend behavior of this element.
|
||||||
|
*
|
||||||
|
* @param argument the text of the body
|
||||||
|
* @return evaluated value
|
||||||
|
*/
|
||||||
|
protected Object getValue(String argument) {
|
||||||
|
return argument;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class is intended to handle <true> element.
|
||||||
|
* This element specifies {@code true} value.
|
||||||
|
* It should not contain body or inner elements.
|
||||||
|
* For example:<pre>
|
||||||
|
* <true/></pre>
|
||||||
|
* is equivalent to {@code true} in Java code.
|
||||||
|
* <p>The following attribute is supported:
|
||||||
|
* <dl>
|
||||||
|
* <dt>id
|
||||||
|
* <dd>the identifier of the variable that is intended to store the result
|
||||||
|
* </dl>
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
final class TrueElementHandler extends NullElementHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code Boolean.TRUE}
|
||||||
|
* as a value of <true> element.
|
||||||
|
*
|
||||||
|
* @return {@code Boolean.TRUE} by default
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Object getValue() {
|
||||||
|
return Boolean.TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
|
*
|
||||||
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 2 only, as
|
||||||
|
* published by the Free Software Foundation. Oracle designates this
|
||||||
|
* particular file as subject to the "Classpath" exception as provided
|
||||||
|
* by Oracle in the LICENSE file that accompanied this code.
|
||||||
|
*
|
||||||
|
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||||
|
* version 2 for more details (a copy is included in the LICENSE file that
|
||||||
|
* accompanied this code).
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License version
|
||||||
|
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||||
|
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
*
|
||||||
|
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||||
|
* or visit www.oracle.com if you need additional information or have any
|
||||||
|
* questions.
|
||||||
|
*/
|
||||||
|
package com.sun.beans.decoder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This interface represents the result of method execution.
|
||||||
|
*
|
||||||
|
* @since 1.7
|
||||||
|
*
|
||||||
|
* @author Sergey A. Malenkov
|
||||||
|
*/
|
||||||
|
public interface ValueObject {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the result of method execution.
|
||||||
|
*
|
||||||
|
* @return the result of method execution
|
||||||
|
*/
|
||||||
|
Object getValue();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns {@code void} state of this value object.
|
||||||
|
*
|
||||||
|
* @return {@code true} if value can be ignored,
|
||||||
|
* {@code false} otherwise
|
||||||
|
*/
|
||||||
|
boolean isVoid();
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user