JBossWS SVN: r2202 - in subprojects: jbossws-sun-wsimport and 114 other directories.
by jbossws-commitsï¼ lists.jboss.org
Author: jason.greene(a)jboss.com
Date: 2007-01-30 21:44:54 -0500 (Tue, 30 Jan 2007)
New Revision: 2202
Added:
subprojects/jbossws-sun-wsimport/
subprojects/jbossws-sun-wsimport/.build.xml.swp
subprojects/jbossws-sun-wsimport/.classpath
subprojects/jbossws-sun-wsimport/.project
subprojects/jbossws-sun-wsimport/NOTES
subprojects/jbossws-sun-wsimport/build.xml
subprojects/jbossws-sun-wsimport/jbossws/
subprojects/jbossws-sun-wsimport/jbossws/src/
subprojects/jbossws-sun-wsimport/jbossws/src/main/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/NullPrintStream.java
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterImpl.java
subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterProviderImpl.java
subprojects/jbossws-sun-wsimport/lib/
subprojects/jbossws-sun-wsimport/lib/activation.jar
subprojects/jbossws-sun-wsimport/lib/jaxb-api.jar
subprojects/jbossws-sun-wsimport/lib/jaxb-impl.jar
subprojects/jbossws-sun-wsimport/lib/jaxb-xjc.jar
subprojects/jbossws-sun-wsimport/lib/jaxws-api.jar
subprojects/jbossws-sun-wsimport/lib/jbossws-client.jar
subprojects/jbossws-sun-wsimport/lib/jsr173_api.jar
subprojects/jbossws-sun-wsimport/lib/jsr181-api.jar
subprojects/jbossws-sun-wsimport/lib/jsr250-api.jar
subprojects/jbossws-sun-wsimport/lib/resolver.jar
subprojects/jbossws-sun-wsimport/lib/saaj-api.jar
subprojects/jbossws-sun-wsimport/lib/servlet.jar
subprojects/jbossws-sun-wsimport/lib/sun-saaj-impl.jar
subprojects/jbossws-sun-wsimport/license.txt
subprojects/jbossws-sun-wsimport/sun/
subprojects/jbossws-sun-wsimport/sun/src/
subprojects/jbossws-sun-wsimport/sun/src/etc/
subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.bat
subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.sh
subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.bat
subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.sh
subprojects/jbossws-sun-wsimport/sun/src/main/
subprojects/jbossws-sun-wsimport/sun/src/main/org/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/AnnotationProcessorFactoryImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/Invoker.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ToolVersion.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsGen.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsImport.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/Apt.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsGen.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsImport.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/Processor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorAction.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorActionVersion.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorNotificationListener.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorOptions.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ClassModelInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/Configuration.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ConfigurationException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerChainInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ModelInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/WSDLModelInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ClassModelParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/CustomizationParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/InputParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/JAXWSBindingInfoParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ParserUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/Reader.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/CustomExceptionGenerator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/JAXBTypeGenerator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/Names.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SeiGenerator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/ServiceGenerator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SimpleToBoxedUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AbstractType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperationType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Block.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ExtendedModelVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Fault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/HeaderFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Message.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Model.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelObject.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelProperties.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Operation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Parameter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Port.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Request.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Response.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Service.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/exporter/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/exporter/ExternalObject.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaArrayType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaInterface.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaMethod.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaParameter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaSimpleType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureMember.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBElementMember.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBMapping.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBModel.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBProperty.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBStructuredType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitMember.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitStructure.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/Util.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/JavaSimpleTypeCreator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/Modeler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerUtils.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/AnnotationProcessorContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/FaultInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MemberInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/ModelBuilder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeModeler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMoniker.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMonikerFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceAP.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceReferenceCollector.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WrapperInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/AccessorElement.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ConsoleErrorReporter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/JAXBModelBuilder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/MimeHelper.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModeler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModelerBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/ClassNameCollector.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/ClientProcessorEnvironment.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/DirectoryUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/GeneratedFileInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/IndentingWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/ProcessorEnvironment.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/util/ProcessorEnvironmentBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/configuration.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/generator.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/javacompiler.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/model.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/modeler.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/processor.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/util.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/webserviceap.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/wscompile.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/resources/wsdl.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/spi/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/spi/WSToolsObjectFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/spi/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/ClassNameInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/ForkEntityResolver.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/JAXWSClassFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/JavaCompilerHelper.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/MapBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/ToolBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/WSDLParseException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/WSToolsObjectFactoryImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/xml/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/xml/NodeListIterator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/xml/NullEntityResolver.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/xml/PrettyPrintingXmlWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/xml/XmlUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/util/xml/XmlWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/version.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wscompile/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wscompile/ActionConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wscompile/CompileTool.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wscompile/FilerCodeWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wscompile/WSCodeWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Binding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/BindingFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/BindingInput.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/BindingOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/BindingOutput.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Definitions.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Documentation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Fault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Import.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Input.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Kinds.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Message.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/MessagePart.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Operation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/OperationStyle.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Output.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Port.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/PortType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Service.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/Types.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/WSDLConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/WSDLDocument.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/WSDLDocumentVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/WSDLDocumentVisitorBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/HTTPAddress.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/HTTPBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/HTTPConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/HTTPOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/HTTPUrlEncoded.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/http/HTTPUrlReplacement.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/jaxws/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/jaxws/CustomName.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/jaxws/Exception.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/jaxws/JAXWSBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/jaxws/JAXWSBindingsConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/jaxws/Parameter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/mime/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/mime/MIMEConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/mime/MIMEContent.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/mime/MIMEMultipartRelated.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/mime/MIMEPart.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/mime/MIMEXml.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/BuiltInTypes.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/Schema.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/SchemaAttribute.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/SchemaConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/SchemaDocument.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/SchemaElement.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/SchemaEntity.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/schema/SchemaKinds.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAP12Binding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAP12Constants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPAddress.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPBody.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPHeader.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPHeaderFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPStyle.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/document/soap/SOAPUse.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/AbstractDocument.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Defining.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/DuplicateEntityException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Elemental.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Entity.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/EntityAction.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/EntityReferenceAction.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/EntityReferenceValidator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ExtensibilityHelper.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Extensible.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Extension.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ExtensionVisitor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ExtensionVisitorBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ExternalEntityReference.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/GlobalEntity.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/GloballyKnown.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Identifiable.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/Kind.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/NoSuchEntityException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ParseException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ParserContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ParserListener.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/QNameAction.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/ValidationException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/WSDLLocation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/framework/WriterContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/Constants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/ExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/ExtensionHandlerBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/HTTPExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/Internalizer.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/JAXWSBindingExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/MIMEExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/NamespaceContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/SOAP12ExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/SOAPEntityReferenceValidator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/SOAPExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/SchemaExtensionHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/SchemaParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/SchemaWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/Util.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/WSDLParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/wsdl/parser/WSDLWriter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/binding/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/binding/BindingImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/binding/http/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/binding/http/HTTPBindingImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/binding/soap/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/binding/soap/SOAPBindingImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/AsyncHandlerService.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/BindingProviderProperties.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ClientConfigurationException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ClientTransportException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ContactInfoBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ContactInfoListImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ContactInfoListIteratorBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ContentNegotiation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ContextMap.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/EndpointIFBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/EndpointIFContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/EndpointIFInvocationHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/InternalBindingProvider.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/PortInfoBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/RequestContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ResponseContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/SenderException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ServiceContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/ServiceContextBuilder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/WSFuture.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/WSServiceDelegate.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/DispatchBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/DispatchContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/ResponseImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/DispatchContactInfoList.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/DispatchDelegate.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/encoding/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/encoding/DispatchSerializer.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/encoding/DispatchUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/protocol/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/dispatch/impl/protocol/MessageDispatcherHelper.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/client/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/developer/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/developer/JAXWSProperties.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/EncoderDecoderBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/JAXWSAttachmentMarshaller.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/JAXWSAttachmentUnmarshaller.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/internal/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/internal/InternalEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/jaxb/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/jaxb/JAXBBeanInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/jaxb/JAXBBridgeInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/jaxb/JAXBTypeSerializer.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/jaxb/RpcLitPayload.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/jaxb/RpcLitPayloadSerializer.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/simpletype/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/simpletype/EncoderUtils.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/simpletype/SimpleTypeConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/ClientEncoderDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/DeserializationException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/EncoderDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SOAP12Constants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SOAPConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SOAPDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SOAPEPTFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SOAPEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SOAPVersion.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SerializationException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/SerializerConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/ServerEncoderDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/client/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/client/SOAP12XMLDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/client/SOAP12XMLEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/client/SOAPXMLDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/client/SOAPXMLEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/AttachmentBlock.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/BodyBlock.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/DelegateBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/HeaderBlock.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/InternalMessage.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/MessageBlock.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/MessageInfoBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/internal/SOAP12NotUnderstoodHeaderBlock.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/FaultCode.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/FaultCodeEnum.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/FaultReason.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/FaultReasonText.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/FaultSubcode.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/SOAP12FaultInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/SOAPFaultInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/SOAPMsgCreateException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/message/SOAPMsgFactoryCreateException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/server/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/server/ProviderSED.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/server/SOAP12XMLDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/server/SOAP12XMLEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/server/SOAPXMLDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/server/SOAPXMLEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/streaming/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/streaming/SOAP12NamespaceConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/soap/streaming/SOAPNamespaceConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/xml/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/xml/XMLDecoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/xml/XMLEPTFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/xml/XMLEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/encoding/xml/XMLMessage.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/HandlerChainCaller.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/HandlerChainsModel.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/HandlerContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/HandlerException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/HandlerResolverImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/LogicalMessageContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/LogicalMessageImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/MessageContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/MessageContextUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/PortInfoImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/SHDSOAPMessageContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/SOAPHandlerContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/SOAPMessageContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/XMLHandlerContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/XMLLogicalMessageContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/XMLLogicalMessageImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/handler/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/CheckedException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/ExceptionType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/JavaMethod.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/Mode.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/Parameter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/ParameterBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/RuntimeModel.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/WrapperParameter.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/soap/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/soap/SOAPBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/soap/SOAPRuntimeModel.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/soap/Style.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/model/soap/Use.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/modeler/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/modeler/RuntimeModeler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/modeler/RuntimeModelerException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/Delegate.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/encoding/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/encoding/Decoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/encoding/Encoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/Acceptor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/ContactInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/ContactInfoList.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/ContactInfoListIterator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/EPTFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/ept/MessageInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/presentation/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/presentation/MessageStruct.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/presentation/Stub.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/presentation/TargetFinder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/presentation/Tie.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/protocol/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/protocol/Interceptors.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/pept/protocol/MessageDispatcher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/soap/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/soap/client/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/soap/client/SOAPMessageDispatcher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/soap/server/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/soap/server/ProviderSOAPMD.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/soap/server/SOAPMessageDispatcher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/XMLMessageException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/client/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/client/XMLMessageDispatcher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/server/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/server/ProviderXMLMD.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/protocol/xml/server/XMLMessageDispatcher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/client.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/dispatch.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/encoding.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/handler.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/httpserver.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/modeler.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/sender.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/server.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/soap.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/streaming.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/util.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/wsservlet.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/resources/xmlmessage.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/AppMsgContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/DocInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/EPTFactoryBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/EPTFactoryFactoryBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/PeptTie.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/RuntimeContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/RuntimeEndpointInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/ServerPropertyConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/ServerRtException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/TargetFinderImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/Tie.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/WSDLGenResolver.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/WSDLPatcher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/WSDLPublisher.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/XMLEPTFactoryImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/provider/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/provider/ProviderModel.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/server/provider/ProviderPeptTie.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/Binding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/ClientTransportFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/ClientTransportFactoryTypes.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/InternalSoapEncoder.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/Invoker.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/MessageContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/MtomCallback.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/RuntimeEndpointInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/SOAPMessageContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/StubBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/SystemHandlerDelegate.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/SystemHandlerDelegateFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/Tie.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/WSConnection.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/WSRtObjectFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/WebServiceContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/spi/runtime/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/Attributes.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/DOMStreamReader.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/PrefixFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/PrefixFactoryImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/SourceReaderFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/TidyXMLStreamReader.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLReader.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLReaderException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLStreamReaderException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLStreamReaderFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLStreamReaderUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLStreamWriterException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLStreamWriterFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/streaming/XMLStreamWriterUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/Headers.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/WSConnectionImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/client/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/client/CookieJar.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/client/HttpClientTransport.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/client/HttpClientTransportFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/client/HttpCookie.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/client/RfcDateParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/RuntimeEndpointInfoParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/ServletConnectionImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/ServletDocInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/WSServlet.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/WSServletContextListener.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/WSServletDelegate.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/WSServletException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/http/servlet/WebServiceContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/LocalMessage.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/client/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/client/LocalClientTransport.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/client/LocalClientTransportFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/server/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/server/LocalConnectionImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/transport/local/server/LocalWSContextImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/ASCIIUtility.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/Base64Util.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/ByteArrayBuffer.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/ByteArrayDataSource.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/Constants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/DOMUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/FastInfosetReflection.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/FastInfosetUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/HandlerAnnotationInfo.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/HandlerAnnotationProcessor.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/JAXWSUtils.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/MessageInfoUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/NamespaceSupport.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/NullIterator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/RuntimeVersion.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/SOAPConnectionUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/SOAPUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/StringUtils.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/SunStAXReflection.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/UtilException.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/Version.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/VersionUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/WSRtObjectFactoryImpl.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/XMLConnectionUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/exception/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/exception/JAXWSExceptionBase.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/localization/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/localization/Localizable.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/localization/LocalizableMessage.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/localization/LocalizableMessageFactory.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/localization/Localizer.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/localization/NullLocalizable.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/resources/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/resources/Messages_en.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/CDATA.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/NamedNodeMapIterator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/NodeListIterator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/StAXSource.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/XMLStreamReaderToContentHandler.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/util/xml/XmlUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/version.properties
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/WSDLContext.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/Binding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/BindingOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/MIMEConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/Message.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/ParserUtil.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/Part.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/Port.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/PortType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/PortTypeOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/RuntimeWSDLParser.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/SOAPConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/Service.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/WSDLConstants.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/parser/WSDLDocument.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/WSDLGenerator.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/WSDLOutputResolver.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Binding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/BindingOperationType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Definitions.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Documented.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Fault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/FaultType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Import.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Message.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/OpenAtts.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Operation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/ParamType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Part.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Port.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/PortType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Service.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/StartWithExtensionsType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/Types.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/http/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/http/Address.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/http/Binding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/http/Operation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/http/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/Body.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/BodyType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/Header.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/HeaderFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/SOAPAddress.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/SOAPBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/SOAPFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/SOAPOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/Body.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/BodyType.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/Header.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/HeaderFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/SOAPAddress.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/SOAPBinding.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/SOAPFault.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/SOAPOperation.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/soap12/package-info.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/xsd/
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/xsd/Import.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/xsd/Schema.java
subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/xml/ws/wsdl/writer/document/xsd/package-info.java
Log:
import sun-wsimport plugin
Added: subprojects/jbossws-sun-wsimport/.build.xml.swp
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/.build.xml.swp
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/.classpath
===================================================================
--- subprojects/jbossws-sun-wsimport/.classpath (rev 0)
+++ subprojects/jbossws-sun-wsimport/.classpath 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="jbossws/src/main"/>
+ <classpathentry kind="src" path="sun/src/main"/>
+ <classpathentry kind="lib" path="lib/activation.jar"/>
+ <classpathentry kind="lib" path="lib/jaxb-api.jar"/>
+ <classpathentry kind="lib" path="lib/jaxb-impl.jar"/>
+ <classpathentry kind="lib" path="lib/jaxb-xjc.jar"/>
+ <classpathentry kind="lib" path="lib/jsr173_api.jar"/>
+ <classpathentry kind="lib" path="lib/jsr250-api.jar"/>
+ <classpathentry kind="lib" path="lib/saaj-api.jar"/>
+ <classpathentry kind="lib" path="lib/servlet.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="lib" path="/devel/jbossas/trunk/tools/lib/ant.jar"/>
+ <classpathentry kind="lib" path="lib/sun-saaj-impl.jar"/>
+ <classpathentry kind="lib" path="lib/jbossws-client.jar"/>
+ <classpathentry kind="lib" path="lib/jsr181-api.jar"/>
+ <classpathentry kind="lib" path="lib/jaxws-api.jar"/>
+ <classpathentry kind="output" path="eclipse-output"/>
+</classpath>
Added: subprojects/jbossws-sun-wsimport/.project
===================================================================
--- subprojects/jbossws-sun-wsimport/.project (rev 0)
+++ subprojects/jbossws-sun-wsimport/.project 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jbossws-sun-wsimport</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: subprojects/jbossws-sun-wsimport/NOTES
===================================================================
--- subprojects/jbossws-sun-wsimport/NOTES (rev 0)
+++ subprojects/jbossws-sun-wsimport/NOTES 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,42 @@
+General Architecture
+--------------------
+(jbossws) WebServiceImporter -> (jbossws-sun) WebServiceImporterProviderImpl -> WebServiceImporterImpl -> (sun) CompileTool
+
+Directory Layout
+----------------
+lib - compile time dependencies
+output/classes - compiled classes
+output/lib - final location for jbossws-sun-wsimport.jar
+
+sun/src/main - modified CDDL JAX-WS code
+jbossws/src/main - jbossws plugin
+
+Sun Source Tag
+--------------
+The original sun source is available at:
+cvs -d :pserver:guest@cvs.dev.java.net:/cvs co -r glassfish-90ur1-09282006 jax-ws-sources
+
+It's important to correlate the glassfish tags for TCK compatibility.
+
+Recreation Steps
+---i------------
+1. Grab jax-ws sources from java.net (make sure to use a glassfish tag)
+2. Merge the ri and tools tree
+3. Remove all references to http.jar (delete EndpointImpl and everything that references it)
+4. Use jarjar to rename classes in saaj-impl.jar to org/jboss/com/sun (this will ensure no runtime references to it)
+5. Rename all sun code packages to org/jboss/com/sun
+6. Edit the source comment code to include a jbossws message
+7. build jar, and verify it works (should only have jaxb dependencies and misc apis that jboss already has)
+
+Runtime Dependencies
+--------------------
+1. jaxb-api.jar
+2. jaxb-impl.jar
+3. jaxb-xjc.jar
+4. stax-1.1.1.jar or wstax
+5. jdk tools.jar
+6. The usual jbossws jars
+
+Compiletime Dependencies
+------------------------
+Everything in lib
Added: subprojects/jbossws-sun-wsimport/build.xml
===================================================================
--- subprojects/jbossws-sun-wsimport/build.xml (rev 0)
+++ subprojects/jbossws-sun-wsimport/build.xml 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ The contents of this file are subject to the terms
+ of the Common Development and Distribution License
+ (the License). You may not use this file except in
+ compliance with the License.
+
+ You can obtain a copy of the license at
+ https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ See the License for the specific language governing
+ permissions and limitations under the License.
+
+ When distributing Covered Code, include this CDDL
+ Header Notice in each file and include the License file
+ at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ If applicable, add the following below the CDDL Header,
+ with the fields enclosed by brackets [] replaced by
+ you own identifying information:
+ "Portions Copyrighted [year] [name of copyright owner]"
+
+ Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+-->
+
+<!--
+ Build script for the source code bundle
+-->
+<project name="jax-ws" default="main">
+
+ <property name="Name" value="jbossws-sun-wsimport"/>
+ <property name="version" value="2.0.0"/>
+ <property name="output" value="output"/>
+ <property name="output.classes" value="output/classes"/>
+ <property name="output.lib" value="output/lib"/>
+
+ <tstamp>
+ <format property="now" pattern="MM/dd/yyyy HH:mm:ss" unit="hour" locale="en_US"/>
+ </tstamp>
+ <property name="build.id" value="${now}(${user.name})" />
+ <property name="build.version" value="${Name} ${version}-${build.id}" />
+ <echo message="The build id is: ${build.version}" />
+
+ <macrodef name="versionProp"
+ description="generates a version property file">
+ <attribute name="file" />
+ <sequential>
+ <echo file="@{file}"
+>build-id=${build.id}
+build-version=${build.version}
+major-version=${version}
+</echo>
+ </sequential>
+ </macrodef>
+
+ <path id="compile.classpath">
+ <fileset dir="lib">
+ <include name="**/*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="clean">
+ <delete dir="${output}"/>
+ </target>
+
+ <target name="main" depends="compile, jar"/>
+
+ <target name="compile">
+ <mkdir dir="${output.classes}"/>
+ <copy todir="${output.classes}">
+ <fileset dir="sun/src/main">
+ <include name="**/*.properties" />
+ </fileset>
+ </copy>
+ <versionProp file="${output.classes}/org/jboss/com/sun/xml/ws/version.properties" />
+ <versionProp file="${output.classes}/org/jboss/com/sun/tools/ws/version.properties" />
+ <javac destdir="${output.classes}" debug="true">
+ <src path="sun/src/main"/>
+ <src path="jbossws/src/main"/>
+ <classpath refid="compile.classpath"/>
+ </javac>
+ </target>
+
+ <target name="jar" depends="compile">
+ <mkdir dir="${output.lib}"/>
+ <jar jarfile="${output.lib}/jbossws-sun-wsimport.jar">
+ <manifest>
+ <attribute name="Implementation-Title" value="jbossws-sun-wsimport"/>
+ <attribute name="Implementation-Version" value="${build.version}"/>
+ <attribute name="Implementation-Vendor" value="jboss+sun"/>
+ </manifest>
+ <fileset dir="${output.classes}"/>
+ </jar>
+ </target>
+
+<!-- Create a safe SAAJ Impl
+ <target name="jarjar">
+ <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="./jarjar.jar"/>
+ <jarjar jarfile="lib/sun-saaj-impl.jar">
+ <zipfileset src="lib/saaj-impl.jar">
+ <include name="com/sun/**/*"/>
+ </zipfileset>
+ <rule pattern="com.sun.**" result="org.jboss.@0"/>
+ </jarjar>
+ </target>
+-->
+</project>
Property changes on: subprojects/jbossws-sun-wsimport/build.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/NullPrintStream.java
===================================================================
--- subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/NullPrintStream.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/NullPrintStream.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,209 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.com.sun.tools.ws.jbossws;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Locale;
+
+class NullPrintStream extends PrintStream
+{
+ NullPrintStream()
+ {
+ // Doesn't actually do anything
+ super(new ByteArrayOutputStream());
+ }
+
+ @Override
+ public PrintStream append(char c)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq, int start, int end)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream append(CharSequence csq)
+ {
+ return this;
+ }
+
+ @Override
+ public boolean checkError()
+ {
+ return false;
+ }
+
+ @Override
+ public void close()
+ {
+ }
+
+ @Override
+ public void flush()
+ {
+ }
+
+ @Override
+ public PrintStream format(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream format(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void print(boolean b)
+ {
+ }
+
+ @Override
+ public void print(char c)
+ {
+ }
+
+ @Override
+ public void print(char[] s)
+ {
+ }
+
+ @Override
+ public void print(double d)
+ {
+ }
+
+ @Override
+ public void print(float f)
+ {
+ }
+
+ @Override
+ public void print(int i)
+ {
+ }
+
+ @Override
+ public void print(long l)
+ {
+ }
+
+ @Override
+ public void print(Object obj)
+ {
+ }
+
+ @Override
+ public void print(String s)
+ {
+ }
+
+ @Override
+ public PrintStream printf(Locale l, String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public PrintStream printf(String format, Object... args)
+ {
+ return this;
+ }
+
+ @Override
+ public void println()
+ {
+ }
+
+ @Override
+ public void println(boolean x)
+ {
+ }
+
+ @Override
+ public void println(char x)
+ {
+ }
+
+ @Override
+ public void println(char[] x)
+ {
+ }
+
+ @Override
+ public void println(double x)
+ {
+ }
+
+ @Override
+ public void println(float x)
+ {
+ }
+
+ @Override
+ public void println(int x)
+ {
+ }
+
+ @Override
+ public void println(long x)
+ {
+ }
+
+ @Override
+ public void println(Object x)
+ {
+ }
+
+ @Override
+ public void println(String x)
+ {
+ }
+
+ @Override
+ protected void setError()
+ {
+ }
+
+ @Override
+ public void write(byte[] buf, int off, int len)
+ {
+ }
+
+ @Override
+ public void write(int b)
+ {
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException
+ {
+ }
+}
\ No newline at end of file
Property changes on: subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/NullPrintStream.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterImpl.java
===================================================================
--- subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterImpl.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterImpl.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,169 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.com.sun.tools.ws.jbossws;
+
+import java.io.File;
+import java.io.OutputStream;
+import java.io.PrintStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.com.sun.tools.ws.wscompile.CompileTool;
+import org.jboss.ws.tools.jaxws.api.WebServiceImporter;
+
+/**
+ * Sun based implementation.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WebServiceImporterImpl extends WebServiceImporter {
+ private List<File> bindingFiles = null;
+ private File catalog = null;
+ private boolean generateSource = false;
+ private File outputDir = new File("output");
+ private File sourceDir = null;
+ private String targetPackage = null;
+ private PrintStream messageStream = null;
+ private String wsdlLocation = null;
+ private List<String> additionalCompilerClassPath = null;
+
+ @Override
+ public void setBindingFiles(List<File> bindingFiles) {
+ this.bindingFiles = bindingFiles;
+ }
+
+ @Override
+ public void setCatalog(File catalog) {
+ this.catalog = catalog;
+ }
+
+ @Override
+ public void setGenerateSource(boolean generateSource) {
+ this.generateSource = generateSource;
+ }
+
+ @Override
+ public void setMessageStream(PrintStream messageStream) {
+ // TODO Auto-generated method stub
+ this.messageStream = messageStream;
+ }
+
+ @Override
+ public void setOutputDirectory(File directory) {
+ // TODO Auto-generated method stub
+ outputDir = directory;
+ }
+
+ @Override
+ public void setSourceDirectory(File directory) {
+ sourceDir = directory;
+ }
+
+ @Override
+ public void setTargetPackage(String targetPackage) {
+ this.targetPackage = targetPackage;
+ }
+
+ @Override
+ public void setWsdlLocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void setAdditionalCompilerClassPath(List<String> additionalCompilerClassPath) {
+ this.additionalCompilerClassPath = additionalCompilerClassPath;
+ }
+
+ @Override
+ public void importServices(URL wsdl) {
+ List<String> args = new ArrayList<String>();
+ if (bindingFiles != null) {
+ for (File file : bindingFiles) {
+ args.add("-b");
+ args.add(file.getAbsolutePath());
+
+ }
+ }
+
+ if (catalog != null) {
+ args.add("-catalog");
+ args.add(catalog.getAbsolutePath());
+ }
+
+ if (generateSource) {
+ args.add("-keep");
+ if (sourceDir != null) {
+ if (!sourceDir.exists() && !sourceDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + sourceDir.getName());
+
+ args.add("-s");
+ args.add(sourceDir.getAbsolutePath());
+ }
+ }
+
+ if (targetPackage != null) {
+ args.add("-p");
+ args.add(targetPackage);
+ }
+
+ if (wsdlLocation != null) {
+ args.add("-wsdllocation");
+ args.add(wsdlLocation);
+ }
+
+ PrintStream stream = messageStream;
+ if (stream != null) {
+ args.add("-verbose");
+ } else {
+ stream = new NullPrintStream();
+ }
+
+ if (!outputDir.exists() && !outputDir.mkdirs())
+ throw new IllegalStateException("Could not make directory: " + outputDir.getName());
+
+ // Always add the output directory and the wsdl location
+ args.add("-d");
+ args.add(outputDir.getAbsolutePath());
+ args.add(wsdl.toString());
+
+ // WSToolsObjectFactory tools = WSToolsObjectFactory.newInstance();
+ // tools.wsimport(stream, args.toArray(new String[0]));
+
+ // We have to manipulate internals since they don't expose a way to set
+ // the classpath that is used for compilation
+ CompileTool tool = new CompileTool(stream, "wsimport") {
+ @Override
+ public boolean run(String[] args) {
+ StringBuilder builder = new StringBuilder();
+ if (additionalCompilerClassPath != null && additionalCompilerClassPath.size() > 0) {
+ for (String entry : additionalCompilerClassPath)
+ builder.append(entry).append(File.pathSeparatorChar);
+ builder.setLength(builder.length() - 1);
+ }
+ userClasspath = builder.toString();
+ return super.run(args);
+ }
+ };
+ tool.run(args.toArray(new String[0]));
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterProviderImpl.java
===================================================================
--- subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterProviderImpl.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterProviderImpl.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,36 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software 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
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.com.sun.tools.ws.jbossws;
+
+import org.jboss.ws.tools.jaxws.api.WebServiceImporter;
+import org.jboss.ws.tools.jaxws.spi.WebServiceImporterProvider;
+/**
+ * Provider implementation that uses SUN wsimport.
+ *
+ * @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
+ * @version $Revision$
+ */
+public class WebServiceImporterProviderImpl implements WebServiceImporterProvider {
+ public WebServiceImporter createImporter() {
+ return new WebServiceImporterImpl();
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/jbossws/src/main/org/jboss/com/sun/tools/ws/jbossws/WebServiceImporterProviderImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/lib/activation.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/activation.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jaxb-api.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jaxb-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jaxb-impl.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jaxb-impl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jaxb-xjc.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jaxb-xjc.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jaxws-api.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jaxws-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jbossws-client.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jbossws-client.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jsr173_api.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jsr173_api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jsr181-api.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jsr181-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/jsr250-api.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/jsr250-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/resolver.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/resolver.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/saaj-api.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/saaj-api.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/servlet.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/servlet.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/lib/sun-saaj-impl.jar
===================================================================
(Binary files differ)
Property changes on: subprojects/jbossws-sun-wsimport/lib/sun-saaj-impl.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: subprojects/jbossws-sun-wsimport/license.txt
===================================================================
--- subprojects/jbossws-sun-wsimport/license.txt (rev 0)
+++ subprojects/jbossws-sun-wsimport/license.txt 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,525 @@
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
+
+
+ 1. Definitions.
+
+ 1.1. "Contributor" means each individual or entity that
+ creates or contributes to the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the
+ Original Software, prior Modifications used by a
+ Contributor (if any), and the Modifications made by that
+ particular Contributor.
+
+ 1.3. "Covered Software" means (a) the Original Software, or
+ (b) Modifications, or (c) the combination of files
+ containing Original Software with files containing
+ Modifications, in each case including portions thereof.
+
+ 1.4. "Executable" means the Covered Software in any form
+ other than Source Code.
+
+ 1.5. "Initial Developer" means the individual or entity
+ that first makes Original Software available under this
+ License.
+
+ 1.6. "Larger Work" means a work which combines Covered
+ Software or portions thereof with code not governed by the
+ terms of this License.
+
+ 1.7. "License" means this document.
+
+ 1.8. "Licensable" means having the right to grant, to the
+ maximum extent possible, whether at the time of the initial
+ grant or subsequently acquired, any and all of the rights
+ conveyed herein.
+
+ 1.9. "Modifications" means the Source Code and Executable
+ form of any of the following:
+
+ A. Any file that results from an addition to,
+ deletion from or modification of the contents of a
+ file containing Original Software or previous
+ Modifications;
+
+ B. Any new file that contains any part of the
+ Original Software or previous Modification; or
+
+ C. Any new file that is contributed or otherwise made
+ available under the terms of this License.
+
+ 1.10. "Original Software" means the Source Code and
+ Executable form of computer software code that is
+ originally released under this License.
+
+ 1.11. "Patent Claims" means any patent claim(s), now owned
+ or hereafter acquired, including without limitation,
+ method, process, and apparatus claims, in any patent
+ Licensable by grantor.
+
+ 1.12. "Source Code" means (a) the common form of computer
+ software code in which modifications are made and (b)
+ associated documentation included in or with such code.
+
+ 1.13. "You" (or "Your") means an individual or a legal
+ entity exercising rights under, and complying with all of
+ the terms of, this License. For legal entities, "You"
+ includes any entity which controls, is controlled by, or is
+ under common control with You. For purposes of this
+ definition, "control" means (a) the power, direct or
+ indirect, to cause the direction or management of such
+ entity, whether by contract or otherwise, or (b) ownership
+ of more than fifty percent (50%) of the outstanding shares
+ or beneficial ownership of such entity.
+
+ 2. License Grants.
+
+ 2.1. The Initial Developer Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and
+ subject to third party intellectual property claims, the
+ Initial Developer hereby grants You a world-wide,
+ royalty-free, non-exclusive license:
+
+ (a) under intellectual property rights (other than
+ patent or trademark) Licensable by Initial Developer,
+ to use, reproduce, modify, display, perform,
+ sublicense and distribute the Original Software (or
+ portions thereof), with or without Modifications,
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making,
+ using or selling of Original Software, to make, have
+ made, use, practice, sell, and offer for sale, and/or
+ otherwise dispose of the Original Software (or
+ portions thereof).
+
+ (c) The licenses granted in Sections 2.1(a) and (b)
+ are effective on the date Initial Developer first
+ distributes or otherwise makes the Original Software
+ available to a third party under the terms of this
+ License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent
+ license is granted: (1) for code that You delete from
+ the Original Software, or (2) for infringements
+ caused by: (i) the modification of the Original
+ Software, or (ii) the combination of the Original
+ Software with other software or devices.
+
+ 2.2. Contributor Grant.
+
+ Conditioned upon Your compliance with Section 3.1 below and
+ subject to third party intellectual property claims, each
+ Contributor hereby grants You a world-wide, royalty-free,
+ non-exclusive license:
+
+ (a) under intellectual property rights (other than
+ patent or trademark) Licensable by Contributor to
+ use, reproduce, modify, display, perform, sublicense
+ and distribute the Modifications created by such
+ Contributor (or portions thereof), either on an
+ unmodified basis, with other Modifications, as
+ Covered Software and/or as part of a Larger Work; and
+
+
+ (b) under Patent Claims infringed by the making,
+ using, or selling of Modifications made by that
+ Contributor either alone and/or in combination with
+ its Contributor Version (or portions of such
+ combination), to make, use, sell, offer for sale,
+ have made, and/or otherwise dispose of: (1)
+ Modifications made by that Contributor (or portions
+ thereof); and (2) the combination of Modifications
+ made by that Contributor with its Contributor Version
+ (or portions of such combination).
+
+ (c) The licenses granted in Sections 2.2(a) and
+ 2.2(b) are effective on the date Contributor first
+ distributes or otherwise makes the Modifications
+ available to a third party.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent
+ license is granted: (1) for any code that Contributor
+ has deleted from the Contributor Version; (2) for
+ infringements caused by: (i) third party
+ modifications of Contributor Version, or (ii) the
+ combination of Modifications made by that Contributor
+ with other software (except as part of the
+ Contributor Version) or other devices; or (3) under
+ Patent Claims infringed by Covered Software in the
+ absence of Modifications made by that Contributor.
+
+ 3. Distribution Obligations.
+
+ 3.1. Availability of Source Code.
+
+ Any Covered Software that You distribute or otherwise make
+ available in Executable form must also be made available in
+ Source Code form and that Source Code form must be
+ distributed only under the terms of this License. You must
+ include a copy of this License with every copy of the
+ Source Code form of the Covered Software You distribute or
+ otherwise make available. You must inform recipients of any
+ such Covered Software in Executable form as to how they can
+ obtain such Covered Software in Source Code form in a
+ reasonable manner on or through a medium customarily used
+ for software exchange.
+
+ 3.2. Modifications.
+
+ The Modifications that You create or to which You
+ contribute are governed by the terms of this License. You
+ represent that You believe Your Modifications are Your
+ original creation(s) and/or You have sufficient rights to
+ grant the rights conveyed by this License.
+
+ 3.3. Required Notices.
+
+ You must include a notice in each of Your Modifications
+ that identifies You as the Contributor of the Modification.
+ You may not remove or alter any copyright, patent or
+ trademark notices contained within the Covered Software, or
+ any notices of licensing or any descriptive text giving
+ attribution to any Contributor or the Initial Developer.
+
+ 3.4. Application of Additional Terms.
+
+ You may not offer or impose any terms on any Covered
+ Software in Source Code form that alters or restricts the
+ applicable version of this License or the recipients�
+ rights hereunder. You may choose to offer, and to charge a
+ fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Software.
+ However, you may do so only on Your own behalf, and not on
+ behalf of the Initial Developer or any Contributor. You
+ must make it absolutely clear that any such warranty,
+ support, indemnity or liability obligation is offered by
+ You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred
+ by the Initial Developer or such Contributor as a result of
+ warranty, support, indemnity or liability terms You offer.
+
+
+ 3.5. Distribution of Executable Versions.
+
+ You may distribute the Executable form of the Covered
+ Software under the terms of this License or under the terms
+ of a license of Your choice, which may contain terms
+ different from this License, provided that You are in
+ compliance with the terms of this License and that the
+ license for the Executable form does not attempt to limit
+ or alter the recipient�s rights in the Source Code form
+ from the rights set forth in this License. If You
+ distribute the Covered Software in Executable form under a
+ different license, You must make it absolutely clear that
+ any terms which differ from this License are offered by You
+ alone, not by the Initial Developer or Contributor. You
+ hereby agree to indemnify the Initial Developer and every
+ Contributor for any liability incurred by the Initial
+ Developer or such Contributor as a result of any such terms
+ You offer.
+
+ 3.6. Larger Works.
+
+ You may create a Larger Work by combining Covered Software
+ with other code not governed by the terms of this License
+ and distribute the Larger Work as a single product. In such
+ a case, You must make sure the requirements of this License
+ are fulfilled for the Covered Software.
+
+ 4. Versions of the License.
+
+ 4.1. New Versions.
+
+ Sun Microsystems, Inc. is the initial license steward and
+ may publish revised and/or new versions of this License
+ from time to time. Each version will be given a
+ distinguishing version number. Except as provided in
+ Section 4.3, no one other than the license steward has the
+ right to modify this License.
+
+ 4.2. Effect of New Versions.
+
+ You may always continue to use, distribute or otherwise
+ make the Covered Software available under the terms of the
+ version of the License under which You originally received
+ the Covered Software. If the Initial Developer includes a
+ notice in the Original Software prohibiting it from being
+ distributed or otherwise made available under any
+ subsequent version of the License, You must distribute and
+ make the Covered Software available under the terms of the
+ version of the License under which You originally received
+ the Covered Software. Otherwise, You may also choose to
+ use, distribute or otherwise make the Covered Software
+ available under the terms of any subsequent version of the
+ License published by the license steward.
+
+ 4.3. Modified Versions.
+
+ When You are an Initial Developer and You want to create a
+ new license for Your Original Software, You may create and
+ use a modified version of this License if You: (a) rename
+ the license and remove any references to the name of the
+ license steward (except to note that the license differs
+ from this License); and (b) otherwise make it clear that
+ the license contains terms which differ from this License.
+
+
+ 5. DISCLAIMER OF WARRANTY.
+
+ COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS"
+ BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+ INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
+ SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR
+ PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND
+ PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY
+ COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE
+ INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF
+ ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF
+ WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+ DISCLAIMER.
+
+ 6. TERMINATION.
+
+ 6.1. This License and the rights granted hereunder will
+ terminate automatically if You fail to comply with terms
+ herein and fail to cure such breach within 30 days of
+ becoming aware of the breach. Provisions which, by their
+ nature, must remain in effect beyond the termination of
+ this License shall survive.
+
+ 6.2. If You assert a patent infringement claim (excluding
+ declaratory judgment actions) against Initial Developer or
+ a Contributor (the Initial Developer or Contributor against
+ whom You assert such claim is referred to as "Participant")
+ alleging that the Participant Software (meaning the
+ Contributor Version where the Participant is a Contributor
+ or the Original Software where the Participant is the
+ Initial Developer) directly or indirectly infringes any
+ patent, then any and all rights granted directly or
+ indirectly to You by such Participant, the Initial
+ Developer (if the Initial Developer is not the Participant)
+ and all Contributors under Sections 2.1 and/or 2.2 of this
+ License shall, upon 60 days notice from Participant
+ terminate prospectively and automatically at the expiration
+ of such 60 day notice period, unless if within such 60 day
+ period You withdraw Your claim with respect to the
+ Participant Software against such Participant either
+ unilaterally or pursuant to a written agreement with
+ Participant.
+
+ 6.3. In the event of termination under Sections 6.1 or 6.2
+ above, all end user licenses that have been validly granted
+ by You or any distributor hereunder prior to termination
+ (excluding licenses granted to You by any distributor)
+ shall survive termination.
+
+ 7. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE
+ INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
+ COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE
+ LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR
+ CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT
+ LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK
+ STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL
+ INJURY RESULTING FROM SUCH PARTY�S NEGLIGENCE TO THE EXTENT
+ APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO
+ NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
+ CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT
+ APPLY TO YOU.
+
+ 8. U.S. GOVERNMENT END USERS.
+
+ The Covered Software is a "commercial item," as that term is
+ defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial
+ computer software" (as that term is defined at 48 C.F.R. �
+ 252.227-7014(a)(1)) and "commercial computer software
+ documentation" as such terms are used in 48 C.F.R. 12.212 (Sept.
+ 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1
+ through 227.7202-4 (June 1995), all U.S. Government End Users
+ acquire Covered Software with only those rights set forth herein.
+ This U.S. Government Rights clause is in lieu of, and supersedes,
+ any other FAR, DFAR, or other clause or provision that addresses
+ Government rights in computer software under this License.
+
+ 9. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the
+ extent necessary to make it enforceable. This License shall be
+ governed by the law of the jurisdiction specified in a notice
+ contained within the Original Software (except to the extent
+ applicable law, if any, provides otherwise), excluding such
+ jurisdiction�s conflict-of-law provisions. Any litigation
+ relating to this License shall be subject to the jurisdiction of
+ the courts located in the jurisdiction and venue specified in a
+ notice contained within the Original Software, with the losing
+ party responsible for costs, including, without limitation, court
+ costs and reasonable attorneys� fees and expenses. The
+ application of the United Nations Convention on Contracts for the
+ International Sale of Goods is expressly excluded. Any law or
+ regulation which provides that the language of a contract shall
+ be construed against the drafter shall not apply to this License.
+ You agree that You alone are responsible for compliance with the
+ United States export administration regulations (and the export
+ control laws and regulation of any other countries) when You use,
+ distribute or otherwise make available any Covered Software.
+
+ 10. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or
+ indirectly, out of its utilization of rights under this License
+ and You agree to work with Initial Developer and Contributors to
+ distribute such responsibility on an equitable basis. Nothing
+ herein is intended or shall be deemed to constitute any admission
+ of liability.
+
+
+---------------------------------------------------------------------------
+
+
+Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE
+
+Licensee/Company: Entity receiving Software.
+
+Effective Date: Date of delivery of the Software to You.
+
+Software: Webservices Metadata for Java Platform V2.0.
+
+License Term: Perpetual (subject to termination under the SLA).
+
+Licensed Unit: Software Copy.
+
+Licensed unit Count: Unlimited.
+
+Permitted Uses:
+
+1. You may reproduce and use the Software for Your own Individual, Commercial and Research and Instructional Use only for the purposes of designing, developing, testing, and running Your applets and applications ("Programs").
+
+2. Subject to the terms and conditions of this Agreement and restrictions and exceptions set forth in the Software's documentation, You may reproduce and distribute portions of Software identified as a redistributable in the documentation (each a "Redistributable"), provided that You comply with the following (note that You may be entitled to reproduce and distribute other portions of the Software not defined in the documentation as a Redistributable under certain other licenses as described in the THIRDPARTYLICENSEREADME):
+
+(a) You distribute Redistributable complete and unmodified and only bundled as part of Your Programs,
+
+(b) Your Programs add significant and primary functionality to the Redistributable,
+
+(c) You distribute Redistributable for the sole purpose of running Your Programs,
+
+(d) You do not distribute additional software intended to replace any
+component(s) of the Redistributable,
+
+(e) You do not remove or alter any proprietary legends or notices contained in or on the Redistributable.
+
+(f) You only distribute the Redistributable subject to a license agreement that protects Sun's interests consistent with the terms contained in this
+Agreement, and
+
+(g) You agree to defend and indemnify Sun and its licensors from and against any damages, costs, liabilities, settlement amounts and/or expenses (including attorneys' fees) incurred in connection with any claim, lawsuit or action by any third party that arises or results from the use or distribution of any and all Programs and/or Redistributable.
+
+3. Java Technology Restrictions. You may not create, modify, or change the behavior of, or authorize Your licensees to create, modify, or change the behavior of, classes, interfaces, or subpackages that are in any way identified as "java", "javax", "sun" or similar convention as specified by Sun in any naming convention designation.
+
+
+Sun Microsystems, Inc. ("Sun")
+SOFTWARE LICENSE AGREEMENT
+
+READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED ELECTRONICALLY, SELECT THE "DECLINE" (OR "EXIT") BUTTON AT THE END OF THIS AGREEMENT. IF YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS") FOR YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-5 OF THIS AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS SOFTWARE.
+
+1. Definitions.
+
+(a) "Entitlement" means the collective set of applicable documents authorized by Sun evidencing your obligation to pay associated fees (if any) for the license, associated Services, and the authorized scope of use of Software under this Agreement.
+
+(b) "Licensed Unit" means the unit of measure by which your use of Software and/or Service is licensed, as described in your Entitlement.
+
+(c) "Permitted Use" means the licensed Software use(s) authorized in this Agreement as specified in your Entitlement. The Permitted Use for any bundled Sun software not specified in your Entitlement will be evaluation use as provided in Section 3.
+
+(d) "Service" means the service(s) that Sun or its delegate will provide, if any, as selected in your Entitlement and as further described in the applicable service listings at www.sun.com/service/servicelist.
+
+(e) "Software" means the Sun software described in your Entitlement. Also, certain software may be included for evaluation use under Section 3.
+
+(f) "You" and "Your" means the individual or legal entity specified in the Entitlement, or for evaluation purposes, the entity performing the evaluation.
+
+2. License Grant and Entitlement.
+
+Subject to the terms of your Entitlement, Sun grants you a nonexclusive, nontransferable limited license to use Software for its Permitted Use for the license term. Your Entitlement will specify (a) Software licensed, (b) the Permitted Use, (c) the license term, and (d) the Licensed Units.
+
+Additionally, if your Entitlement includes Services, then it will also specify the (e) Service and (f) service term.
+
+If your rights to Software or Services are limited in duration and the date such rights begin is other than the purchase date, your Entitlement will provide that beginning date(s).
+
+The Entitlement may be delivered to you in various ways depending on the manner in which you obtain Software and Services, for example, the Entitlement may be provided in your receipt, invoice or your contract with Sun or authorized Sun reseller. It may also be in electronic format if you download Software.
+
+3. Permitted Use.
+
+As selected in your Entitlement, one or more of the following Permitted Uses will apply to your use of Software. Unless you have an Entitlement that expressly permits it, you may not use Software for any of the other Permitted Uses. If you don't have an Entitlement, or if your Entitlement doesn't cover additional software delivered to you, then such software is for your Evaluation Use.
+
+(a) Evaluation Use. You may evaluate Software internally for a period of 90 days from your first use.
+
+(b) Research and Instructional Use. You may use Software internally to design, develop and test, and also to provide instruction on such uses.
+
+(c) Individual Use. You may use Software internally for personal, individual use.
+
+(d) Commercial Use. You may use Software internally for your own commercial purposes.
+
+(e) Service Provider Use. You may make Software functionality accessible (but not by providing Software itself or through outsourcing services) to your end users in an extranet deployment, but not to your affiliated companies or to government agencies.
+
+4. Licensed Units.
+
+Your Permitted Use is limited to the number of Licensed Units stated in your Entitlement. If you require additional Licensed Units, you will need additional Entitlement(s).
+
+5. Restrictions.
+
+(a) The copies of Software provided to you under this Agreement are licensed, not sold, to you by Sun. Sun reserves all rights not expressly granted. (b) You may make a single archival copy of Software, but otherwise may not copy, modify, or distribute Software. However if the Sun documentation accompanying Software lists specific portions of Software, such as header files, class libraries, reference source code, and/or redistributable files, that may be handled differently, you may do so only as provided in the Sun documentation. (c) You may not rent, lease, lend or encumber Software. (d) Unless enforcement is prohibited by applicable law, you may not decompile, or reverse engineer Software. (e) The terms and conditions of this Agreement will apply to any Software updates, provided to you at Sun's discretion, that replace and/or supplement the original Software, unless such update contains a separate license. (f) You may not publish or provide the results of any benchmark !
or comparison tests run on Software to any third party without the prior written consent of Sun. (g) Software is confidential and copyrighted. (h) Unless otherwise specified, if Software is delivered with embedded or bundled software that enables functionality of Software, you may not use such software on a stand-alone basis or use any portion of such software to interoperate with any program(s) other than Software. (i) Software may contain programs that perform automated collection of system data and/or automated software updating services. System data collected through such programs may be used by Sun, its subcontractors, and its service delivery partners for the purpose of providing you with remote system services and/or improving Sun's software and systems. (j) Software is not designed, licensed or intended for use in the design, construction, operation or maintenance of any nuclear facility and Sun and its licensors disclaim any express or implied warranty of fitness f!
or such uses. (k) No right, title or interest in or to any trademark,
service mark, logo or trade name of Sun or its licensors is granted under this Agreement.
+
+6. Term and Termination.
+
+The license and service term are set forth in your Entitlement(s). Your rights under this Agreement will terminate immediately without notice from Sun if you materially breach it or take any action in derogation of Sun's and/or its licensors' rights to Software. Sun may terminate this Agreement should any Software become, or in Sun's reasonable opinion likely to become, the subject of a claim of intellectual property infringement or trade secret misappropriation. Upon termination, you will cease use of, and destroy, Software and confirm compliance in writing to Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination of the Agreement.
+
+7. Java Compatibility and Open Source.
+
+Software may contain Java technology. You may not create additional classes to, or modifications of, the Java technology, except under compatibility requirements available under a separate agreement available at www.java.net.
+
+Sun supports and benefits from the global community of open source developers, and thanks the community for its important contributions and open standards-based technology, which Sun has adopted into many of its products.
+
+Please note that portions of Software may be provided with notices and open source licenses from such communities and third parties that govern the use of those portions, and any licenses granted hereunder do not alter any rights and obligations you may have under such open source licenses, however, the disclaimer of warranty and limitation of liability provisions in this Agreement will apply to all Software in this distribution.
+
+8. Limited Warranty.
+
+Sun warrants to you that for a period of 90 days from the date of purchase, as evidenced by a copy of the receipt, the media on which Software is furnished (if any) will be free of defects in materials and workmanship under normal use. Except for the foregoing, Software is provided "AS IS". Your exclusive remedy and Sun's entire liability under this limited warranty will be at Sun's option to replace Software media or refund the fee paid for Software. Some states do not allow limitations on certain implied warranties, so the above may not apply to you. This limited warranty gives you specific legal rights. You may have others, which vary from state to state.
+
+9. Disclaimer of Warranty.
+
+UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.
+
+10. Limitation of Liability.
+
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's liability to you, whether in contract, tort (including negligence), or otherwise, exceed the amount paid by you for Software under this Agreement. The foregoing limitations will apply even if the above stated warranty fails of its essential purpose. Some states do not allow the exclusion of incidental or consequential damages, so some of the terms above may not be applicable to you.
+
+11. Export Regulations.
+
+All Software, documents, technical data, and any other materials delivered under this Agreement are subject to U.S. export control laws and may be subject to export or import regulations in other countries. You agree to comply strictly with these laws and regulations and acknowledge that you have the responsibility to obtain any licenses to export, re-export, or import as may be required after delivery to you.
+
+12. U.S. Government Restricted Rights.
+
+If Software is being acquired by or on behalf of the U.S. Government or by a U.S. Government prime contractor or subcontractor (at any tier), then the Government's rights in Software and accompanying documentation will be only as set forth in this Agreement; this is in accordance with 48 CFR 227.7201 through 227.7202-4 (for Department of Defense (DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD acquisitions).
+
+13. Governing Law.
+
+Any action related to this Agreement will be governed by California law and controlling U.S. federal law. No choice of law rules of any jurisdiction will apply.
+
+14. Severability.
+
+If any provision of this Agreement is held to be unenforceable, this Agreement will remain in effect with the provision omitted, unless omission would frustrate the intent of the parties, in which case this Agreement will immediately terminate.
+
+15. Integration.
+
+This Agreement, including any terms contained in your Entitlement, is the entire agreement between you and Sun relating to its subject matter. It supersedes all prior or contemporaneous oral or written communications, proposals, representations and warranties and prevails over any conflicting or additional terms of any quote, order, acknowledgment, or other communication between the parties relating to its subject matter during the term of this Agreement. No modification of this Agreement will be binding, unless in writing and signed by an authorized representative of each party.
+
+Please contact Sun Microsystems, Inc. 4150 Network Circle, Santa Clara, California 95054 if you have questions.
+
Property changes on: subprojects/jbossws-sun-wsimport/license.txt
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.bat
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.bat (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.bat 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,56 @@
+@echo off
+
+REM
+REM The contents of this file are subject to the terms
+REM of the Common Development and Distribution License
+REM (the License). You may not use this file except in
+REM compliance with the License.
+REM
+REM You can obtain a copy of the license at
+REM https://glassfish.dev.java.net/public/CDDLv1.0.html.
+REM See the License for the specific language governing
+REM permissions and limitations under the License.
+REM
+REM When distributing Covered Code, include this CDDL
+REM Header Notice in each file and include the License file
+REM at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+REM If applicable, add the following below the CDDL Header,
+REM with the fields enclosed by brackets [] replaced by
+REM you own identifying information:
+REM "Portions Copyrighted [year] [name of copyright owner]"
+REM
+REM Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+REM
+
+
+
+
+rem
+rem Infer JAXWS_HOME if not set
+rem
+if not "%JAXWS_HOME%" == "" goto CHECKJAVAHOME
+
+rem Try to locate JAXWS_HOME
+set JAXWS_HOME=%~dp0
+set JAXWS_HOME=%JAXWS_HOME%\..
+if exist %JAXWS_HOME%\lib\jaxws-tools.jar goto CHECKJAVAHOME
+
+rem Unable to find it
+echo JAXWS_HOME must be set before running this script
+goto END
+
+:CHECKJAVAHOME
+if not "%JAVA_HOME%" == "" goto USE_JAVA_HOME
+
+set JAVA=java
+goto LAUNCH
+
+:USE_JAVA_HOME
+set JAVA="%JAVA_HOME%\bin\java"
+goto LAUNCH
+
+:LAUNCH
+%JAVA% %WSGEN_OPTS% -cp "%JAVA_HOME%\lib\tools.jar;%JAXWS_HOME%\lib\jaxws-tools.jar" com.sun.tools.ws.WsGen %*
+
+:END
+%COMSPEC% /C exit %ERRORLEVEL%
Added: subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.sh
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.sh (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/etc/wsgen.sh 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+#
+# The contents of this file are subject to the terms
+# of the Common Development and Distribution License
+# (the License). You may not use this file except in
+# compliance with the License.
+#
+# You can obtain a copy of the license at
+# https://glassfish.dev.java.net/public/CDDLv1.0.html.
+# See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL
+# Header Notice in each file and include the License file
+# at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+# If applicable, add the following below the CDDL Header,
+# with the fields enclosed by brackets [] replaced by
+# you own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+#
+
+#
+# infer JAXWS_HOME if not set
+#
+if [ -z "$JAXWS_HOME" ]
+then
+ # search the installation directory
+
+ PRG=$0
+ progname=`basename $0`
+ saveddir=`pwd`
+
+ cd `dirname $PRG`
+
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname $PRG`/$link"
+ fi
+ done
+
+ JAXWS_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ cd "$saveddir"
+ JAXWS_HOME=`cd "$JAXWS_HOME" && pwd`
+
+ cd $saveddir
+fi
+
+[ `expr \`uname\` : 'CYGWIN'` -eq 6 ] &&
+{
+ JAXWS_HOME=`cygpath -w "$JAXWS_HOME"`
+}
+
+#
+# use or infer JAVA_HOME
+#
+if [ -n "$JAVA_HOME" ]
+then
+ JAVA="$JAVA_HOME"/bin/java
+ LOCALCLASSPATH="$JAVA_HOME"/lib/tools.jar
+else
+ JAVA=java
+ JAVACMD=`which $JAVA`
+ BINDIR=`dirname $JAVACMD`
+ LOCALCLASSPATH="$BINDIR"/../lib/tools.jar
+fi
+
+
+exec $JAVA $WSGEN_OPTS -cp "$LOCALCLASSPATH:$JAXWS_HOME/lib/jaxws-tools.jar" com.sun.tools.ws.WsGen "$@"
Added: subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.bat
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.bat (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.bat 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,56 @@
+@echo off
+
+REM
+REM The contents of this file are subject to the terms
+REM of the Common Development and Distribution License
+REM (the License). You may not use this file except in
+REM compliance with the License.
+REM
+REM You can obtain a copy of the license at
+REM https://glassfish.dev.java.net/public/CDDLv1.0.html.
+REM See the License for the specific language governing
+REM permissions and limitations under the License.
+REM
+REM When distributing Covered Code, include this CDDL
+REM Header Notice in each file and include the License file
+REM at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+REM If applicable, add the following below the CDDL Header,
+REM with the fields enclosed by brackets [] replaced by
+REM you own identifying information:
+REM "Portions Copyrighted [year] [name of copyright owner]"
+REM
+REM Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+REM
+
+
+
+
+rem
+rem Infer JAXWS_HOME if not set
+rem
+if not "%JAXWS_HOME%" == "" goto CHECKJAVAHOME
+
+rem Try to locate JAXWS_HOME
+set JAXWS_HOME=%~dp0
+set JAXWS_HOME=%JAXWS_HOME%\..
+if exist %JAXWS_HOME%\lib\jaxws-tools.jar goto CHECKJAVAHOME
+
+rem Unable to find it
+echo JAXWS_HOME must be set before running this script
+goto END
+
+:CHECKJAVAHOME
+if not "%JAVA_HOME%" == "" goto USE_JAVA_HOME
+
+set JAVA=java
+goto LAUNCH
+
+:USE_JAVA_HOME
+set JAVA="%JAVA_HOME%\bin\java"
+goto LAUNCH
+
+:LAUNCH
+%JAVA% %WSIMPORT_OPTS% -cp "%JAVA_HOME%\lib\tools.jar;%JAXWS_HOME%\lib\jaxws-tools.jar" com.sun.tools.ws.WsImport %*
+
+:END
+%COMSPEC% /C exit %ERRORLEVEL%
Added: subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.sh
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.sh (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/etc/wsimport.sh 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+#
+# The contents of this file are subject to the terms
+# of the Common Development and Distribution License
+# (the License). You may not use this file except in
+# compliance with the License.
+#
+# You can obtain a copy of the license at
+# https://glassfish.dev.java.net/public/CDDLv1.0.html.
+# See the License for the specific language governing
+# permissions and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL
+# Header Notice in each file and include the License file
+# at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+# If applicable, add the following below the CDDL Header,
+# with the fields enclosed by brackets [] replaced by
+# you own identifying information:
+# "Portions Copyrighted [year] [name of copyright owner]"
+#
+# Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+#
+
+#
+# infer JAXWS_HOME if not set
+#
+if [ -z "$JAXWS_HOME" ]
+then
+ # search the installation directory
+
+ PRG=$0
+ progname=`basename $0`
+ saveddir=`pwd`
+
+ cd `dirname $PRG`
+
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname $PRG`/$link"
+ fi
+ done
+
+ JAXWS_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ cd "$saveddir"
+ JAXWS_HOME=`cd "$JAXWS_HOME" && pwd`
+
+ cd $saveddir
+fi
+
+[ `expr \`uname\` : 'CYGWIN'` -eq 6 ] &&
+{
+ JAXWS_HOME=`cygpath -w "$JAXWS_HOME"`
+}
+
+#
+# use or infer JAVA_HOME
+#
+if [ -n "$JAVA_HOME" ]
+then
+ JAVA="$JAVA_HOME"/bin/java
+ LOCALCLASSPATH="$JAVA_HOME"/lib/tools.jar
+else
+ JAVA=java
+ JAVACMD=`which $JAVA`
+ BINDIR=`dirname $JAVACMD`
+ LOCALCLASSPATH="$BINDIR"/../lib/tools.jar
+fi
+
+exec $JAVA $WSIMPORT_OPTS -cp "$LOCALCLASSPATH:$JAXWS_HOME/lib/jaxws-tools.jar" com.sun.tools.ws.WsImport "$@"
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/AnnotationProcessorFactoryImpl.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/AnnotationProcessorFactoryImpl.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/AnnotationProcessorFactoryImpl.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,114 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.istack.ws;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.AnnotationProcessorContext;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.WebServiceAP;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+
+
+
+/*
+ * The JAX-WS {(a)com.sun.mirror.apt.AnnotationProcessorFactory AnnotationProcessorFactory}
+ * class used by the <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>
+ * framework.
+ */
+public class AnnotationProcessorFactoryImpl implements AnnotationProcessorFactory {
+
+ private static WebServiceAP wsAP;
+ /*
+ * Processor doesn't examine any options.
+ */
+ static final Collection<String> supportedOptions = Collections.unmodifiableSet(new HashSet<String>());
+
+
+ /*
+ * Supports javax.jws.*, javax.jws.soap.* and javax.xml.ws.* annotations.
+ */
+ static Collection<String> supportedAnnotations;
+ static {
+ Collection<String> types = new HashSet<String>();
+ types.add("javax.jws.HandlerChain");
+ types.add("javax.jws.Oneway");
+ types.add("javax.jws.WebMethod");
+ types.add("javax.jws.WebParam");
+ types.add("javax.jws.WebResult");
+ types.add("javax.jws.WebService");
+ types.add("javax.jws.soap.InitParam");
+ types.add("javax.jws.soap.SOAPBinding");
+ types.add("javax.jws.soap.SOAPMessageHandler");
+ types.add("javax.jws.soap.SOAPMessageHandlers");
+ types.add("javax.xml.ws.BeginService");
+ types.add("javax.xml.ws.EndService");
+ types.add("javax.xml.ws.BindingType");
+ types.add("javax.xml.ws.ParameterIndex");
+ types.add("javax.xml.ws.RequestWrapper");
+ types.add("javax.xml.ws.ResponseWrapper");
+ types.add("javax.xml.ws.ServiceMode");
+ types.add("javax.xml.ws.WebEndpoint");
+ types.add("javax.xml.ws.WebFault");
+ types.add("javax.xml.ws.WebServiceClient");
+ types.add("javax.xml.ws.WebServiceProvider");
+ types.add("javax.xml.ws.WebServiceRef");
+
+ types.add("javax.xml.ws.security.MessageSecurity");
+ supportedAnnotations = Collections.unmodifiableCollection(types);
+ }
+
+ public AnnotationProcessorFactoryImpl() {
+ }
+
+
+ public Collection<String> supportedOptions() {
+ return supportedOptions;
+ }
+
+ public Collection<String> supportedAnnotationTypes() {
+ return supportedAnnotations;
+ }
+
+ /*
+ * Return an instance of the {@link org.jboss.com.sun.istack.ws.WSAP WSAP} AnnotationProcesor.
+ */
+ public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds,
+ AnnotationProcessorEnvironment apEnv) {
+
+ if (wsAP == null) {
+ AnnotationProcessorContext context = new AnnotationProcessorContext();
+ wsAP = new WebServiceAP(null, null, null, context);
+
+ }
+ wsAP.init(apEnv);
+ return wsAP;
+ }
+}
+
+
+
+
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/AnnotationProcessorFactoryImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/package-info.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/package-info.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/package-info.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,36 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+/**
+ *
+ * <P>This document describes the {@link com.sun.mirror.apt.AnnotationProcessor AnnotationProcessor}
+ * included with JAX-WS 2.0.
+ *
+ * <p>The {@link org.jboss.com.sun.istack.ws.AnnotationProcessorFactoryImpl AnnoatationnProcessorFactoryImpl} class
+ * tells the <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>
+ * framework that there exists an {(a)com.sun.mirror.apt.AnnotationProcessor AnnotationProcessor}
+ * ({@link com.sun.istak.ws.WSAP WSAP}) for for processing javax.jws.*, javax.jws.soap.*,
+ * and javax.xml.ws.* annotations.
+ *
+ * @ArchitectureDocument
+*/
+package org.jboss.com.sun.istack.ws;
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/istack/ws/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/Invoker.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/Invoker.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/Invoker.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,75 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws;
+
+import com.sun.tools.xjc.api.util.APTClassLoader;
+import com.sun.tools.xjc.api.util.ToolsJarNotFoundException;
+
+import java.io.OutputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+/**
+ * Invokes JAX-WS tools in a special class loader that can pick up APT classes,
+ * even if it's not available in the tool launcher classpath.
+ *
+ * @author Kohsuke Kawaguchi
+ */
+final class Invoker {
+ /**
+ * List of packages that need to be loaded in {@link APTClassLoader}.
+ */
+ private static final String[] prefixes = {
+ "com.sun.tools.jxc.",
+ "com.sun.tools.xjc.",
+ "com.sun.tools.apt.",
+ "org.jboss.com.sun.tools.ws.",
+ "com.sun.tools.javac.",
+ "com.sun.tools.javadoc.",
+ "com.sun.mirror."
+ };
+
+ static void main(String toolName, String[] args) throws Throwable {
+ ClassLoader oldcc = Thread.currentThread().getContextClassLoader();
+ try {
+ APTClassLoader cl = new APTClassLoader(Invoker.class.getClassLoader(),prefixes);
+ Thread.currentThread().setContextClassLoader(cl);
+
+ Class compileTool = cl.loadClass("org.jboss.com.sun.tools.ws.wscompile.CompileTool");
+ Constructor ctor = compileTool.getConstructor(OutputStream.class,String.class);
+ Object tool = ctor.newInstance(System.out,toolName);
+ Method runMethod = compileTool.getMethod("run",String[].class);
+ boolean r = (Boolean)runMethod.invoke(tool,new Object[]{args});
+ System.exit(r ? 0 : 1);
+ } catch (ToolsJarNotFoundException e) {
+ System.err.println(e.getMessage());
+ } catch (InvocationTargetException e) {
+ throw e.getCause();
+ } finally {
+ Thread.currentThread().setContextClassLoader(oldcc);
+ }
+
+ System.exit(1);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/Invoker.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ToolVersion.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ToolVersion.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ToolVersion.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,35 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws;
+
+import org.jboss.com.sun.xml.ws.util.Version;
+
+/**
+ * Obtains the version number of the JAX-WS tools.
+ * @author Kohsuke Kawaguchi
+ */
+public abstract class ToolVersion {
+ private ToolVersion() {} // no instanciation please
+
+ public static final Version VERSION = Version.create(ToolVersion.class.getResourceAsStream("version.properties"));
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ToolVersion.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsGen.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsGen.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsGen.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,32 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws;
+
+/**
+ * @author Vivek Pandey
+ */
+
+public class WsGen {
+ public static void main(String[] args) throws Throwable {
+ Invoker.main("wsgen",args);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsGen.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsImport.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsImport.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsImport.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,32 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws;
+
+/**
+ * @author Vivek Pandey
+ */
+
+public class WsImport {
+ public static void main(String[] args) throws Throwable {
+ Invoker.main("wsimport",args);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/WsImport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/Apt.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/Apt.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/Apt.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,486 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.ant;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Execute;
+import org.apache.tools.ant.taskdefs.LogStreamHandler;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * apt task for use with the JAXWS project.
+ */
+public class Apt extends Task {
+
+ /** -classpath option */
+ protected Path compileClasspath = null;
+
+ public Path getClasspath() { return compileClasspath; }
+ public void setClasspath(Path classpath) {
+ if (compileClasspath == null) {
+ compileClasspath = classpath;
+ } else {
+ compileClasspath.append(classpath);
+ }
+ }
+
+ /**
+ * Creates a nested classpath element.
+ */
+ public Path createClasspath() {
+ if (compileClasspath == null) {
+ compileClasspath = new Path(project);
+ }
+ return compileClasspath.createPath();
+ }
+
+ /**
+ * Adds a reference to a CLASSPATH defined elsewhere.
+ */
+ public void setClasspathRef(Reference r) {
+ createClasspath().setRefid(r);
+ }
+
+ /** -d option: directory to output processor and javac generated class files */
+ private File destDir = null;
+ public File getDestdir() { return this.destDir; }
+ public void setDestdir(File base) { this.destDir = base; }
+
+ /** -s option: directory to place processor generated source files */
+ private File sourceDestDir;
+ public void setSourcedestdir(File sourceBase) { this.sourceDestDir = sourceBase; }
+ public File getSourcedestdir() { return sourceDestDir; }
+
+
+ /** -A option */
+ protected List<Option> options = new ArrayList<Option>();
+ public List<Option> getOptions() { return options; }
+
+ public Option createOption() {
+ Option option = new Option();
+ options.add(option);
+ return option;
+ }
+
+ /** -J<flag> option: Pass <flag> directly to the runtime */
+ protected List<Jvmarg> jvmargs = new ArrayList<Jvmarg>();
+ public List<Jvmarg> getJvmargs() { return jvmargs; }
+
+ public Jvmarg createJvmarg() {
+ Jvmarg jvmarg = new Jvmarg();
+ jvmargs.add(jvmarg);
+ return jvmarg;
+ }
+
+ /** -nocompile option */
+ private boolean noCompile = false;
+ public boolean isNocompile() { return noCompile; }
+ public void setNocompile(boolean noCompile) { this.noCompile = noCompile; }
+
+ /******************** -print option **********************/
+ private boolean print = false;
+ public boolean isPrint() { return print; }
+ public void setPrint(boolean print) { this.print = print; }
+
+ /******************** -factorypath option **********************/
+ private File factoryPath = null;
+ public File getFactorypath() { return factoryPath; }
+ public void setFactorypath(File factoryPath) { this.factoryPath = factoryPath; }
+
+ /******************** -factory option **********************/
+ private String factory = null;
+ public String getFactory() { return factory; }
+ public void setFactory(String factory) { this.factory = factory; }
+
+ /******************** -XListAnnotationTypes option **********************/
+ private boolean xListAnnotationTypes = false;
+ public boolean isXlistannotationtypes() { return xListAnnotationTypes; }
+ public void setXlistannotationtypes(boolean xListAnnotationTypes) { this.xListAnnotationTypes = xListAnnotationTypes; }
+
+ /******************** -XListDeclarations option **********************/
+ private boolean xListDeclarations = false;
+ public boolean isXlistdeclarations() { return xListDeclarations; }
+ public void setXlistdeclarations(boolean xListDeclarations) { this.xListDeclarations = xListDeclarations; }
+
+ /******************** -XPrintAptRounds option **********************/
+ private boolean xPrintAptRounds = false;
+ public boolean isXprintaptrounds() { return xPrintAptRounds; }
+ public void setXprintaptrounds(boolean xPrintAptRounds) { this.xPrintAptRounds = xPrintAptRounds; }
+
+ /******************** -XPrintFactoryInfo option **********************/
+ private boolean xPrintFactoryInfo = false;
+ public boolean isXprintfactoryinfo() { return xPrintFactoryInfo; }
+ public void setXprintfactoryinfo(boolean xPrintFactoryInfo) { this.xPrintFactoryInfo = xPrintFactoryInfo; }
+
+ /******************** -XclassesAsDecls option **********************/
+ private boolean xClassesAsDecls = false;
+ public boolean isXclassesasdecls() { return xClassesAsDecls; }
+ public void setXclassesasdecls(boolean xClassesAsDecls) { this.xClassesAsDecls = xClassesAsDecls; }
+
+ /** Inherited from javac */
+
+ /** -g option: debugging info */
+ protected boolean debug = false;
+ public boolean isDebug() { return debug; }
+ public void setDebug(boolean debug) { this.debug = debug; }
+
+ /** debug level */
+ protected String debugLevel = null;
+ public String getDebuglevel() { return debugLevel; }
+ public void setDebuglevel(String debugLevel) { this.debugLevel = debugLevel; }
+
+ /** -nowarn option: generate no warnings */
+ protected boolean nowarn = false;
+ public boolean isNowarn() { return nowarn; }
+ public void setNowarn(boolean nowarn) { this.nowarn = nowarn; }
+
+ /** -deprecation option: output source locations where deprecated APIs are used */
+ protected boolean deprecation = false;
+ public boolean isDeprecation() { return deprecation; }
+ public void setDeprecation(boolean deprecation) { this.deprecation = deprecation; }
+
+ /** -bootclasspath option: override location of bootstrap class files */
+ protected Path bootclassPath = null;
+ public Path getBootclasspath() { return bootclassPath; }
+ public void setBootclasspath(Path bootclassPath) { this.bootclassPath = bootclassPath; }
+
+ /** -extdirs option: override location of installed extensions */
+ protected String extdirs = null;
+ public String getExtdirs() { return extdirs; }
+ public void setExtdirs(String extdirs) { this.extdirs = extdirs; }
+
+ /** -endorseddirs option: override location of endorsed standards path */
+ protected String endorseddirs = null;
+ public String getEndorseddirs() { return endorseddirs; }
+ public void setEndorseddirs(String endorseddirs) { this.endorseddirs = endorseddirs; }
+
+ /** -verbose option: output messages about what the compiler is doing */
+ protected boolean verbose = false;
+ public boolean isVerbose() { return verbose; }
+ public void setVerbose(boolean verbose) { this.verbose = verbose; }
+
+ /** -sourcepath option: Specify where to find input source files */
+ protected Path sourcePath = null;
+ public Path getSourcepath() { return sourcePath; }
+ public void setSourcepath(Path sourcePath) { this.sourcePath = sourcePath; }
+
+ /** -encoding option: character encoding used by the source files */
+ protected String encoding = null;
+ public String getEncoding() { return encoding; }
+ public void setEncoding(String encoding) { this.encoding = encoding; }
+
+ /** -target option: generate class files for specific VM version */
+ protected String targetVM = null;
+ public String getTarget() { return targetVM; }
+ public void setTarget(String target) { this.targetVM = target; }
+
+
+
+ /** Others */
+
+ /** -fork option: */
+ protected boolean fork = false;
+ public boolean isFork() { return fork; }
+ public void setFork(boolean fork) { this.fork = fork; }
+
+ protected List<FileSet> sourceFileset = new ArrayList<FileSet>();
+ public void addConfiguredSource(FileSet fileset) {
+ sourceFileset.add(fileset);
+ }
+
+
+ private Commandline setupAptCommand() {
+ Commandline cmd = setupAptArgs();
+
+ // classpath option (cp option just uses classpath option)
+ Path classpath = getClasspath();
+
+ if (classpath != null && !classpath.toString().equals("")) {
+ cmd.createArgument().setValue("-classpath");
+ cmd.createArgument().setPath(classpath);
+ }
+ return cmd;
+ }
+
+ private Commandline setupAptForkCommand() {
+ CommandlineJava forkCmd = new CommandlineJava();
+
+ Path classpath = getClasspath();
+ forkCmd.createClasspath(getProject()).append(classpath);
+ forkCmd.setClassname("com.sun.tools.apt.Main");
+ if (null != getJvmargs()) {
+ for (Jvmarg jvmarg : jvmargs) {
+ forkCmd.createVmArgument().setLine("-J" + jvmarg.getValue());
+ }
+ }
+
+ Commandline cmd = setupAptArgs();
+ cmd.createArgument(true).setLine(forkCmd.toString());
+ return cmd;
+ }
+
+ private Commandline setupAptArgs() {
+ Commandline cmd = new Commandline();
+
+ if (null != getDestdir() && !getDestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-d");
+ cmd.createArgument().setFile(getDestdir());
+ }
+
+ if (null != getSourcedestdir() && !getSourcedestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-s");
+ cmd.createArgument().setFile(getSourcedestdir());
+ }
+
+ if (getSourcepath() == null)
+ throw new BuildException("\"sourcePath\" attribute must be set.");
+
+ if (getSourcepath() != null && !getSourcepath().toString().equals("")) {
+ cmd.createArgument().setValue("-sourcepath");
+ cmd.createArgument().setValue(getSourcepath().toString());
+ }
+
+ if (getBootclasspath() != null && !getBootclasspath().toString().equals("")) {
+ cmd.createArgument().setValue("-bootclasspath");
+ cmd.createArgument().setValue(getBootclasspath().toString());
+ }
+
+ if (getExtdirs() != null && !getExtdirs().equals("")) {
+ cmd.createArgument().setValue("-extdirs");
+ cmd.createArgument().setValue(getExtdirs());
+ }
+
+ if (getEndorseddirs() != null && !getEndorseddirs().equals("")) {
+ cmd.createArgument().setValue("-endorseddirs");
+ cmd.createArgument().setValue(getEndorseddirs());
+ }
+
+ if (isDebug()) {
+ String debugOption = "";
+ debugOption = "-g";
+ if (getDebuglevel() != null && !getDebuglevel().equals(""))
+ debugOption += ":" + getDebuglevel();
+ cmd.createArgument().setValue(debugOption);
+ } else
+ cmd.createArgument().setValue("-g:none");
+
+ if (isVerbose())
+ cmd.createArgument().setValue("-verbose");
+
+ if (getEncoding() != null && !getEncoding().equals("")) {
+ cmd.createArgument().setValue("-encoding");
+ cmd.createArgument().setValue(getEncoding());
+ }
+
+ if (getTarget() != null && !getTarget().equals("")) {
+ cmd.createArgument().setValue("-target");
+ cmd.createArgument().setValue(getTarget());
+ }
+
+ for (Jvmarg jvmarg : jvmargs) {
+ cmd.createArgument().setValue("-J" + jvmarg.getValue());
+ }
+
+ for (Option option : options) {
+ cmd.createArgument().setValue("-A" + option.getKey() + "=" + option.getValue());
+ }
+
+ if(isNowarn()){
+ cmd.createArgument().setValue("-nowarn");
+ }
+
+ if(isNocompile()){
+ cmd.createArgument().setValue("-nocompile");
+ }
+
+ if(isDeprecation()){
+ cmd.createArgument().setValue("-deprecation");
+ }
+
+ if(isPrint()){
+ cmd.createArgument().setValue("-print");
+ }
+
+ if(getFactorypath() != null){
+ cmd.createArgument().setValue("-factorypath");
+ cmd.createArgument().setValue(getFactorypath().toString());
+ }
+
+ if(getFactory() != null){
+ cmd.createArgument().setValue("-factory");
+ cmd.createArgument().setValue(getFactory());
+ }
+
+ if (isXlistannotationtypes()) {
+ cmd.createArgument().setValue("-XListAnnotationTypes");
+ }
+
+ if (isXlistdeclarations()) {
+ cmd.createArgument().setValue("-XListDeclarations");
+ }
+
+ if (isXprintaptrounds()) {
+ cmd.createArgument().setValue("-XPrintAptRounds");
+ }
+
+ if (isXprintfactoryinfo()) {
+ cmd.createArgument().setValue("-XPrintFactoryInfo");
+ }
+
+ if (isXprintfactoryinfo()) {
+ cmd.createArgument().setValue("-XclassesAsDecls");
+ }
+
+ Set<File> sourceFiles = new HashSet<File>();
+ prepareSourceList(sourceFiles);
+
+ if(!sourceFiles.isEmpty()){
+ for(File source : sourceFiles){
+ cmd.createArgument().setFile(source);
+ }
+ }
+
+ return cmd;
+ }
+
+ void prepareSourceList(Set<File> sourceFiles) throws BuildException {
+ if (sourceFileset != null) {
+ for (FileSet fileset : sourceFileset) {
+ DirectoryScanner ds = fileset.getDirectoryScanner(getProject());
+ String[] includedFiles = ds.getIncludedFiles();
+ File baseDir = ds.getBasedir();
+ for (int i = 0; i < includedFiles.length; ++i) {
+ sourceFiles.add(new File(baseDir, includedFiles[i]));
+ }
+ }
+ }
+ }
+
+ /** Called by the project to let the task do it's work **/
+ public void execute() throws BuildException {
+
+ PrintWriter writer = null;
+ boolean ok = false;
+ try {
+ Commandline cmd = fork ?
+ setupAptForkCommand() : setupAptCommand();
+
+ if (verbose) {
+ log("command line: " + "apt " + cmd.toString());
+ }
+ int status = 0;
+ if (fork) {
+ status = run(cmd.getCommandline());
+ } else {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ writer = new PrintWriter(baos);
+
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+ try {
+ com.sun.tools.apt.Main aptTool = new com.sun.tools.apt.Main();
+ status = aptTool.process(writer, cmd.getArguments());
+ writer.flush();
+ if (verbose || baos.size()!=0)
+ log(baos.toString());
+ } finally {
+ Thread.currentThread().setContextClassLoader(old);
+ }
+ }
+ ok = (status == 0) ? true : false;
+ if (!ok) {
+ if (!verbose) {
+ log("Command invoked: "+"apt "+cmd.toString());
+ }
+ throw new BuildException("apt failed", location);
+ }
+ } catch (Exception ex) {
+ if (ex instanceof BuildException) {
+ throw (BuildException)ex;
+ } else {
+ throw new BuildException("Error starting apt: ", ex,
+ getLocation());
+ }
+ } finally {
+ if (writer != null) {
+ writer.close();
+ }
+ }
+ }
+
+ /**
+ * Executes the given classname with the given arguments in a separate VM.
+ */
+ private int run(String[] command) throws BuildException {
+ FileOutputStream fos = null;
+ Execute exe = null;
+ LogStreamHandler logstr = new LogStreamHandler(this,
+ Project.MSG_INFO, Project.MSG_WARN);
+ exe = new Execute(logstr);
+ exe.setAntRun(project);
+ exe.setCommandline(command);
+ try {
+ int rc = exe.execute();
+ if (exe.killedProcess()) {
+ log("Timeout: killed the sub-process", Project.MSG_WARN);
+ }
+ return rc;
+ } catch (IOException e) {
+ throw new BuildException(e, location);
+ }
+ }
+
+ public static class Option {
+ protected String key;
+ protected String value;
+
+ public String getKey() { return key; }
+ public void setKey(String key) { this.key = key; }
+
+ public String getValue() { return value; }
+ public void setValue(String value) { this.value = value; }
+ }
+
+ public static class Jvmarg {
+ protected String value;
+
+ public String getValue() { return value; }
+ public void setValue(String value) { this.value = value; }
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/Apt.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsGen.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsGen.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsGen.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,509 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.ant;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Execute;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.taskdefs.LogStreamHandler;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.jboss.com.sun.tools.ws.wscompile.CompileTool;
+import org.jboss.com.sun.xml.ws.util.VersionUtil;
+
+
+/**
+ * wsgen task for use with the JAXWS project.
+ *
+ */
+public class WsGen extends MatchingTask {
+ private CommandlineJava cmd = new CommandlineJava();
+ /************************* -classpath option *************************/
+ protected Path compileClasspath = null;
+
+ /**
+ * Gets the classpath.
+ */
+ public Path getClasspath() {
+ return compileClasspath;
+ }
+
+ /**
+ * Set the classpath to be used for this compilation.
+ */
+ public void setClasspath(Path classpath) {
+ if (compileClasspath == null) {
+ compileClasspath = classpath;
+ } else {
+ compileClasspath.append(classpath);
+ }
+ }
+
+ /**
+ * Creates a nested classpath element.
+ */
+ public Path createClasspath() {
+ if (compileClasspath == null) {
+ compileClasspath = new Path(project);
+ }
+ return compileClasspath.createPath();
+ }
+
+ /**
+ * Adds a reference to a CLASSPATH defined elsewhere.
+ */
+ public void setClasspathRef(Reference r) {
+ createClasspath().setRefid(r);
+ }
+
+ /************************* -cp option *************************/
+ /**
+ * Gets the classpath.
+ */
+ public Path getCP() {
+ return getClasspath();
+ }
+
+ /**
+ * Set the classpath to be used for this compilation.
+ */
+ public void setCP(Path classpath) {
+ setClasspath(classpath);
+ }
+
+ /************************* -d option *************************/
+ private File destDir = null;
+
+ /** Gets the base directory to output generated class. **/
+ public File getDestdir() {
+ return this.destDir;
+ }
+
+ /** Sets the base directory to output generated class. **/
+ public void setDestdir(File base) {
+ this.destDir = base;
+ }
+
+ /**
+ * Adds a JVM argument.
+ *
+ * @return JVM argument created
+ */
+ public Commandline.Argument createJvmarg() {
+ return cmd.createVmArgument();
+ }
+
+ /******************** -extensions option **********************/
+ protected boolean extension;
+
+ /** Gets the "extension" flag. **/
+ public boolean getExtension() {
+ return extension;
+ }
+
+ /** Sets the "extension" flag. **/
+ public void setExtension(boolean extension) {
+ this.extension = extension;
+ }
+
+ /************************* -keep option *************************/
+ private boolean keep = false;
+
+ /** Gets the "keep" flag. **/
+ public boolean getKeep() {
+ return keep;
+ }
+
+ /** Sets the "keep" flag. **/
+ public void setKeep(boolean keep) {
+ this.keep = keep;
+ }
+
+ /************************* -fork option *************************/
+ private boolean fork = false;
+
+ /** Gets the "fork" flag. **/
+ public boolean getFork() {
+ return fork;
+ }
+
+ /** Sets the "fork" flag. **/
+ public void setFork(boolean fork) {
+ this.fork = fork;
+ }
+
+ /************************* -r option *************************/
+ private File resourceDestDir = null;
+
+ /** Gets the directory for non-class generated files. **/
+ public File getResourcedestdir() {
+ return this.resourceDestDir;
+ }
+
+ /** Sets the directory for non-class generated files. **/
+ public void setResourcedestdir(File resourceDir) {
+ this.resourceDestDir = resourceDir;
+ }
+
+ /************************* -O option *************************/
+ private boolean optimize = false;
+
+ /** Gets the optimize flag. **/
+ public boolean getOptimize() {
+ return optimize;
+ }
+
+ /** Sets the optimize flag. **/
+ public void setOptimize(boolean optimize) {
+ this.optimize = optimize;
+ }
+
+ /************************* -s option *************************/
+ private File sourceDestDir;
+
+ /** Sets the directory to place generated source java files. **/
+ public void setSourcedestdir(File sourceBase) {
+ keep = true;
+ this.sourceDestDir = sourceBase;
+ }
+
+ /** Gets the directory to place generated source java files. **/
+ public File getSourcedestdir() {
+ return sourceDestDir;
+ }
+
+ /************************* -verbose option *************************/
+ protected boolean verbose = false;
+
+ /** Gets the "verbose" flag. **/
+ public boolean getVerbose() {
+ return verbose;
+ }
+
+ /** Sets the "verbose" flag. **/
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ /************************* -g option *************************/
+ private boolean debug = false;
+
+ /** Gets the debug flag. **/
+ public boolean getDebug() {
+ return debug;
+ }
+
+ /** Sets the debug flag. **/
+ public void setDebug(boolean debug) {
+ this.debug = debug;
+ }
+
+ /************************* -wsdl option *************************/
+ private boolean genWsdl = false;
+
+ /** Gets the genWsdl flag. **/
+ public boolean getGenwsdl() {
+ return genWsdl;
+ }
+
+ /** Sets the genWsdl flag. **/
+ public void setGenwsdl(boolean genWsdl) {
+ this.genWsdl = genWsdl;
+ }
+
+ /************* protocol option used only with -wsdl option*****************/
+ private String protocol = "";
+
+ /** Gets the protocol. **/
+ public String getProtocol() {
+ return protocol;
+ }
+
+ /** Sets the protocol. **/
+ public void setProtocol(String protocol) {
+ this.protocol = protocol;
+ }
+
+ /************* serviceName option used only with -wsdl option*****************/
+ private String serviceName = null;
+
+ /** Gets the serviceName. **/
+ public String getServicename() {
+ return serviceName;
+ }
+
+ /** Sets the serviceName. **/
+ public void setServicename(String name) {
+ this.serviceName = name;
+ }
+
+ /************* portName option used only with -wsdl option*****************/
+ private String portName = null;
+
+ /** Gets the portName. **/
+ public String getPortname() {
+ return portName;
+ }
+
+ /** Sets the serviceName. **/
+ public void setPortname(String name) {
+ this.portName = name;
+ }
+
+ /*********************** include ant runtime **********************/
+ /** not sure if these methods are needed */
+ private boolean includeAntRuntime = false;
+
+ /**
+ * Include ant's own classpath in this task's classpath?
+ */
+ public void setIncludeantruntime(boolean include) {
+ includeAntRuntime = include;
+ }
+
+ /**
+ * Gets whether or not the ant classpath is to be included in the
+ * task's classpath.
+ */
+ public boolean getIncludeantruntime() {
+ return includeAntRuntime;
+ }
+
+ /*********************** include java runtime **********************/
+ /** not sure if these methods are needed */
+ private boolean includeJavaRuntime = false;
+
+ /**
+ * Sets whether or not to include the java runtime libraries to this
+ * task's classpath.
+ */
+ public void setIncludejavaruntime(boolean include) {
+ includeJavaRuntime = include;
+ }
+
+ /**
+ * Gets whether or not the java runtime should be included in this
+ * task's classpath.
+ */
+ public boolean getIncludejavaruntime() {
+ return includeJavaRuntime;
+ }
+
+ private String sei;
+ /**
+ * @return Returns the sei.
+ */
+ public String getSei() {
+ return sei;
+ }
+ public void setSei(String endpointImplementationClass) {
+ this.sei = endpointImplementationClass;
+ }
+
+ private void setupWscompileCommand() {
+ Path classpath = getClasspath();
+ if (classpath != null && !classpath.toString().equals("")) {
+ cmd.createArgument().setValue("-classpath");
+ cmd.createArgument().setPath(classpath);
+ }
+ setupWscompileArgs();
+
+ }
+
+ private void setupWscompileForkCommand() {
+
+ Path classpath = getClasspath();
+ cmd.createClasspath(getProject()).append(classpath);
+ cmd.setClassname("org.jboss.com.sun.tools.ws.WsGen");
+ setupWscompileArgs();
+ //cmd.createArgument(true).setLine(forkCmd.toString());
+
+ }
+
+ private void setupWscompileArgs() {
+
+ // d option
+ if (null != getDestdir() && !getDestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-d");
+ cmd.createArgument().setFile(getDestdir());
+ }
+
+ // g option
+ if (getDebug()) {
+ cmd.createArgument().setValue("-g");
+ }
+
+ // extension flag
+ if (getExtension()) {
+ cmd.createArgument().setValue("-extension");
+ }
+
+ // keep option
+ if (getKeep()) {
+ cmd.createArgument().setValue("-keep");
+ }
+
+ if (getGenwsdl()) {
+ String tmp = "-wsdl";
+ if (protocol.length() > 0)
+ tmp += ":"+protocol;
+ cmd.createArgument().setValue(tmp);
+
+ if (serviceName != null && serviceName.length() > 0) {
+ cmd.createArgument().setValue("-servicename");
+ cmd.createArgument().setValue(serviceName);
+ }
+
+ if (portName != null && portName.length() > 0) {
+ cmd.createArgument().setValue("-portname");
+ cmd.createArgument().setValue(portName);
+ }
+ }
+
+
+ // r option
+ if (null != getResourcedestdir() && !getResourcedestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-r");
+ cmd.createArgument().setFile(getResourcedestdir());
+ }
+
+ // optimize option
+ if (getOptimize()) {
+ cmd.createArgument().setValue("-O");
+ }
+
+ // s option
+ if (null != getSourcedestdir() && !getSourcedestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-s");
+ cmd.createArgument().setFile(getSourcedestdir());
+ }
+
+ // verbose option
+ if (getVerbose()) {
+ cmd.createArgument().setValue("-verbose");
+ }
+
+
+ if (getSei() != null) {
+ cmd.createArgument().setValue(getSei());
+ }
+
+ }
+
+
+ /** Called by the project to let the task do it's work **/
+ public void execute() throws BuildException {
+ /* Create an instance of the rmic, redirecting output to
+ * the project log
+ */
+ LogOutputStream logstr = null;
+ boolean ok = false;
+ try {
+ if(fork){
+ setupWscompileForkCommand();
+ } else {
+ if (cmd.getVmCommand().size() > 1) {
+ log("JVM args ignored when same JVM is used.",Project.MSG_WARN);
+ }
+ setupWscompileCommand();
+ }
+ if (fork) {
+ if (verbose) { // Fix for CR 6444561
+ log("command line: "+"wsgen "+cmd.toString());
+ }
+ int status = run(cmd.getCommandline());
+ ok = (status == 0) ? true : false;
+ } else {
+ if (verbose) { // Fix for CR 6444561
+ log("command line: "+"wsgen "+cmd.getJavaCommand().toString());
+ }
+ logstr = new LogOutputStream(this, Project.MSG_WARN);
+
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
+ try {
+ CompileTool compTool = new CompileTool(logstr, "wsgen");
+ ok = compTool.run(cmd.getJavaCommand().getArguments());
+ } finally {
+ Thread.currentThread().setContextClassLoader(old);
+ }
+ }
+ if (!ok) {
+ if (!verbose) {
+ log("Command invoked: "+"wsgen "+cmd.toString());
+ }
+ throw new BuildException("wsgen failed", location);
+ }
+ } catch (Exception ex) {
+ if (ex instanceof BuildException) {
+ throw (BuildException)ex;
+ } else {
+ throw new BuildException("Error starting wsgen: ", ex,
+ getLocation());
+ }
+ } finally {
+ try {
+ if (logstr != null) {
+ logstr.close();
+ }
+ } catch (IOException e) {
+ throw new BuildException(e);
+ }
+ }
+ }
+
+ /**
+ * Executes the given classname with the given arguments in a separate VM.
+ */
+ private int run(String[] command) throws BuildException {
+ FileOutputStream fos = null;
+ Execute exe = null;
+ LogStreamHandler logstr = new LogStreamHandler(this,
+ Project.MSG_INFO, Project.MSG_WARN);
+ exe = new Execute(logstr);
+ exe.setAntRun(project);
+ exe.setCommandline(command);
+ try {
+ int rc = exe.execute();
+ if (exe.killedProcess()) {
+ log("Timeout: killed the sub-process", Project.MSG_WARN);
+ }
+ return rc;
+ } catch (IOException e) {
+ throw new BuildException(e, location);
+ }
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsGen.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsImport.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsImport.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsImport.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,475 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.ant;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.DirectoryScanner;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.taskdefs.Execute;
+import org.apache.tools.ant.taskdefs.LogOutputStream;
+import org.apache.tools.ant.taskdefs.LogStreamHandler;
+import org.apache.tools.ant.taskdefs.MatchingTask;
+import org.apache.tools.ant.types.Commandline;
+import org.apache.tools.ant.types.CommandlineJava;
+import org.apache.tools.ant.types.FileSet;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.apache.tools.ant.types.XMLCatalog;
+
+import org.apache.tools.ant.AntClassLoader;
+import org.jboss.com.sun.tools.ws.wscompile.CompileTool;
+import org.xml.sax.EntityResolver;
+
+/**
+ * wscompile task for use with the JAXWS project.
+ *
+ */
+public class WsImport extends MatchingTask {
+
+ private CommandlineJava cmd = new CommandlineJava();
+ /************************* -d option *************************/
+ private File destDir = null;
+
+ /** Gets the base directory to output generated class. **/
+ public File getDestdir() {
+ return this.destDir;
+ }
+
+ /** Sets the base directory to output generated class. **/
+ public void setDestdir(File base) {
+ this.destDir = base;
+ }
+
+ /** wsdllocation - set @WebService.wsdlLocation and @WebServiceClient.wsdlLocation values */
+
+ private String wsdlLocation;
+
+ public String getWsdllocation() {
+ return wsdlLocation;
+ }
+
+ public void setWsdllocation(String wsdlLocation) {
+ this.wsdlLocation = wsdlLocation;
+ }
+
+ public void addConfiguredXMLCatalog(XMLCatalog entityResolver) {
+ if(this.xmlCatalog==null){
+ this.xmlCatalog = new XMLCatalog();
+ xmlCatalog.setProject(getProject());
+ }
+ this.xmlCatalog.addConfiguredXMLCatalog(entityResolver);
+ }
+
+ private XMLCatalog xmlCatalog;
+
+ private String pkg;
+ public void setPackage(String pkg){
+ this.pkg = pkg;
+ }
+
+ public String getPackage(){
+ return pkg;
+ }
+
+ /**
+ * Adds a JVM argument.
+ *
+ * @return JVM argument created
+ */
+ public Commandline.Argument createJvmarg() {
+ return cmd.createVmArgument();
+ }
+
+ /******************** -extensions option **********************/
+ protected boolean extension;
+
+ /** Gets the "extension" flag. **/
+ public boolean getExtension() {
+ return extension;
+ }
+
+ /** Sets the "extension" flag. **/
+ public void setExtension(boolean extension) {
+ this.extension = extension;
+ }
+
+ /************************* -keep option *************************/
+ private boolean keep = false;
+
+ /** Gets the "keep" flag. **/
+ public boolean getKeep() {
+ return keep;
+ }
+
+ /** Sets the "keep" flag. **/
+ public void setKeep(boolean keep) {
+ this.keep = keep;
+ }
+
+ /************************* -fork option *************************/
+ private boolean fork = false;
+
+ /** Gets the "fork" flag. **/
+ public boolean getFork() {
+ return fork;
+ }
+
+ /** Sets the "fork" flag. **/
+ public void setFork(boolean fork) {
+ this.fork = fork;
+ }
+
+ /************************* -O option *************************/
+ private boolean optimize = false;
+
+ /** Gets the optimize flag. **/
+ public boolean getOptimize() {
+ return optimize;
+ }
+
+ /** Sets the optimize flag. **/
+ public void setOptimize(boolean optimize) {
+ this.optimize = optimize;
+ }
+
+ /************************* -s option *************************/
+ private File sourcedestdir;
+
+ /** Sets the directory to place generated source java files. **/
+ public void setSourcedestdir(File sourceBase) {
+ keep = true;
+ this.sourcedestdir = sourceBase;
+ }
+
+ /** Gets the directory to place generated source java files. **/
+ public File getSourcedestdir() {
+ return sourcedestdir;
+ }
+
+ /************************* -verbose option *************************/
+ protected boolean verbose = false;
+
+ /** Gets the "verbose" flag. **/
+ public boolean getVerbose() {
+ return verbose;
+ }
+
+ /** Sets the "verbose" flag. **/
+ public void setVerbose(boolean verbose) {
+ this.verbose = verbose;
+ }
+
+ /************************* -g option *************************/
+ private boolean debug = false;
+
+ /** Gets the debug flag. **/
+ public boolean getDebug() {
+ return debug;
+ }
+
+ /** Sets the debug flag. **/
+ public void setDebug(boolean debug) {
+ this.debug = debug;
+ }
+
+ /*********************** include ant runtime **********************/
+ /** not sure if these methods are needed */
+ private boolean includeAntRuntime = false;
+
+ /**
+ * Include ant's own classpath in this task's classpath?
+ */
+ public void setIncludeantruntime(boolean include) {
+ includeAntRuntime = include;
+ }
+
+ /**
+ * Gets whether or not the ant classpath is to be included in the
+ * task's classpath.
+ */
+ public boolean getIncludeantruntime() {
+ return includeAntRuntime;
+ }
+
+ /*********************** include java runtime **********************/
+ /** not sure if these methods are needed */
+ private boolean includeJavaRuntime = false;
+
+ /**
+ * Sets whether or not to include the java runtime libraries to this
+ * task's classpath.
+ */
+ public void setIncludejavaruntime(boolean include) {
+ includeJavaRuntime = include;
+ }
+
+ /**
+ * Gets whether or not the java runtime should be included in this
+ * task's classpath.
+ */
+ public boolean getIncludejavaruntime() {
+ return includeJavaRuntime;
+ }
+
+ private String binding;
+ /**
+ * @return Returns the binding.
+ */
+ public String getBinding() {
+ return binding;
+ }
+ /**
+ * @param binding The binding to set.
+ */
+ public void setBinding(String binding) {
+ this.binding = binding;
+ }
+
+ /**
+ * Adds a new catalog file.
+ */
+ public void setCatalog( File catalog ) {
+ this.catalog = catalog;
+ }
+
+ public File getCatalog(){
+ return catalog;
+ }
+
+ private File catalog;
+
+
+ private String wsdl;
+ /**
+ * @return Returns the wsdl.
+ */
+ public String getWsdl() {
+ return wsdl;
+ }
+ /**
+ * @param wsdl The wsdl to set.
+ */
+ public void setWsdl(String wsdl) {
+ this.wsdl = wsdl;
+ }
+
+ public void addConfiguredBinding( FileSet fs ) {
+ DirectoryScanner ds = fs.getDirectoryScanner(project);
+ String[] includedFiles = ds.getIncludedFiles();
+ File baseDir = ds.getBasedir();
+ for (int i = 0; i < includedFiles.length; ++i) {
+ bindingFiles.add(new File(baseDir, includedFiles[i]));
+ }
+ }
+
+ private void setupWsimportForkCommand() {
+ ClassLoader loader = this.getClass().getClassLoader();
+
+ Path classpath = new Path(project);
+ if (loader instanceof AntClassLoader) {
+ classpath = new Path(project, ((AntClassLoader)loader).getClasspath());
+ }
+ cmd.createClasspath(getProject()).append(classpath);
+ cmd.setClassname("org.jboss.com.sun.tools.ws.WsImport");
+ //setupWsimportArgs();
+ //cmd.createArgument(true).setLine(forkCmd.toString());
+ }
+
+ private void setupWsimportArgs() {
+ // d option
+ if (null != getDestdir() && !getDestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-d");
+ cmd.createArgument().setFile(getDestdir());
+ }
+
+ // extension flag
+ if (getExtension()) {
+ cmd.createArgument().setValue("-extension");
+ }
+
+ // g option
+ if (getDebug()) {
+ cmd.createArgument().setValue("-g");
+ }
+
+ // keep option
+ if (getKeep()) {
+ cmd.createArgument().setValue("-keep");
+ }
+
+ // optimize option
+ if (getOptimize()) {
+ cmd.createArgument().setValue("-O");
+ }
+
+ // s option
+ if (null != getSourcedestdir() && !getSourcedestdir().getName().equals("")) {
+ cmd.createArgument().setValue("-s");
+ cmd.createArgument().setFile(getSourcedestdir());
+ }
+
+ //catalog
+ if((getCatalog() != null) && (getCatalog().getName().length() > 0)){
+ cmd.createArgument().setValue("-catalog");
+ cmd.createArgument().setFile(getCatalog());
+ }
+
+ // verbose option
+ if (getVerbose()) {
+ cmd.createArgument().setValue("-verbose");
+ }
+
+ //wsdl
+ if(getWsdl() != null){
+ cmd.createArgument().setValue(getWsdl());
+ }
+
+ //package
+ if((getPackage() != null) && (getPackage().length() > 0)){
+ cmd.createArgument().setValue("-p");
+ cmd.createArgument().setValue(getPackage());
+ }
+
+ if(getBinding() != null){
+ cmd.createArgument().setValue("-b");
+ cmd.createArgument().setFile(new File (getBinding()));
+ }
+
+ if((wsdlLocation != null) && (wsdlLocation.length() != 0)){
+ cmd.createArgument().setValue("-wsdllocation");
+ cmd.createArgument().setValue(wsdlLocation);
+ }
+
+ if(!bindingFiles.isEmpty()){
+ for(File binding : bindingFiles){
+ cmd.createArgument().setValue("-b");
+ cmd.createArgument().setFile(binding);
+ }
+ }
+ }
+
+
+ /** Called by the project to let the task do it's work **/
+ public void execute() throws BuildException {
+ /* Create an instance of the rmic, redirecting output to
+ * the project log
+ */
+ LogOutputStream logstr = null;
+ boolean ok = false;
+ try {
+ if(fork){
+ setupWsimportForkCommand();
+ } else {
+ if (cmd.getVmCommand().size() > 1) {
+ log("JVM args ignored when same JVM is used.",Project.MSG_WARN);
+ }
+ }
+ setupWsimportArgs();
+ if (fork) {
+ if (verbose) {
+ log("command line: "+"wsimport "+cmd.toString());
+ }
+ int status = run(cmd.getCommandline());
+ ok = (status == 0) ? true : false;
+ } else {
+ if (verbose) {
+ log("command line: "+"wsimport "+cmd.getJavaCommand().toString());
+ }
+ logstr = new LogOutputStream(this, Project.MSG_WARN);
+
+ ClassLoader old = Thread.currentThread().getContextClassLoader();
+ ClassLoader loader = this.getClass().getClassLoader();
+ Thread.currentThread().setContextClassLoader(loader);
+ String sysPath = System.getProperty("java.class.path");
+ try {
+ CompileTool compTool = new CompileTool(logstr, "wsimport");
+ if(xmlCatalog != null){
+ compTool.setEntityResolver(xmlCatalog);
+ }
+ if (loader instanceof AntClassLoader) {
+ System.setProperty("java.class.path", ((AntClassLoader)loader).getClasspath());
+ }
+ ok = compTool.run(cmd.getJavaCommand().getArguments());
+ } finally {
+ if (sysPath != null) {
+ System.setProperty("java.class.path", sysPath);
+ }
+ Thread.currentThread().setContextClassLoader(old);
+ }
+ }
+ if (!ok) {
+ if (!verbose) {
+ log("Command invoked: "+"wsimport "+cmd.toString());
+ }
+ throw new BuildException("wsimport failed", location);
+ }
+ } catch (Exception ex) {
+ if (ex instanceof BuildException) {
+ throw (BuildException)ex;
+ } else {
+ throw new BuildException("Error starting wsimport: ", ex,
+ getLocation());
+ }
+ } finally {
+ try {
+ if (logstr != null) {
+ logstr.close();
+ }
+ } catch (IOException e) {
+ throw new BuildException(e);
+ }
+ }
+ }
+
+ /**
+ * Executes the given classname with the given arguments in a separate VM.
+ */
+ private int run(String[] command) throws BuildException {
+ FileOutputStream fos = null;
+ Execute exe = null;
+ LogStreamHandler logstr = new LogStreamHandler(this,
+ Project.MSG_INFO, Project.MSG_WARN);
+ exe = new Execute(logstr);
+ exe.setAntRun(project);
+ exe.setCommandline(command);
+ try {
+ int rc = exe.execute();
+ if (exe.killedProcess()) {
+ log("Timeout: killed the sub-process", Project.MSG_WARN);
+ }
+ return rc;
+ } catch (IOException e) {
+ throw new BuildException(e, location);
+ }
+ }
+
+ private Set<File> bindingFiles = new HashSet<File>();
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/ant/WsImport.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/package-info.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/package-info.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/package-info.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,135 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+/**
+ * <h1>JAX-WS 2.0 Tools</h1>
+ * This document describes the tools included with JAX-WS 2.0.
+ *
+ * {@DotDiagram
+ digraph G {
+ // external tools
+ APT;
+
+ // ANT tasks
+ node [style=filled,color=lightyellow];
+ "WsGen ANT Task"; "WsImport ANT Task"; "Apt ANT Task";
+
+ // commandline
+ node [style=filled,color=lightpink];
+ wsgen; wsimport;
+
+ // libraries
+ node [style=filled,color=lightblue];
+ CompileTool; "WSAP"; WebServiceAP; Processor; Modeler; ProcessorActions;
+
+ // aps
+# node [style=filled,color=lightpink];
+# "JAX-WS"; tools; runtime; SPI; "Annotation Processor";
+
+ "Apt ANT Task" -> APT;
+ "WsGen ANT Task" -> wsgen -> CompileTool;
+ "WsImport ANT Task" -> wsimport -> CompileTool;
+
+ CompileTool -> APT -> WSAP -> WebServiceAP;
+ CompileTool -> Processor;
+ CompileTool -> Modeler;
+ CompileTool -> ProcessorActions;
+ CompileTool -> WebServiceAP;
+
+ Modeler -> WSDLModeler;
+ }
+ * }
+ * <div align=right>
+ * <b>Legend:</b> blue: implementation classes, pink: command-line toosl, white: external tool, yellow: ANT tasks
+ * </div>
+ *
+ * <h2>ANT Tasks</h2>
+ <d1>
+ * <dt>{@link org.jboss.com.sun.tools.ws.ant.Apt Apt}
+ * <dd>An ANT task to invoke <a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>.
+
+ * <dt>{@link org.jboss.com.sun.tools.ws.ant.WsGen WsGen}
+ * <dd>
+ * An ANT task to invoke {@link org.jboss.com.sun.tools.ws.WsGen WsGen}
+
+ * <dt>{@link org.jboss.com.sun.tools.ws.ant.WsImport WsImport}
+ * <dd>
+ * An ANT task to invoke {@link org.jboss.com.sun.tools.ws.WsImport WsImport}
+ *
+ * </d1>
+ * <h2>Command-line Tools</h2>
+ <d1>
+ * <dt><a href="http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/apt.html">APT</a>
+ <dd>A Java SE tool and framework for processing annotations. APT will invoke a JAX-WS AnnotationProcossor for
+ * processing Java source files with javax.jws.* annotations and making them web services.
+ * APT will compile the Java source files and generate any additional classes needed to make an javax.jws.WebService
+ * annotated class a Web service.
+ *
+ * <dt>{@link org.jboss.com.sun.tools.ws.WsGen WsGen}
+ * <dd>Tool to process a compiled javax.jws.WebService annotated class and to generate the necessary classes to make
+ * it a Web service.
+
+ * <dt>{@link org.jboss.com.sun.tools.ws.ant.WsImport WsImport}
+ * <dd>
+ * Tool to import a WSDL and to generate an SEI (a javax.jws.WebService) interface that can be either implemented
+ * on the server to build a web service, or can be used on the client to invoke the web service.
+ * </d1>
+ * <h2>Implementation Classes</h2>
+ * <d1>
+ <dt>{@link org.jboss.com.sun.tools.ws.wscompile.CompileTool CompileTool}
+ * <dd> This is the main implementation class for both WsGen and WsImport.
+ *
+ *
+ * <dt>{@link org.jboss.com.sun.tools.ws.processor.Processor Processor}
+ * <dd>This abstract class is used to process a particular {@link org.jboss.com.sun.tools.ws.processor.config.Configuration
+ * Configuration} to build a {@link org.jboss.com.sun.tools.ws.processor.model Model} and to run
+ * {@link org.jboss.com.sun.tools.ws.processor.ProcessorAction ProcessorActions} on that model.
+
+ * <dt>{@link org.jboss.com.sun.tools.ws.processor.model.Model Model}
+ * <dd>The model is used to represent the entire Web Service. The JAX-WS ProcessorActions can process
+ * this Model to generate Java artifacts such as the service interface.
+ *
+ <dt>{@link org.jboss.com.sun.tools.ws.processor.ProcessorAction ProcessorActions}
+ * <dd>A ProcessorAction is used to perform some operation on a Model object such as
+ * generating a Java source file.
+ *
+ * <dt>{@link org.jboss.com.sun.tools.ws.processor.modeler.Modeler Modeler}
+ * <dd>A Modeler is used to create a Model of a Web Service from a particular Web
+ * Web Service description such as a WSDL
+ * file.
+ *
+ * <dt>{@link org.jboss.com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler WSDLModeler}
+ * <dd>The WSDLModeler processes a WSDL to create a Model.
+ *
+ * <dt>{@link org.jboss.com.sun.tools.ws.processor.modeler.annotation.WebServiceAP WebServiceAP}
+ * <dd>WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and
+ * javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
+ * idirectly via the {@link org.jboss.com.sun.istack.ws.WSAP WSAP} when invoked by APT.
+ *
+ * <dt>{@link org.jboss.com.sun.istack.ws.WSAP WSAP}
+ * <dd>This is the entry point for the WebServiceAP when APT is invoked on a SEI
+ * annotated with the javax.jws.WebService annotation.
+ * </d1>
+ *
+ * @ArchitectureDocument
+ **/
+package org.jboss.com.sun.tools.ws;
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/package-info.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/Processor.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/Processor.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/Processor.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,116 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor;
+
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.config.ModelInfo;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.xml.ws.util.exception.JAXWSExceptionBase;
+
+/**
+ * This abstract class contains methods for getting a Modeler and creating a model
+ * from that Modeler given a particular configuration. ProcessorActions can also
+ * be registered and run with instances of this class.
+ *
+ * @author WS Development Team
+ *
+ */
+public class Processor {
+
+ public Processor(Configuration configuration, Properties options, Model model) {
+ this(configuration,options);
+ _model = model;
+ }
+
+ public Processor(Configuration configuration, Properties options) {
+ _configuration = configuration;
+ _options = options;
+
+ // find the value of the "print stack traces" property
+ _printStackTrace = Boolean.valueOf(_options.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
+ _env = _configuration.getEnvironment();
+ }
+
+ public void add(ProcessorAction action) {
+ _actions.add(action);
+ }
+
+ public Model getModel() {
+ return _model;
+ }
+
+ public void run() {
+ runModeler();
+ if (_model != null) {
+ runActions();
+ }
+ }
+
+ public void runModeler() {
+ try {
+ ModelInfo modelInfo = _configuration.getModelInfo();
+ if (modelInfo == null) {
+ throw new ProcessorException("processor.missing.model");
+ }
+
+ _model = modelInfo.buildModel(_options);
+
+ } catch (JAXWSExceptionBase e) {
+ if (_printStackTrace) {
+ _env.printStackTrace(e);
+ }
+ _env.error(e);
+ }
+ }
+
+ public void runActions() {
+ try {
+ if (_model == null) {
+ // avoid reporting yet another error here
+ return;
+ }
+
+ for (ProcessorAction action : _actions) {
+ action.perform(_model, _configuration, _options);
+ }
+ } catch (JAXWSExceptionBase e) {
+ if (_printStackTrace || _env.verbose()) {
+ _env.printStackTrace(e);
+ }
+ _env.error(e);
+ }
+ }
+
+ private final Properties _options;
+ private final Configuration _configuration;
+ private final List<ProcessorAction> _actions = new ArrayList<ProcessorAction>();
+ private Model _model;
+ private final boolean _printStackTrace;
+ private final ProcessorEnvironment _env;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/Processor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorAction.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorAction.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorAction.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,40 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor;
+
+import java.util.Properties;
+
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+
+
+/**
+ * A ProcessorAction is used to perform some operation on a
+ * {@link org.jboss.com.sun.tools.ws.processor.model.Model Model} such as
+ * generating a Java source file.
+ *
+ * @author WS Development Team
+ */
+public interface ProcessorAction {
+ public void perform(Model model, Configuration config, Properties options);
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorAction.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorActionVersion.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorActionVersion.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorActionVersion.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,41 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor;
+
+/**
+ * @author WS Development Team
+ *
+ * Typesafe enum class to hold the ProcessorActionVersion
+ */
+public enum ProcessorActionVersion {
+ PRE_20("1.1.2"), VERSION_20("2.0");
+
+ ProcessorActionVersion(String version) {
+ this.version = version;
+ }
+
+ public String value() {
+ return version;
+ }
+
+ private final String version;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorActionVersion.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorConstants.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorConstants.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorConstants.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,33 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor;
+
+/**
+ * Constants used by Model, Modelers, Config ProcessorActions
+ *
+ * @author WS Development Team
+ */
+public class ProcessorConstants {
+ public final static String SOAP_VERSION_1_1 = "SOAP 1.1";
+ public final static String SOAP_VERSION_1_2 = "SOAP 1.2";
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorException.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorException.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorException.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,49 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor;
+
+import org.jboss.com.sun.xml.ws.util.exception.JAXWSExceptionBase;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+/**
+ * ProcessorException represents an exception that occurred while processing
+ * a web service.
+ *
+ * @see JAXWSExceptionBase
+ *
+ * @author WS Development Team
+ */
+public class ProcessorException extends JAXWSExceptionBase {
+
+ public ProcessorException(String key, Object... args) {
+ super(key, args);
+ }
+
+ public ProcessorException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public String getResourceBundleName() {
+ return "org.jboss.com.sun.tools.ws.resources.processor";
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorNotificationListener.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorNotificationListener.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorNotificationListener.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,37 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor;
+
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+/**
+ * A ProcessorNotificationListener is registered with a Processor and receives
+ * notifications of errors, warnings and informational messages.
+ *
+ * @author WS Development Team
+ */
+public interface ProcessorNotificationListener {
+ public void onError(Localizable msg);
+ public void onWarning(Localizable msg);
+ public void onInfo(Localizable msg);
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorNotificationListener.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorOptions.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorOptions.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorOptions.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,54 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor;
+
+/**
+ * Property names used by ProcessorActions
+ *
+ * @author WS Development Team
+ */
+public class ProcessorOptions {
+
+ public final static String SOURCE_DIRECTORY_PROPERTY = "sourceDirectory";
+ public final static String DESTINATION_DIRECTORY_PROPERTY =
+ "destinationDirectory";
+ public final static String NONCLASS_DESTINATION_DIRECTORY_PROPERTY =
+ "nonclassDestinationDirectory";
+ public final static String VALIDATE_WSDL_PROPERTY = "validationWSDL";
+ public final static String EXPLICIT_SERVICE_CONTEXT_PROPERTY =
+ "explicitServiceContext";
+ public final static String PRINT_STACK_TRACE_PROPERTY = "printStackTrace";
+ public final static String DONOT_OVERWRITE_CLASSES = "doNotOverWrite";
+ public final static String NO_DATA_BINDING_PROPERTY = "noDataBinding";
+ public final static String USE_WSI_BASIC_PROFILE = "useWSIBasicProfile";
+ public final static String STRICT_COMPLIANCE = "strictCompliance";
+ public final static String JAXWS_SOURCE_VERSION = "sourceVersion";
+ public final static String UNWRAP_DOC_LITERAL_WRAPPERS =
+ "unwrapDocLitWrappers";
+ public final static String BINDING_FILES = "bindingFiles";
+ public final static String EXTENSION = "extension";
+ public final static String PROTOCOL = "protocol";
+ public final static String TRANSPORT = "transport";
+ public final static String WSDL_LOCATION = "wsdllocation";
+ public final static String DEFAULT_PACKAGE = "defaultpackage";
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/ProcessorOptions.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ClassModelInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ClassModelInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ClassModelInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,59 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.modeler.Modeler;
+import org.jboss.com.sun.xml.ws.util.VersionUtil;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ClassModelInfo extends ModelInfo {
+
+ public ClassModelInfo(String className) {
+ this.className = className;
+ }
+
+
+ public Modeler getModeler(Properties properties) {
+ return null;
+ }
+
+ public void setClassName(String className) {
+ this.className = className;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ private String className;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ClassModelInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/Configuration.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/Configuration.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/Configuration.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,52 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Configuration {
+
+ public Configuration(ProcessorEnvironment env) {
+ _env = (ProcessorEnvironment)env;
+ }
+
+ public ModelInfo getModelInfo() {
+ return _modelInfo;
+ }
+
+ public void setModelInfo(ModelInfo i) {
+ _modelInfo = (ModelInfo)i;
+ _modelInfo.setParent(this);
+ }
+
+ public ProcessorEnvironment getEnvironment() {
+ return _env;
+ }
+
+ private ProcessorEnvironment _env;
+ private ModelInfo _modelInfo;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/Configuration.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ConfigurationException.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ConfigurationException.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ConfigurationException.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,47 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorException;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ConfigurationException extends ProcessorException {
+
+ public ConfigurationException(String key, Object... args) {
+ super(key, args);
+ }
+
+ public ConfigurationException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public String getResourceBundleName() {
+ return "org.jboss.com.sun.tools.ws.resources.configuration";
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ConfigurationException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerChainInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerChainInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerChainInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,79 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class HandlerChainInfo {
+
+ public HandlerChainInfo() {
+ handlers = new ArrayList();
+ roles = new HashSet();
+ }
+
+ public void add(HandlerInfo i) {
+ handlers.add(i);
+ }
+
+ public Iterator getHandlers() {
+ return handlers.iterator();
+ }
+
+ public int getHandlersCount() {
+ return handlers.size();
+ }
+
+ /* serialization */
+ public List getHandlersList() {
+ return handlers;
+ }
+
+ /* serialization */
+ public void setHandlersList(List l) {
+ handlers = l;
+ }
+
+ public void addRole(String s) {
+ roles.add(s);
+ }
+
+ public Set getRoles() {
+ return roles;
+ }
+
+ /* serialization */
+ public void setRoles(Set s) {
+ roles = s;
+ }
+
+ private List handlers;
+ private Set roles;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerChainInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,75 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import javax.xml.namespace.QName;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class HandlerInfo {
+
+ public HandlerInfo() {
+ properties = new HashMap();
+ headerNames = new HashSet();
+ }
+
+ public String getHandlerClassName() {
+ return handlerClassName;
+ }
+
+ public void setHandlerClassName(String s) {
+ handlerClassName = s;
+ }
+
+ public Map getProperties() {
+ return properties;
+ }
+
+ /* serialization */
+ public void setProperties(Map m) {
+ properties = m;
+ }
+
+ public void addHeaderName(QName name) {
+ headerNames.add(name);
+ }
+
+ public Set getHeaderNames() {
+ return headerNames;
+ }
+
+ /* serialization */
+ public void setHeaderNames(Set s) {
+ headerNames = s;
+ }
+
+ private String handlerClassName;
+ private Map properties;
+ private Set headerNames;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/HandlerInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ModelInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ModelInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ModelInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,116 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+import java.util.Properties;
+
+
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.modeler.Modeler;
+import org.jboss.com.sun.xml.ws.util.xml.XmlUtil;
+import org.xml.sax.EntityResolver;
+
+/**
+ * This class contiains information used by {@link org.jboss.com.sun.tools.ws.processor.modeler.Modeler
+ * Modelers} to build {@link org.jboss.com.sun.tools.ws.processor.model.Model Models}.
+ *
+ * @author WS Development Team
+ */
+public abstract class ModelInfo {
+
+ protected ModelInfo() {}
+
+ public Configuration getParent() {
+ return _parent;
+ }
+
+ public void setParent(Configuration c) {
+ _parent = c;
+ }
+
+ public String getName() {
+ return _name;
+ }
+
+ public void setName(String s) {
+ _name = s;
+ }
+
+ public Configuration getConfiguration() {
+ return _parent;
+ }
+
+ public HandlerChainInfo getClientHandlerChainInfo() {
+ return _clientHandlerChainInfo;
+ }
+
+ public void setClientHandlerChainInfo(HandlerChainInfo i) {
+ _clientHandlerChainInfo = i;
+ }
+
+ public HandlerChainInfo getServerHandlerChainInfo() {
+ return _serverHandlerChainInfo;
+ }
+
+ public void setServerHandlerChainInfo(HandlerChainInfo i) {
+ _serverHandlerChainInfo = i;
+ }
+
+ public String getJavaPackageName() {
+ return _javaPackageName;
+ }
+
+ public void setJavaPackageName(String s) {
+ _javaPackageName = s;
+ }
+
+ public Model buildModel(Properties options){
+ return getModeler(options).buildModel();
+ }
+
+ public EntityResolver getEntityResolver() {
+ return entityResolver;
+ }
+
+ public void setEntityResolver(EntityResolver entityResolver) {
+ this.entityResolver = entityResolver;
+ }
+
+ public String getDefaultJavaPackage() {
+ return _defaultJavaPackage;
+ }
+
+ public void setDefaultJavaPackage(String _defaultJavaPackage) {
+ this._defaultJavaPackage = _defaultJavaPackage;
+ }
+
+ protected abstract Modeler getModeler(Properties options);
+
+ private Configuration _parent;
+ private String _name;
+ private String _javaPackageName;
+ private String _defaultJavaPackage;
+ private HandlerChainInfo _clientHandlerChainInfo;
+ private HandlerChainInfo _serverHandlerChainInfo;
+ private EntityResolver entityResolver;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/ModelInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/WSDLModelInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/WSDLModelInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/WSDLModelInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,89 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config;
+
+
+import java.util.*;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.Modeler;
+import org.jboss.com.sun.tools.ws.util.JAXWSClassFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class WSDLModelInfo extends ModelInfo {
+
+ public WSDLModelInfo() {}
+
+ protected Modeler getModeler(Properties options) {
+ return JAXWSClassFactory.newInstance().createWSDLModeler(this, options);
+ }
+
+ public String getLocation() {
+ return _location;
+ }
+
+ public void setLocation(String s) {
+ _location = s;
+ }
+
+ public Map<String, Document> getJAXWSBindings(){
+ return _jaxwsBindings;
+ }
+
+ public void putJAXWSBindings(String systemId, Document binding){
+ _jaxwsBindings.put(systemId, binding);
+ }
+
+ public Set<InputSource> getJAXBBindings(){
+ return _jaxbBindings;
+ }
+
+ public void addJAXBBIndings(InputSource jaxbBinding){
+ _jaxbBindings.add(jaxbBinding);
+ }
+
+ public void setHandlerConfig(Element handlerConfig){
+ this.handlerConfig = handlerConfig;
+ }
+
+ public Element getHandlerConfig(){
+ return handlerConfig;
+ }
+
+ private Element handlerConfig;
+
+ private String _location;
+
+ //external jaxws:bindings elements
+ private Map<String, Document> _jaxwsBindings = new HashMap<String, Document>();
+
+ //we need an array of jaxb:binding elements, they are children of jaxws:bindings
+ //and could come from an external customization file or wsdl.
+ private Set<InputSource> _jaxbBindings = new HashSet<InputSource>();
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/WSDLModelInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ClassModelParser.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ClassModelParser.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ClassModelParser.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,56 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config.parser;
+
+
+import java.io.File;
+import java.util.List;
+import java.util.Properties;
+
+import org.jboss.com.sun.tools.ws.processor.config.ClassModelInfo;
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ClassModelParser extends InputParser {
+
+ public ClassModelParser(ProcessorEnvironment env, Properties options) {
+ super(env, options);
+ }
+
+ public Configuration parse(List<String> inputClasses) {
+ return parse(new File(inputClasses.get(0)));
+ }
+
+ public Configuration parse(File file) {
+ Configuration config = new Configuration(getEnv());
+
+ config.setModelInfo(new ClassModelInfo(file.getName()));
+ return config;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ClassModelParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/CustomizationParser.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/CustomizationParser.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/CustomizationParser.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,142 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.config.parser;
+
+import java.net.URL;
+import java.util.*;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.wsdl.document.jaxws.JAXWSBindingsConstants;
+import org.jboss.com.sun.xml.ws.streaming.XMLStreamReaderFactory;
+import org.jboss.com.sun.xml.ws.streaming.XMLStreamReaderUtil;
+import org.jboss.com.sun.xml.ws.util.JAXWSUtils;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.EntityResolver;
+
+
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @author Vivek Pandey
+ *
+ */
+public class CustomizationParser extends InputParser {
+
+ /**
+ * @param entityResolver
+ * @param env
+ * @param options
+ */
+ public CustomizationParser(EntityResolver entityResolver, ProcessorEnvironment env, Properties options) {
+ super(env, options);
+ this.entityResolver = entityResolver;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.com.sun.xml.ws.processor.config.parser.InputParser#parse(java.io.File[], java.lang.String)
+ */
+ protected Configuration parse(List<String> inputFiles) throws Exception{
+ //File wsdlFile = inputFiles[0];
+ Configuration configuration = new Configuration(getEnv());
+ wsdlModelInfo = new WSDLModelInfo();
+ wsdlModelInfo.setLocation(inputFiles.get(0));
+ if(_options.get(ProcessorOptions.WSDL_LOCATION) == null)
+ _options.setProperty(ProcessorOptions.WSDL_LOCATION, inputFiles.get(0));
+
+ //modelInfoParser = (JAXWSBindingInfoParser)getModelInfoParsers().get(JAXWSBindingsConstants.JAXWS_BINDINGS);
+ modelInfoParser = new JAXWSBindingInfoParser(getEnv());
+
+ //get the jaxws bindingd file and add it to the modelInfo
+ Set<String> bindingFiles = (Set<String>)_options.get(ProcessorOptions.BINDING_FILES);
+ for(String bindingFile : bindingFiles){
+ addBinding(bindingFile);
+ }
+
+
+ for(InputSource jaxwsBinding : jaxwsBindings){
+ Document doc = modelInfoParser.parse(jaxwsBinding);
+ if(doc != null){
+ wsdlModelInfo.putJAXWSBindings(jaxwsBinding.getSystemId(), doc);
+ }
+ }
+
+ //copy jaxb binding sources in modelInfo
+ for(InputSource jaxbBinding : jaxbBindings){
+ wsdlModelInfo.addJAXBBIndings(jaxbBinding);
+ }
+
+ addHandlerChainInfo();
+ configuration.setModelInfo(wsdlModelInfo);
+ return configuration;
+ }
+
+ private void addBinding(String bindingLocation) throws Exception{
+ JAXWSUtils.checkAbsoluteness(bindingLocation);
+ InputSource is = null;
+ if(entityResolver != null){
+ is = entityResolver.resolveEntity(null, bindingLocation);
+ }
+ if(is == null)
+ is = new InputSource(bindingLocation);
+
+ XMLStreamReader reader =
+ XMLStreamReaderFactory.createFreshXMLStreamReader(is, true);
+ XMLStreamReaderUtil.nextElementContent(reader);
+ if(reader.getName().equals(JAXWSBindingsConstants.JAXWS_BINDINGS)){
+ jaxwsBindings.add(is);
+ }else if(reader.getName().equals(JAXWSBindingsConstants.JAXB_BINDINGS)){
+ jaxbBindings.add(is);
+ }else{
+ warn("configuration.notBindingFile");
+ }
+ reader.close();
+ }
+
+ private void addHandlerChainInfo() throws Exception{
+ //setup handler chain info
+ for(Map.Entry<String, Document> entry:wsdlModelInfo.getJAXWSBindings().entrySet()){
+ Element e = entry.getValue().getDocumentElement();
+ NodeList nl = e.getElementsByTagNameNS(
+ "http://java.sun.com/xml/ns/javaee", "handler-chains");
+ if(nl.getLength()== 0)
+ continue;
+ //take the first one, anyway its 1 handler-config per customization
+ Element hc = (Element)nl.item(0);
+ wsdlModelInfo.setHandlerConfig(hc);
+ return;
+ }
+ }
+
+ private WSDLModelInfo wsdlModelInfo;
+ private JAXWSBindingInfoParser modelInfoParser;
+ private Set<InputSource> jaxwsBindings = new HashSet<InputSource>();
+ private Set<InputSource> jaxbBindings = new HashSet<InputSource>();
+ private EntityResolver entityResolver;
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/CustomizationParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/InputParser.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/InputParser.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/InputParser.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,119 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.config.parser;
+
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.xml.ws.util.localization.LocalizableMessageFactory;
+import org.xml.sax.InputSource;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ *
+ */
+public abstract class InputParser{
+ protected LocalizableMessageFactory _messageFactory =
+ new LocalizableMessageFactory(
+ "org.jboss.com.sun.tools.ws.resources.configuration");
+
+ public InputParser(ProcessorEnvironment env, Properties options) {
+ this._env = env;
+ this._options = options;
+ _modelInfoParsers = new HashMap<QName, Object>();
+
+// /*
+// * Load modelinfo parsers from the plugins which want to extend
+// * this functionality
+// */
+// Iterator i = ToolPluginFactory.getInstance().getExtensions(
+// ToolPluginConstants.WSCOMPILE_PLUGIN,
+// ToolPluginConstants.WSCOMPILE_MODEL_INFO_EXT_POINT);
+// while(i != null && i.hasNext()) {
+// ModelInfoPlugin plugin = (ModelInfoPlugin)i.next();
+// _modelInfoParsers.put(plugin.getModelInfoName(),
+// plugin.createModelInfoParser(env));
+// }
+ }
+
+ protected Configuration parse(InputStream is) throws Exception{
+ //TODO: Not implemented exception
+ return null;
+ }
+
+ protected Configuration parse(InputSource is) throws Exception{
+ //TODO: Not implemented exception
+ return null;
+ }
+
+ protected Configuration parse(List<String> inputSources) throws Exception{
+ //TODO: Not implemented exception
+ return null;
+ }
+
+ /**
+ * @return Returns the _env.
+ */
+ public ProcessorEnvironment getEnv(){
+ return _env;
+ }
+
+ /**
+ * @param env The ProcessorEnvironment to set.
+ */
+ public void setEnv(ProcessorEnvironment env){
+ this._env = env;
+ }
+
+ protected void warn(String key) {
+ _env.warn(_messageFactory.getMessage(key));
+ }
+
+ protected void warn(String key, String arg) {
+ _env.warn(_messageFactory.getMessage(key, arg));
+ }
+
+ protected void warn(String key, Object[] args) {
+ _env.warn(_messageFactory.getMessage(key, args));
+ }
+
+ protected void info(String key) {
+ _env.info(_messageFactory.getMessage(key));
+ }
+
+ protected void info(String key, String arg) {
+ _env.info(_messageFactory.getMessage(key, arg));
+ }
+
+ protected ProcessorEnvironment _env;
+ protected Properties _options;
+ protected Map<QName, Object> _modelInfoParsers;
+}
\ No newline at end of file
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/InputParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/JAXWSBindingInfoParser.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/JAXWSBindingInfoParser.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/JAXWSBindingInfoParser.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,97 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.config.parser;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.util.xml.NullEntityResolver;
+import org.jboss.com.sun.tools.ws.wsdl.framework.ParseException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ * External jaxws:bindings parser
+ */
+public class JAXWSBindingInfoParser {
+
+ private ProcessorEnvironment env;
+
+ /**
+ * @param env
+ */
+ public JAXWSBindingInfoParser(ProcessorEnvironment env) {
+ this.env = env;
+ }
+
+ public Document parse(InputSource source) {
+ try {
+ DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+ builderFactory.setNamespaceAware(true);
+ builderFactory.setValidating(false);
+ DocumentBuilder builder = builderFactory.newDocumentBuilder();
+ builder.setErrorHandler(new ErrorHandler() {
+ public void error(SAXParseException e)
+ throws SAXParseException {
+ throw e;
+ }
+
+ public void fatalError(SAXParseException e)
+ throws SAXParseException {
+ throw e;
+ }
+
+ public void warning(SAXParseException err)
+ throws SAXParseException {
+ // do nothing
+ }
+ });
+
+ builder.setEntityResolver(new NullEntityResolver());
+ return builder.parse(source);
+ } catch (ParserConfigurationException e) {
+ throw new ParseException("parsing.parserConfigException",e);
+ } catch (FactoryConfigurationError e) {
+ throw new ParseException("parsing.factoryConfigException",e);
+ }catch(SAXException e){
+ throw new ParseException("parsing.saxException",e);
+ }catch(IOException e){
+ throw new ParseException("parsing.saxException",e);
+ }
+ }
+
+ public final Set<Element> outerBindings = new HashSet<Element>();
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/JAXWSBindingInfoParser.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ParserUtil.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ParserUtil.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ParserUtil.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,48 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.config.parser;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamReader;
+
+import org.jboss.com.sun.tools.ws.processor.config.ConfigurationException;
+import org.jboss.com.sun.xml.ws.streaming.Attributes;
+import org.jboss.com.sun.xml.ws.streaming.XMLReader;
+import org.jboss.com.sun.xml.ws.util.xml.XmlUtil;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ParserUtil {
+ public static void failWithFullName(String key, String file, XMLReader reader) {
+ throw new ConfigurationException(key, new Object[] { file, Integer.toString(
+ reader.getLineNumber()), reader.getName().toString() });
+ }
+
+ public static void failWithFullName(String key, String file, XMLStreamReader reader) {
+ throw new ConfigurationException(key, new Object[] { file, Integer.toString(
+ reader.getLocation().getLineNumber()), reader.getName().toString() });
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/ParserUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/Reader.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/Reader.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/Reader.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,107 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.config.parser;
+
+
+import java.net.URL;
+import java.util.List;
+import java.util.Properties;
+
+
+import javax.xml.stream.XMLStreamReader;
+
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.wsdl.document.WSDLConstants;
+import org.jboss.com.sun.xml.ws.streaming.XMLStreamReaderFactory;
+import org.jboss.com.sun.xml.ws.streaming.XMLStreamReaderUtil;
+import org.jboss.com.sun.xml.ws.util.JAXWSUtils;
+import org.xml.sax.EntityResolver;
+
+/**
+ * @author Vivek Pandey
+ *
+ * Main entry point from CompileTool
+ */
+public class Reader {
+
+ /**
+ *
+ */
+ public Reader(ProcessorEnvironment env, Properties options) {
+ this._env = env;
+ this._options = options;
+ }
+
+ public Configuration parse(EntityResolver entityResolver, List<String> inputSources)
+ throws Exception {
+ //reset the input type flags before parsing
+ isClassFile = false;
+
+ InputParser parser = null;
+ //now its just the first file. do we expect more than one input files?
+ validateInput(inputSources.get(0));
+
+ if(isClassFile){
+ parser = new ClassModelParser(_env, _options);
+ } else {
+ parser = new CustomizationParser(entityResolver, _env, _options);
+ }
+ return parser.parse(inputSources);
+ }
+
+ protected void validateInput(String file) throws Exception{
+ if(isClass(file)){
+ isClassFile = true;
+ return;
+ }
+
+// JAXWSUtils.checkAbsoluteness(file);
+// URL url = new URL(file);
+//
+// XMLStreamReader reader =
+// XMLStreamReaderFactory.createXMLStreamReader(url.openStream(), true);
+//
+// XMLStreamReaderUtil.nextElementContent(reader);
+// if(!reader.getName().equals(WSDLConstants.QNAME_DEFINITIONS)){
+// //we are here, means invalid element
+// ParserUtil.failWithFullName("configuration.invalidElement", file, reader);
+// }
+ }
+
+ public boolean isClass(String className) {
+ try {
+ _env.getClassLoader().loadClass(className);
+ } catch (ClassNotFoundException e) {
+ return false;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return true;
+ }
+
+ private boolean isClassFile;
+
+ protected ProcessorEnvironment _env;
+
+ protected Properties _options;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/config/parser/Reader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/CustomExceptionGenerator.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/CustomExceptionGenerator.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/CustomExceptionGenerator.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,164 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import com.sun.codemodel.*;
+
+import javax.xml.ws.WebFault;
+
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.model.Fault;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.xml.ws.encoding.soap.SOAPVersion;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class CustomExceptionGenerator extends GeneratorBase {
+ private Map<String, JClass> faults = new HashMap<String, JClass>();
+
+ public CustomExceptionGenerator() {
+ }
+
+ public GeneratorBase getGenerator(
+ Model model,
+ Configuration config,
+ Properties properties) {
+ return new CustomExceptionGenerator(model, config, properties);
+ }
+
+ public GeneratorBase getGenerator(
+ Model model,
+ Configuration config,
+ Properties properties,
+ SOAPVersion ver) {
+ return new CustomExceptionGenerator(model, config, properties);
+ }
+
+ protected CustomExceptionGenerator(
+ Model model,
+ Configuration config,
+ Properties properties) {
+ super(model, config, properties);
+ }
+
+ protected void preVisitModel(Model model) throws Exception {
+ }
+
+ protected void postVisitModel(Model model) throws Exception {
+ faults = null;
+ }
+
+ protected void preVisitFault(Fault fault) throws Exception {
+ if (isRegistered(fault))
+ return;
+ registerFault(fault);
+ }
+
+ private boolean isRegistered(Fault fault) {
+ if(faults.keySet().contains(fault.getJavaException().getName())){
+ fault.setExceptionClass(faults.get(fault.getJavaException().getName()));
+ return true;
+ }
+ return false;
+ }
+
+ private void registerFault(Fault fault) {
+ try {
+ write(fault);
+ faults.put(fault.getJavaException().getName(), fault.getExceptionClass());
+ } catch (Exception e) {
+ throw new GeneratorException("generator.nestedGeneratorError",e);
+ }
+ }
+
+ private void write(Fault fault) throws Exception{
+ String className = env.getNames().customExceptionClassName(fault);
+
+ JDefinedClass cls = cm._class(className, ClassType.CLASS);
+ JDocComment comment = cls.javadoc();
+ if(fault.getJavaDoc() != null){
+ comment.add(fault.getJavaDoc());
+ comment.add("\n\n");
+ }
+
+ for (String doc : getJAXWSClassComment()) {
+ comment.add(doc);
+ }
+
+ cls._extends(java.lang.Exception.class);
+
+ //@WebFault
+ JAnnotationUse faultAnn = cls.annotate(WebFault.class);
+ faultAnn.param("name", fault.getBlock().getName().getLocalPart());
+ faultAnn.param("targetNamespace", fault.getBlock().getName().getNamespaceURI());
+
+ JType faultBean = fault.getBlock().getType().getJavaType().getType().getType();
+
+ //faultInfo filed
+ JFieldVar fi = cls.field(JMod.PRIVATE, faultBean, "faultInfo");
+
+ //add jaxb annotations
+ fault.getBlock().getType().getJavaType().getType().annotate(fi);
+
+ fi.javadoc().add("Java type that goes as soapenv:Fault detail element.");
+ JFieldRef fr = JExpr.ref(JExpr._this(), fi);
+
+ //Constructor
+ JMethod constrc1 = cls.constructor(JMod.PUBLIC);
+ JVar var1 = constrc1.param(String.class, "message");
+ JVar var2 = constrc1.param(faultBean, "faultInfo");
+ constrc1.javadoc().addParam(var1);
+ constrc1.javadoc().addParam(var2);
+ JBlock cb1 = constrc1.body();
+ cb1.invoke("super").arg(var1);
+
+ cb1.assign(fr, var2);
+
+ //constructor with Throwable
+ JMethod constrc2 = cls.constructor(JMod.PUBLIC);
+ var1 = constrc2.param(String.class, "message");
+ var2 = constrc2.param(faultBean, "faultInfo");
+ JVar var3 = constrc2.param(Throwable.class, "cause");
+ constrc2.javadoc().addParam(var1);
+ constrc2.javadoc().addParam(var2);
+ constrc2.javadoc().addParam(var3);
+ JBlock cb2 = constrc2.body();
+ cb2.invoke("super").arg(var1).arg(var3);
+ cb2.assign(fr, var2);
+
+
+ //getFaultInfo() method
+ JMethod fim = cls.method(JMod.PUBLIC, faultBean, "getFaultInfo");
+ fim.javadoc().addReturn().add("returns fault bean: "+faultBean.fullName());
+ JBlock fib = fim.body();
+ fib._return(fi);
+ fault.setExceptionClass(cls);
+
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/CustomExceptionGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorBase.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorBase.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorBase.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,641 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.FileOutputStream;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+import com.sun.codemodel.*;
+
+import org.jboss.com.sun.tools.ws.ToolVersion;
+import org.jboss.com.sun.tools.ws.processor.ProcessorAction;
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.model.AbstractType;
+import org.jboss.com.sun.tools.ws.processor.model.Block;
+import org.jboss.com.sun.tools.ws.processor.model.Fault;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.ModelVisitor;
+import org.jboss.com.sun.tools.ws.processor.model.Operation;
+import org.jboss.com.sun.tools.ws.processor.model.Parameter;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Request;
+import org.jboss.com.sun.tools.ws.processor.model.Response;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBTypeVisitor;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.RpcLitStructure;
+import org.jboss.com.sun.tools.ws.processor.util.DirectoryUtil;
+import org.jboss.com.sun.tools.ws.processor.util.GeneratedFileInfo;
+import org.jboss.com.sun.tools.ws.processor.util.IndentingWriter;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.xml.ws.encoding.soap.SOAPVersion;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+import org.jboss.com.sun.xml.ws.util.localization.LocalizableMessageFactory;
+import org.jboss.com.sun.xml.ws.util.xml.XmlUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import javax.jws.HandlerChain;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.dom.DOMSource;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public abstract class GeneratorBase
+ implements
+ GeneratorConstants,
+ ProcessorAction,
+ ModelVisitor,
+ JAXBTypeVisitor {
+ protected File sourceDir;
+ protected File destDir;
+ protected File nonclassDestDir;
+ protected ProcessorEnvironment env;
+ protected Model model;
+ protected Service service;
+ protected SOAPVersion curSOAPVersion;
+ protected String targetVersion;
+ protected boolean donotOverride;
+ protected String servicePackage;
+ protected JCodeModel cm;
+ protected boolean printStackTrace;
+ protected String wsdlLocation;
+
+ private LocalizableMessageFactory messageFactory;
+
+ public GeneratorBase() {
+ sourceDir = null;
+ destDir = null;
+ nonclassDestDir = null;
+ env = null;
+ model = null;
+ }
+
+ public void perform(
+ Model model,
+ Configuration config,
+ Properties properties) {
+ GeneratorBase generator = getGenerator(model, config, properties);
+
+ generator.doGeneration();
+ }
+
+ public abstract GeneratorBase getGenerator(
+ Model model,
+ Configuration config,
+ Properties properties);
+ public abstract GeneratorBase getGenerator(
+ Model model,
+ Configuration config,
+ Properties properties,
+ SOAPVersion ver);
+
+ protected GeneratorBase(
+ Model model,
+ Configuration config,
+ Properties properties) {
+
+ this.model = model;
+
+ if(model.getJAXBModel().getS2JJAXBModel() != null)
+ cm = model.getJAXBModel().getS2JJAXBModel().generateCode(null, new JAXBTypeGenerator.JAXBErrorListener());
+ else
+ cm = new JCodeModel();
+
+ this.env = (ProcessorEnvironment) config.getEnvironment();
+ String key = ProcessorOptions.DESTINATION_DIRECTORY_PROPERTY;
+ String dirPath = properties.getProperty(key);
+ this.destDir = new File(dirPath);
+ key = ProcessorOptions.SOURCE_DIRECTORY_PROPERTY;
+ String sourcePath = properties.getProperty(key);
+ this.sourceDir = new File(sourcePath);
+ key = ProcessorOptions.NONCLASS_DESTINATION_DIRECTORY_PROPERTY;
+ String nonclassDestPath = properties.getProperty(key);
+ this.nonclassDestDir = new File(nonclassDestPath);
+ if (nonclassDestDir == null)
+ nonclassDestDir = destDir;
+ messageFactory =
+ new LocalizableMessageFactory("org.jboss.com.sun.tools.ws.resources.generator");
+ this.targetVersion =
+ properties.getProperty(ProcessorOptions.JAXWS_SOURCE_VERSION);
+ key = ProcessorOptions.DONOT_OVERWRITE_CLASSES;
+ this.donotOverride =
+ Boolean.valueOf(properties.getProperty(key)).booleanValue();
+ this.printStackTrace = Boolean.valueOf(properties.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
+ this.wsdlLocation = properties.getProperty(ProcessorOptions.WSDL_LOCATION);
+ }
+
+ protected void doGeneration() {
+ try {
+ model.accept(this);
+ } catch (Exception e) {
+ if (env.verbose())
+ e.printStackTrace();
+ throw new GeneratorException("generator.nestedGeneratorError",e);
+ }
+ }
+
+ public void visit(Model model) throws Exception {
+ preVisitModel(model);
+ visitModel(model);
+ postVisitModel(model);
+ }
+
+ protected void preVisitModel(Model model) throws Exception {
+ }
+
+ protected void visitModel(Model model) throws Exception {
+ env.getNames().resetPrefixFactory();
+ for (Service service : model.getServices()) {
+ service.accept(this);
+ }
+ }
+
+ protected void postVisitModel(Model model) throws Exception {
+ }
+
+ public void visit(Service service) throws Exception {
+ preVisitService(service);
+ visitService(service);
+ postVisitService(service);
+ }
+
+ protected void preVisitService(Service service) throws Exception {
+ servicePackage = Names.getPackageName(service);
+ }
+
+ protected void visitService(Service service) throws Exception {
+ this.service = service;
+// Iterator ports = service.getPorts();
+ for (Port port : service.getPorts()) {
+ port.accept(this);
+ }
+ this.service = null;
+ }
+
+ protected void postVisitService(Service service) throws Exception {
+ Iterator extraTypes = model.getExtraTypes();
+ while (extraTypes.hasNext()) {
+ AbstractType type = (AbstractType) extraTypes.next();
+ }
+ servicePackage = null;
+ }
+
+ public void visit(Port port) throws Exception {
+ preVisitPort(port);
+ visitPort(port);
+ postVisitPort(port);
+ }
+
+ protected void preVisitPort(Port port) throws Exception {
+ curSOAPVersion = port.getSOAPVersion();
+ }
+
+ protected void visitPort(Port port) throws Exception {
+ for (Operation operation : port.getOperations()) {
+ operation.accept(this);
+ }
+ }
+
+ protected void postVisitPort(Port port) throws Exception {
+ curSOAPVersion = null;
+ }
+
+ public void visit(Operation operation) throws Exception {
+ preVisitOperation(operation);
+ visitOperation(operation);
+ postVisitOperation(operation);
+ }
+
+ protected void preVisitOperation(Operation operation) throws Exception {
+ }
+
+ protected void visitOperation(Operation operation) throws Exception {
+ operation.getRequest().accept(this);
+ if (operation.getResponse() != null)
+ operation.getResponse().accept(this);
+ Iterator faults = operation.getFaultsSet().iterator();
+ if (faults != null) {
+ Fault fault;
+ while (faults.hasNext()) {
+ fault = (Fault) faults.next();
+ fault.accept(this);
+ }
+ }
+ }
+
+ protected void postVisitOperation(Operation operation) throws Exception {
+ }
+
+ public void visit(Parameter param) throws Exception {
+ preVisitParameter(param);
+ visitParameter(param);
+ postVisitParameter(param);
+ }
+
+ protected void preVisitParameter(Parameter param) throws Exception {
+ }
+
+ protected void visitParameter(Parameter param) throws Exception {
+ }
+
+ protected void postVisitParameter(Parameter param) throws Exception {
+ }
+
+ public void visit(Block block) throws Exception {
+ preVisitBlock(block);
+ visitBlock(block);
+ postVisitBlock(block);
+ }
+
+ protected void preVisitBlock(Block block) throws Exception {
+ }
+
+ protected void visitBlock(Block block) throws Exception {
+ }
+
+ protected void postVisitBlock(Block block) throws Exception {
+ }
+
+ public void visit(Response response) throws Exception {
+ preVisitResponse(response);
+ visitResponse(response);
+ postVisitResponse(response);
+ }
+
+ protected void preVisitResponse(Response response) throws Exception {
+ }
+
+ protected void visitResponse(Response response) throws Exception {
+ Iterator iter = response.getParameters();
+ AbstractType type;
+ Block block;
+ while (iter.hasNext()) {
+ ((Parameter) iter.next()).accept(this);
+ }
+ iter = response.getBodyBlocks();
+ while (iter.hasNext()) {
+ block = (Block) iter.next();
+ type = block.getType();
+ if(type instanceof JAXBType)
+ ((JAXBType) type).accept(this);
+ else if(type instanceof RpcLitStructure)
+ ((RpcLitStructure) type).accept(this);
+
+ responseBodyBlock(block);
+ }
+ iter = response.getHeaderBlocks();
+ while (iter.hasNext()) {
+ block = (Block) iter.next();
+ type = block.getType();
+ if(type instanceof JAXBType)
+ ((JAXBType) type).accept(this);
+ responseHeaderBlock(block);
+ }
+
+ //attachment
+ iter = response.getAttachmentBlocks();
+ while (iter.hasNext()) {
+ block = (Block) iter.next();
+ type = block.getType();
+ if(type instanceof JAXBType)
+ ((JAXBType) type).accept(this);
+ responseAttachmentBlock(block);
+ }
+
+ }
+
+ protected void responseBodyBlock(Block block) throws Exception {
+ }
+
+ protected void responseHeaderBlock(Block block) throws Exception {
+ }
+
+ protected void responseAttachmentBlock(Block block) throws Exception {
+ }
+
+ protected void postVisitResponse(Response response) throws Exception {
+ }
+
+ public void visit(Request request) throws Exception {
+ preVisitRequest(request);
+ visitRequest(request);
+ postVisitRequest(request);
+ }
+
+ protected void preVisitRequest(Request request) throws Exception {
+ }
+
+ protected void visitRequest(Request request) throws Exception {
+ Iterator iter = request.getParameters();
+ AbstractType type;
+ Block block;
+ while (iter.hasNext()) {
+ ((Parameter) iter.next()).accept(this);
+ }
+ iter = request.getBodyBlocks();
+ while (iter.hasNext()) {
+ block = (Block) iter.next();
+ type = block.getType();
+ if(type instanceof JAXBType)
+ ((JAXBType) type).accept(this);
+ else if(type instanceof RpcLitStructure)
+ ((RpcLitStructure) type).accept(this);
+ requestBodyBlock(block);
+ }
+ iter = request.getHeaderBlocks();
+ while (iter.hasNext()) {
+ block = (Block) iter.next();
+ type = block.getType();
+ if(type instanceof JAXBType)
+ ((JAXBType) type).accept(this);
+ requestHeaderBlock(block);
+ }
+ }
+
+ protected void requestBodyBlock(Block block) throws Exception {
+ }
+
+ protected void requestHeaderBlock(Block block) throws Exception {
+ }
+
+ protected void postVisitRequest(Request request) throws Exception {
+ }
+
+ public void visit(Fault fault) throws Exception {
+ preVisitFault(fault);
+ visitFault(fault);
+ postVisitFault(fault);
+ }
+
+ protected void preVisitFault(Fault fault) throws Exception {
+ }
+
+ protected void visitFault(Fault fault) throws Exception {
+ }
+
+ protected void postVisitFault(Fault fault) throws Exception {
+ }
+
+ protected void writeWarning(IndentingWriter p) throws IOException {
+ writeWarning(p, targetVersion);
+ }
+
+ public List<String> getJAXWSClassComment(){
+ return getJAXWSClassComment(targetVersion);
+ }
+
+ public static List<String> getJAXWSClassComment(String targetVersion) {
+ List<String> comments = new ArrayList<String>();
+
+ comments.add("JBossWS Generated Source\n");
+ comments.add("\n");
+ comments.add("Generation Date: " + new Date() + "\n");
+ comments.add("\n");
+ comments.add("This generated source code represents a derivative work of the input to\n");
+ comments.add("the generator that produced it. Consult the input for the copyright and\n");
+ comments.add("terms of use that apply to this source code.\n");
+ comments.add("\n");
+ comments.add("JAX-WS Version: " + targetVersion);
+ return comments;
+ }
+
+ public static void writeWarning(IndentingWriter p,
+ String targetVersion) throws IOException {
+ /*
+ * Write boiler plate comment.
+ */
+ p.pln("/*");
+ p.pln(" * JBossWS WS-Tools Generated Source");
+ p.pln(" *");
+ p.pln(" * Generation Date: " + new Date());
+ p.pln(" *");
+ p.pln(" * This generated source code represents a derivative work of the input to");
+ p.pln(" * the generator that produced it. Consult the input for the copyright and");
+ p.pln(" * terms of use that apply to this source code.");
+ p.pln(" *");
+ p.pln(" * JAX-WS Version: " + targetVersion);
+ p.pln(" */");
+ p.pln();
+ }
+
+ public void writePackage(IndentingWriter p, String classNameStr)
+ throws IOException {
+
+ writePackage(p, classNameStr, targetVersion);
+ }
+
+ public static void writePackage(
+ IndentingWriter p,
+ String classNameStr,
+ String sourceVersion)
+ throws IOException {
+
+ writeWarning(p, sourceVersion);
+ writePackageOnly(p, classNameStr);
+ }
+
+ public static void writePackageOnly(IndentingWriter p, String classNameStr)
+ throws IOException {
+ int idx = classNameStr.lastIndexOf(".");
+ if (idx > 0) {
+ p.pln("package " + classNameStr.substring(0, idx) + ";");
+ p.pln();
+ }
+ }
+
+
+ protected JDefinedClass getClass(String className, ClassType type) {
+ JDefinedClass cls = null;
+ try {
+ cls = cm._class(className, type);
+ } catch (JClassAlreadyExistsException e){
+ cls = cm._getClass(className);
+ }
+ return cls;
+ }
+
+ protected void log(String msg) {
+ if (env.verbose()) {
+ System.out.println(
+ "["
+ + Names.stripQualifier(this.getClass().getName())
+ + ": "
+ + msg
+ + "]");
+ }
+ }
+
+ protected void warn(String key) {
+ env.warn(messageFactory.getMessage(key));
+ }
+
+ protected void warn(String key, String arg) {
+ env.warn(messageFactory.getMessage(key, arg));
+ }
+
+ protected void warn(String key, Object[] args) {
+ env.warn(messageFactory.getMessage(key, args));
+ }
+
+ protected void info(String key) {
+ env.info(messageFactory.getMessage(key));
+ }
+
+ protected void info(String key, String arg) {
+ env.info(messageFactory.getMessage(key, arg));
+ }
+
+ protected static void fail(String key) {
+ throw new GeneratorException(key);
+ }
+
+ protected static void fail(String key, String arg) {
+ throw new GeneratorException(key, arg);
+ }
+
+ protected static void fail(String key, String arg1, String arg2) {
+ throw new GeneratorException(key, new Object[] { arg1, arg2 });
+ }
+
+ protected static void fail(Localizable arg) {
+ throw new GeneratorException("generator.nestedGeneratorError", arg);
+ }
+
+ protected static void fail(Throwable arg) {
+ throw new GeneratorException(
+ "generator.nestedGeneratorError",
+ arg);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.com.sun.xml.ws.processor.model.jaxb.JAXBTypeVisitor#visit(org.jboss.com.sun.xml.ws.processor.model.jaxb.JAXBType)
+ */
+ public void visit(JAXBType type) throws Exception {
+ preVisitJAXBType(type);
+ visitJAXBType(type);
+ postVisitJAXBType(type);
+
+ }
+
+ /**
+ * @param type
+ */
+ protected void postVisitJAXBType(JAXBType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * @param type
+ */
+ protected void visitJAXBType(JAXBType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * @param type
+ */
+ protected void preVisitJAXBType(JAXBType type) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.jboss.com.sun.xml.ws.processor.model.jaxb.JAXBTypeVisitor#visit(org.jboss.com.sun.xml.ws.processor.model.jaxb.RpcLitStructure)
+ */
+ public void visit(RpcLitStructure type) throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void writeHandlerConfig(String className, JDefinedClass cls, WSDLModelInfo wsdlModelInfo) {
+ Element e = wsdlModelInfo.getHandlerConfig();
+ if(e == null)
+ return;
+ JAnnotationUse handlerChainAnn = cls.annotate(cm.ref(HandlerChain.class));
+ //String fullName = env.getNames().customJavaTypeClassName(port.getJavaInterface());
+ NodeList nl = e.getElementsByTagNameNS(
+ "http://java.sun.com/xml/ns/javaee", "handler-chain");
+ if(nl.getLength() > 0){
+ Element hn = (Element)nl.item(0);
+ String fName = getHandlerConfigFileName(className);
+ handlerChainAnn.param("file", fName);
+ generateHandlerChainFile(e, className);
+ }
+ }
+
+ private String getHandlerConfigFileName(String fullName){
+ String name = Names.stripQualifier(fullName);
+ return name+"_handler.xml";
+ }
+
+ private void generateHandlerChainFile(Element hChains, String name) {
+ String hcName = getHandlerConfigFileName(name);
+
+ File packageDir = DirectoryUtil.getOutputDirectoryFor(name, destDir, env);
+ File hcFile = new File(packageDir, hcName);
+
+ /* adding the file name and its type */
+ GeneratedFileInfo fi = new GeneratedFileInfo();
+ fi.setFile(hcFile);
+ fi.setType("HandlerConfig");
+ env.addGeneratedFile(fi);
+
+ try {
+ IndentingWriter p =
+ new IndentingWriter(
+ new OutputStreamWriter(new FileOutputStream(hcFile)));
+ Transformer it = XmlUtil.newTransformer();
+
+ it.setOutputProperty(OutputKeys.METHOD, "xml");
+ it.setOutputProperty(OutputKeys.INDENT, "yes");
+ it.setOutputProperty(
+ "{http://xml.apache.org/xslt}indent-amount",
+ "2");
+ it.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+ it.transform( new DOMSource(hChains), new StreamResult(p) );
+ p.close();
+ } catch (Exception e) {
+ throw new GeneratorException(
+ "generator.nestedGeneratorError",
+ e);
+ }
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorBase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorConstants.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorConstants.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorConstants.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,83 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerConstants;
+
+/**
+ * @author WS Development Team
+ */
+public interface GeneratorConstants extends ModelerConstants {
+
+ /*
+ * Constants used in the generators
+ */
+ public static final String FILE_TYPE_WSDL = "Wsdl";
+ public static final String FILE_TYPE_REMOTE_INTERFACE = "RemoteInterface";
+ public static final String FILE_TYPE_SERVICE = "Service";
+ public static final String FILE_TYPE_HANDLER_CONFIG = "HandlerConfig";
+ public static final String FILE_TYPE_SERVICE_IMPL = "ServiceImpl";
+ public static final String FILE_TYPE_EXCEPTION = "Exception";
+ public static final String FILE_TYPE_WRAPPER_BEAN = "WrapperBean";
+ public static final String FILE_TYPE_EXCEPTION_BEAN = "ExceptionBean";
+ /*
+ * Identifiers potentially useful for all Generators
+ */
+
+ public static final String ID_DELEGATE_BASE = "org.jboss.com.sun.xml.ws.soap.internal.DelegateBase";
+
+
+ public static final char DOTC = '.';
+ public static final String SIG_INNERCLASS = "$";
+
+ public static final String UNDERSCORE = "_";
+ public static final String STUB_SUFFIX = "_Stub";
+
+ public static final String CLIENT_DELEGATE_SUFFIX = "_Delegate";
+ public static final String CLIENT_CONTACTINFOLIST_SUFFIX = "_ContactInfoList";
+
+ public static final String CLIENT_ENCODER_DECODER_SUFFIX = "_CED";
+ public static final String SERVER_ENCODER_DECODER_SUFFIX = "_SED";
+ public static final String TIE_SUFFIX = "_Tie";
+
+ public static final String PEPT_TIE_SUFFIX = "_PTie";
+ public static final String EPTFF_SUFFIX = "_EPTFF";
+ public static final String JAVA_SRC_SUFFIX = ".java";
+ public static final String IMPL_SUFFIX = "_Impl";
+ public static final String ARRAY = "Array";
+ public static final String MEMBER_PREFIX = "my";
+
+ public static final String OPCODE_SUFFIX = "_OPCODE";
+ public static final String QNAME_SUFFIX = "_QNAME";
+ public static final String TYPE_QNAME_SUFFIX = "_TYPE" + QNAME_SUFFIX;
+
+ public static final String GET = "get";
+ public static final String IS = "is";
+ public static final String SET = "set";
+ public static final String RESPONSE = "Response";
+ public static final String NS_PREFIX = "ns";
+ public static final String SERVICE_SUFFIX = "_Service";
+ public static final String JAVA_PACKAGE_PREFIX = "java.";
+ public static final String JAVAX_PACKAGE_PREFIX = "javax.";
+ public static final String FAULT_CLASS_MEMBER_NAME = "faultInfo";
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorException.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorException.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorException.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,46 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorException;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class GeneratorException extends ProcessorException {
+
+ public GeneratorException(String key, Object... args) {
+ super(key, args);
+ }
+
+ public GeneratorException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public String getResourceBundleName() {
+ return "org.jboss.com.sun.tools.ws.resources.generator";
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorUtil.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorUtil.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorUtil.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,181 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import java.io.IOException;
+import java.util.Comparator;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.Block;
+import org.jboss.com.sun.tools.ws.processor.model.Fault;
+import org.jboss.com.sun.tools.ws.processor.model.Operation;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureType;
+import org.jboss.com.sun.tools.ws.processor.util.IndentingWriter;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class GeneratorUtil implements GeneratorConstants {
+
+ public static void writeNewQName(IndentingWriter p, QName name)
+ throws IOException {
+ p.p(
+ "new QName(\""
+ + name.getNamespaceURI()
+ + "\", \""
+ + name.getLocalPart()
+ + "\")");
+ }
+
+
+ public static void writeBlockQNameDeclaration(
+ IndentingWriter p,
+ Operation operation,
+ Block block,
+ Names names)
+ throws IOException {
+ String qname = names.getBlockQNameName(operation, block);
+ p.p("private static final QName ");
+ p.p(qname + " = ");
+ writeNewQName(p, block.getName());
+ p.pln(";");
+ }
+
+ public static void writeQNameDeclaration(
+ IndentingWriter p,
+ QName name,
+ Names names)
+ throws IOException {
+ String qname = names.getQNameName(name);
+ p.p("private static final QName ");
+ p.p(qname + " = ");
+ writeNewQName(p, name);
+ p.pln(";");
+ }
+
+ public static void writeQNameTypeDeclaration(
+ IndentingWriter p,
+ QName name,
+ Names names)
+ throws IOException {
+ String qname = names.getTypeQName(name);
+ p.p("private static final QName ");
+ p.p(qname + " = ");
+ writeNewQName(p, name);
+ p.pln(";");
+ }
+
+ public static boolean classExists(
+ ProcessorEnvironment env,
+ String className) {
+ try {
+ // Takes care of inner classes.
+ getLoadableClassName(className, env.getClassLoader());
+ return true;
+ } catch(ClassNotFoundException ce) {
+ }
+ return false;
+ }
+
+ public static String getLoadableClassName(
+ String className,
+ ClassLoader classLoader)
+ throws ClassNotFoundException {
+
+ try {
+ Class.forName(className, true, classLoader);
+ } catch (ClassNotFoundException e) {
+ int idx = className.lastIndexOf(DOTC);
+ if (idx > -1) {
+ String tmp = className.substring(0, idx) + SIG_INNERCLASS;
+ tmp += className.substring(idx + 1);
+ return getLoadableClassName(tmp, classLoader);
+ }
+ throw e;
+ }
+ return className;
+ }
+
+ public static class FaultComparator implements Comparator {
+ private boolean sortName = false;
+ public FaultComparator() {
+ }
+ public FaultComparator(boolean sortName) {
+ this.sortName = sortName;
+ }
+
+ public int compare(Object o1, Object o2) {
+ if (sortName) {
+ QName name1 = ((Fault) o1).getBlock().getName();
+ QName name2 = ((Fault) o2).getBlock().getName();
+ // Faults that are processed by name first, then type
+ if (!name1.equals(name2)) {
+ return name1.toString().compareTo(name2.toString());
+ }
+ }
+ JavaStructureType type1 = ((Fault) o1).getJavaException();
+ JavaStructureType type2 = ((Fault) o2).getJavaException();
+ int result = sort(type1, type2);
+ return result;
+ }
+
+ protected int sort(JavaStructureType type1, JavaStructureType type2) {
+ if (type1.getName().equals(type2.getName())) {
+ return 0;
+ }
+ JavaStructureType superType;
+ superType = type1.getSuperclass();
+ while (superType != null) {
+ if (superType.equals(type2)) {
+ return -1;
+ }
+ superType = superType.getSuperclass();
+ }
+ superType = type2.getSuperclass();
+ while (superType != null) {
+ if (superType.equals(type1)) {
+ return 1;
+ }
+ superType = superType.getSuperclass();
+ }
+ if (type1.getSubclasses() == null && type2.getSubclasses() != null)
+ return -1;
+ if (type1.getSubclasses() != null && type2.getSubclasses() == null)
+ return 1;
+ if (type1.getSuperclass() != null
+ && type2.getSuperclass() == null) {
+ return 1;
+ }
+ if (type1.getSuperclass() == null
+ && type2.getSuperclass() != null) {
+ return -1;
+ }
+ return type1.getName().compareTo(type2.getName());
+ }
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/GeneratorUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/JAXBTypeGenerator.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/JAXBTypeGenerator.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/JAXBTypeGenerator.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,171 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import java.util.Properties;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.RpcLitStructure;
+import org.jboss.com.sun.tools.ws.processor.modeler.wsdl.ConsoleErrorReporter;
+import org.jboss.com.sun.tools.ws.wscompile.WSCodeWriter;
+import org.jboss.com.sun.xml.ws.encoding.soap.SOAPVersion;
+import org.xml.sax.SAXParseException;
+
+import com.sun.codemodel.CodeWriter;
+import com.sun.codemodel.JCodeModel;
+import com.sun.codemodel.writer.ProgressCodeWriter;
+//import com.sun.tools.xjc.addon.Augmenter;
+import com.sun.tools.xjc.api.ErrorListener;
+import com.sun.tools.xjc.api.JAXBModel;
+import com.sun.tools.xjc.api.S2JJAXBModel;
+
+/**
+ * @author Vivek Pandey
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class JAXBTypeGenerator extends GeneratorBase {
+
+ /**
+ * @author Vivek Pandey
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+ public static class JAXBErrorListener implements ErrorListener {
+
+ /**
+ *
+ */
+ public JAXBErrorListener() {
+ super();
+ }
+
+ /* (non-Javadoc)
+ * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
+ */
+ public void error(SAXParseException arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
+ */
+ public void fatalError(SAXParseException arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
+ */
+ public void warning(SAXParseException arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ /* (non-Javadoc)
+ * @see com.sun.tools.xjc.api.ErrorListener#info(org.xml.sax.SAXParseException)
+ */
+ public void info(SAXParseException arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+ /**
+ *
+ */
+ public JAXBTypeGenerator() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+ /**
+ * @param model
+ * @param config
+ * @param properties
+ */
+ public JAXBTypeGenerator(Model model, Configuration config,
+ Properties properties) {
+ super(model, config, properties);
+ }
+ /* (non-Javadoc)
+ * @see GeneratorBase#getGenerator(org.jboss.com.sun.xml.ws.processor.model.Model, org.jboss.com.sun.xml.ws.processor.config.Configuration, java.util.Properties)
+ */
+ public GeneratorBase getGenerator(Model model, Configuration config,
+ Properties properties) {
+ return new JAXBTypeGenerator(model, config, properties);
+ }
+ /* (non-Javadoc)
+ * @see cGeneratorBase#getGenerator(org.jboss.com.sun.xml.ws.processor.model.Model, org.jboss.com.sun.xml.ws.processor.config.Configuration, java.util.Properties, org.jboss.com.sun.xml.ws.soap.SOAPVersion)
+ */
+ public GeneratorBase getGenerator(Model model, Configuration config,
+ Properties properties, SOAPVersion ver) {
+ return new JAXBTypeGenerator(model, config, properties);
+ }
+
+ /* (non-Javadoc)
+ * @see JAXBTypeVisitor#visit(JAXBType)
+ */
+ public void visit(JAXBType type) throws Exception {
+ //this is a raw type, probably from rpclit
+ if(type.getJaxbModel() == null)
+ return;
+ S2JJAXBModel model = type.getJaxbModel().getS2JJAXBModel();
+ if (model != null)
+ generateJAXBClasses(model);
+ }
+
+
+ /* (non-Javadoc)
+ * @see JAXBTypeVisitor#visit(org.jboss.com.sun.xml.ws.processor.model.jaxb.RpcLitStructure)
+ */
+ public void visit(RpcLitStructure type) throws Exception {
+ S2JJAXBModel model = type.getJaxbModel().getS2JJAXBModel();
+ generateJAXBClasses(model);
+ }
+
+ private static boolean doneGeneration = true;
+ private void generateJAXBClasses(S2JJAXBModel model) throws Exception{
+ if(doneGeneration)
+ return;
+ JCodeModel cm = null;
+
+ // get the list of jaxb source files
+ CodeWriter cw = new WSCodeWriter(sourceDir,env);
+
+ if(env.verbose())
+ cw = new ProgressCodeWriter(cw, System.out); // TODO this should not be System.out, should be
+ // something from ProcessorEnvironment
+ //TODO:set package level javadoc in JPackage
+ cm = model.generateCode(null, new ConsoleErrorReporter(env, printStackTrace));
+ cm.build(cw);
+ doneGeneration = true;
+ }
+
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/JAXBTypeGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/Names.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/Names.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/Names.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,423 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.*;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureMember;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBProperty;
+import org.jboss.com.sun.tools.ws.processor.util.DirectoryUtil;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.util.ClassNameInfo;
+import org.jboss.com.sun.xml.ws.streaming.PrefixFactory;
+import org.jboss.com.sun.xml.ws.streaming.PrefixFactoryImpl;
+import org.jboss.com.sun.xml.ws.util.StringUtils;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Names provides utility methods used by other wscompile classes
+ * for dealing with identifiers.
+ *
+ * @author WS Development Team
+ */
+public class Names implements GeneratorConstants{
+
+ public Names() {
+ }
+
+ public String stubFor(Port port, String infix) {
+ String result =
+ (String) port.getProperty(ModelProperties.PROPERTY_STUB_CLASS_NAME);
+ if (result == null) {
+ result =
+ makeDerivedClassName(
+ port.getJavaInterface(),
+ STUB_SUFFIX,
+ infix);
+ }
+ return result;
+ }
+
+ public String tieFor(Port port, String infix) {
+ String result =
+ (String) port.getProperty(ModelProperties.PROPERTY_TIE_CLASS_NAME);
+ if (result == null) {
+ result =
+ makeDerivedClassName(
+ port.getJavaInterface(),
+ TIE_SUFFIX,
+ infix);
+ }
+ return result;
+ }
+
+ public String makeDerivedClassName(
+ JavaInterface javaInterface,
+ String suffix,
+ String infix) {
+
+ String name =
+ ClassNameInfo.replaceInnerClassSym(javaInterface.getRealName());
+ return name + (infix == null ? "" : UNDERSCORE + infix) + suffix;
+ }
+
+ public static String getPortName(Port port) {
+ String javaPortName =
+ (String) port.getProperty(ModelProperties.PROPERTY_JAVA_PORT_NAME);
+ if (javaPortName != null) {
+ return javaPortName;
+ } else {
+ QName portName =
+ (QName) port.getProperty(
+ ModelProperties.PROPERTY_WSDL_PORT_NAME);
+ if (portName != null) {
+ return portName.getLocalPart();
+ } else {
+ String name = stripQualifier(port.getJavaInterface().getName());
+ return ClassNameInfo.replaceInnerClassSym(name);
+ }
+ }
+ }
+
+ public static String stripQualifier(Class classObj) {
+ String name = classObj.getName();
+ return stripQualifier(name);
+ }
+
+ public static String stripQualifier(String name) {
+ return ClassNameInfo.getName(name);
+ }
+
+ public static String getPackageName(String className) {
+ String packageName = ClassNameInfo.getQualifier(className);
+ return packageName != null ? packageName : "";
+ }
+
+ public static String getUnqualifiedClassName(String className) {
+ return ClassNameInfo.getName(className).replace('$', '.');
+ }
+
+ /**
+ * Return the File object that should be used as the source file
+ * for the given Java class, using the supplied destination
+ * directory for the top of the package hierarchy.
+ */
+ public File sourceFileForClass(
+ String className,
+ String outputClassName,
+ File destDir,
+ ProcessorEnvironment env)
+ throws GeneratorException {
+ File packageDir =
+ DirectoryUtil.getOutputDirectoryFor(className, destDir, env);
+ String outputName = stripQualifier(outputClassName);
+
+ String outputFileName = outputName + JAVA_SRC_SUFFIX;
+ return new File(packageDir, outputFileName);
+ }
+
+ public static String getPackageName(Service service) {
+ String portPackage =
+ getPackageName(service.getJavaInterface().getName());
+ return portPackage;
+ }
+
+ public String customJavaTypeClassName(JavaInterface intf) {
+ String intName = intf.getName();
+ return intName;
+ }
+
+ public String customExceptionClassName(Fault fault) {
+ String typeName = fault.getJavaException().getName();
+ return typeName;
+ }
+
+ public String getExceptionClassMemberName(){
+ return FAULT_CLASS_MEMBER_NAME;
+ }
+
+ public String getQNameName(QName name) {
+ String qname =
+ getPrefix(name) + UNDERSCORE + name.getLocalPart() + QNAME_SUFFIX;
+ return validInternalJavaIdentifier(qname);
+ }
+
+ public String getBlockQNameName(Operation operation, Block block) {
+ QName blockName = block.getName();
+ String qname = getPrefix(blockName);
+ if (operation != null)
+ qname += UNDERSCORE + operation.getUniqueName();
+ qname += UNDERSCORE + blockName.getLocalPart() + QNAME_SUFFIX;
+ return validInternalJavaIdentifier(qname);
+ }
+
+ public String getTypeQName(QName name) {
+ String qname =
+ getPrefix(name)
+ + UNDERSCORE
+ + name.getLocalPart()
+ + TYPE_QNAME_SUFFIX;
+ return validInternalJavaIdentifier(qname);
+ }
+
+ /* (non-Javadoc)
+ * @see Names#validJavaClassName(String)
+ */
+ public String validJavaClassName(String name) {
+ return JAXBRIContext.mangleNameToClassName(name);
+ }
+
+ /* (non-Javadoc)
+ * @see Names#validJavaMemberName(String)
+ */
+ public String validJavaMemberName(String name) {
+ return JAXBRIContext.mangleNameToVariableName(name);
+ }
+
+ public String validInternalJavaIdentifier(String name) {
+ // return a valid java identifier without dropping characters (i.e. do not apply
+ // the mapping of XML names to Java identifiers in the spec); it's only meant
+ // to be used to generate internal identifiers (e.g. variable names in generated code)
+
+ StringBuffer sb = new StringBuffer();
+ for (int i = 0; i < name.length(); ++i) {
+ char ch = name.charAt(i);
+ if (i == 0) {
+ if (Character.isJavaIdentifierStart(ch)) {
+ sb.append(ch);
+ } else {
+ sb.append("_$");
+ sb.append(Integer.toHexString((int) ch));
+ sb.append("$");
+ }
+ } else {
+ if (Character.isJavaIdentifierPart(ch)) {
+ sb.append(ch);
+ } else {
+ sb.append("$");
+ sb.append(Integer.toHexString((int) ch));
+ sb.append("$");
+ }
+ }
+ }
+
+ String id = sb.toString();
+
+ String tmp = (String) reservedWords.get(id);
+ if (tmp != null)
+ id = tmp;
+ return id;
+ }
+
+ public String validExternalJavaIdentifier(String name) {
+ return validInternalJavaIdentifier(name).replace('$', '_');
+ }
+
+ public String validJavaName(String name) {
+ name = wordBreakString(name);
+ name = removeWhiteSpace(name);
+
+ String tmp = (String) reservedWords.get(name);
+ if (tmp != null)
+ name = tmp;
+ return name;
+ }
+
+ public boolean isJavaReservedWord(String name) {
+ return reservedWords.get(name) != null;
+ }
+
+ /* here we check on wether return values datatype is
+ boolean. If its boolean, instead of a get method
+ its set a is<MethodName> to comply with JavaBeans
+ Pattern spec */
+ public String getJavaMemberReadMethod(JavaStructureMember member) {
+ String return_value = null;
+ if ((member.getType().getRealName()) == "boolean") {
+ return_value = IS + StringUtils.capitalize(member.getName());
+ } else {
+ return_value = GET + StringUtils.capitalize(member.getName());
+ }
+ return (return_value);
+ }
+
+ public String getJavaMemberWriteMethod(JavaStructureMember member) {
+ return SET + StringUtils.capitalize(member.getName());
+ }
+
+ public static String getResponseName(String messageName) {
+ return messageName + RESPONSE;
+ }
+
+
+ public String getJavaReadMethod(JAXBProperty prop){
+ if(prop.getType().getName().equals("boolean"))
+ return IS + StringUtils.capitalize(prop.getName());
+ return getJavaReadMethod(prop.getName());
+ }
+
+ public String getJavaWriteMethod(JAXBProperty prop){
+ return getJavaWriteMethod(prop.getName());
+ }
+
+ public String getJavaReadMethod(String prop){
+ return GET + StringUtils.capitalize(prop);
+ }
+
+ public String getJavaWriteMethod(String prop){
+ return SET + StringUtils.capitalize(prop);
+ }
+
+ public String removeWhiteSpace(String str) {
+ String tmp = removeCharacter(' ', str);
+ return tmp;
+ }
+
+ public String wordBreakString(String str) {
+ StringBuffer buf = new StringBuffer(str);
+ char ch;
+ for (int i = 0; i < buf.length(); i++) {
+ ch = buf.charAt(i);
+ if (Character.isDigit(ch)) {
+ if (i + 1 < buf.length()
+ && !Character.isDigit(buf.charAt(i + 1))) {
+ buf.insert(1 + i++, ' ');
+ }
+ } else if (Character.isSpaceChar(ch) || ch == '_') {
+ continue;
+ } else if (!Character.isJavaIdentifierPart(ch)) {
+ buf.setCharAt(i, ' ');
+ } else if (!Character.isLetter(ch)) {
+ buf.setCharAt(i, ' ');
+ }
+ }
+ return buf.toString();
+ }
+
+ public String removeCharacter(int ch, String str) {
+ String tmp;
+ int idx = str.indexOf(ch);
+ while (idx >= 0) {
+ str =
+ str.substring(0, idx)
+ + StringUtils.capitalize(str.substring(idx + 1).trim());
+ idx = str.indexOf(' ');
+ }
+
+ return str;
+ }
+
+ public String getPrefix(QName name) {
+ return getPrefix(name.getNamespaceURI());
+ }
+
+ public String getPrefix(String uri) {
+ return prefixFactory.getPrefix(uri);
+ }
+
+ public void resetPrefixFactory() {
+ prefixFactory = new PrefixFactoryImpl(NS_PREFIX);
+ }
+
+ public void setSerializerNameInfix(String serNameInfix) {
+ if (serNameInfix != null && serNameInfix.length() > 0)
+ serializerNameInfix = UNDERSCORE + serNameInfix;
+ }
+
+ public String getSerializerNameInfix() {
+ // Fix for bug 4811625 and 4778136, undoing what setter does (remove beginning underscore)
+ String str = serializerNameInfix;
+ if ((serializerNameInfix != null)
+ && (serializerNameInfix.charAt(0) == '_'))
+ str = serializerNameInfix.substring(1);
+ return str;
+ }
+
+ protected String serializerNameInfix = null;
+ protected PrefixFactory prefixFactory = new PrefixFactoryImpl(NS_PREFIX);
+ protected static Map reservedWords;
+
+ static {
+ reservedWords = new HashMap();
+ reservedWords.put("abstract", "_abstract");
+ reservedWords.put("assert", "_assert");
+ reservedWords.put("boolean", "_boolean");
+ reservedWords.put("break", "_break");
+ reservedWords.put("byte", "_byte");
+ reservedWords.put("case", "_case");
+ reservedWords.put("catch", "_catch");
+ reservedWords.put("char", "_char");
+ reservedWords.put("class", "_class");
+ reservedWords.put("const", "_const");
+ reservedWords.put("continue", "_continue");
+ reservedWords.put("default", "_default");
+ reservedWords.put("do", "_do");
+ reservedWords.put("double", "_double");
+ reservedWords.put("else", "_else");
+ reservedWords.put("extends", "_extends");
+ reservedWords.put("false", "_false");
+ reservedWords.put("final", "_final");
+ reservedWords.put("finally", "_finally");
+ reservedWords.put("float", "_float");
+ reservedWords.put("for", "_for");
+ reservedWords.put("goto", "_goto");
+ reservedWords.put("if", "_if");
+ reservedWords.put("implements", "_implements");
+ reservedWords.put("import", "_import");
+ reservedWords.put("instanceof", "_instanceof");
+ reservedWords.put("int", "_int");
+ reservedWords.put("interface", "_interface");
+ reservedWords.put("long", "_long");
+ reservedWords.put("native", "_native");
+ reservedWords.put("new", "_new");
+ reservedWords.put("null", "_null");
+ reservedWords.put("package", "_package");
+ reservedWords.put("private", "_private");
+ reservedWords.put("protected", "_protected");
+ reservedWords.put("public", "_public");
+ reservedWords.put("return", "_return");
+ reservedWords.put("short", "_short");
+ reservedWords.put("static", "_static");
+ reservedWords.put("strictfp", "_strictfp");
+ reservedWords.put("super", "_super");
+ reservedWords.put("switch", "_switch");
+ reservedWords.put("synchronized", "_synchronized");
+ reservedWords.put("this", "_this");
+ reservedWords.put("throw", "_throw");
+ reservedWords.put("throws", "_throws");
+ reservedWords.put("transient", "_transient");
+ reservedWords.put("true", "_true");
+ reservedWords.put("try", "_try");
+ reservedWords.put("void", "_void");
+ reservedWords.put("volatile", "_volatile");
+ reservedWords.put("while", "_while");
+ reservedWords.put("enum", "_enum");
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/Names.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SeiGenerator.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SeiGenerator.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SeiGenerator.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,475 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import com.sun.codemodel.*;
+import com.sun.codemodel.writer.ProgressCodeWriter;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorAction;
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.model.*;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaMethod;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaParameter;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+import org.jboss.com.sun.tools.ws.processor.util.DirectoryUtil;
+import org.jboss.com.sun.tools.ws.processor.util.GeneratedFileInfo;
+import org.jboss.com.sun.tools.ws.processor.util.IndentingWriter;
+import org.jboss.com.sun.tools.ws.wscompile.WSCodeWriter;
+import org.jboss.com.sun.tools.ws.wsdl.document.PortType;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPStyle;
+import org.jboss.com.sun.xml.ws.encoding.soap.SOAPVersion;
+import org.jboss.com.sun.xml.ws.util.xml.XmlUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.ws.Holder;
+import javax.xml.namespace.QName;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.util.List;
+import java.util.Properties;
+import java.util.Iterator;
+
+public class SeiGenerator extends GeneratorBase implements ProcessorAction {
+ private WSDLModelInfo wsdlModelInfo;
+ private String serviceNS;
+
+ public SeiGenerator() {
+ }
+
+ protected void doGeneration() {
+ try {
+ model.accept(this);
+ } catch (Exception e) {
+ if (env.verbose())
+ e.printStackTrace();
+ throw new GeneratorException(
+ "generator.nestedGeneratorError",
+ e);
+ }
+ }
+
+ public GeneratorBase getGenerator(Model model, Configuration config, Properties properties) {
+ return new SeiGenerator(model, config, properties);
+ }
+
+ public SeiGenerator(Model model, Configuration config, Properties properties) {
+ super(model, config, properties);
+ this.model = model;
+ this.wsdlModelInfo = (WSDLModelInfo)config.getModelInfo();
+ }
+
+ public GeneratorBase getGenerator(Model model, Configuration config, Properties properties, SOAPVersion ver) {
+ return new SeiGenerator(model, config, properties);
+ }
+
+
+ private void write(Service service, Port port) throws Exception{
+ JavaInterface intf = port.getJavaInterface();
+ String className = env.getNames().customJavaTypeClassName(intf);
+
+ if (donotOverride && GeneratorUtil.classExists(env, className)) {
+ log("Class " + className + " exists. Not overriding.");
+ return;
+ }
+
+
+ JDefinedClass cls = getClass(className, ClassType.INTERFACE);
+ if (cls == null)
+ return;
+
+ // If the class has methods it has already been defined
+ // so skip it.
+ if (!cls.methods().isEmpty())
+ return;
+
+ //write class comment - JAXWS warning
+ JDocComment comment = cls.javadoc();
+
+ String ptDoc = intf.getJavaDoc();
+ if(ptDoc != null){
+ comment.add(ptDoc);
+ comment.add("\n\n");
+ }
+
+ for(String doc:getJAXWSClassComment()){
+ comment.add(doc);
+ }
+
+
+ //@WebService
+ JAnnotationUse webServiceAnn = cls.annotate(cm.ref(WebService.class));
+ writeWebServiceAnnotation(service, port, webServiceAnn);
+
+ //@HandlerChain
+ writeHandlerConfig(env.getNames().customJavaTypeClassName(port.getJavaInterface()), cls, wsdlModelInfo);
+
+ //@SOAPBinding
+ writeSOAPBinding(port, cls);
+
+ for (Operation operation: port.getOperations()) {
+ JavaMethod method = operation.getJavaMethod();
+
+ //@WebMethod
+ JMethod m = null;
+ JDocComment methodDoc = null;
+ String methodJavaDoc = operation.getJavaDoc();
+ if(method.getReturnType().getName().equals("void")){
+ m = cls.method(JMod.PUBLIC, void.class, method.getName());
+ methodDoc = m.javadoc();
+ }else {
+ JAXBTypeAndAnnotation retType = method.getReturnType().getType();
+ m = cls.method(JMod.PUBLIC, retType.getType(), method.getName());
+ retType.annotate(m);
+ methodDoc = m.javadoc();
+ JCommentPart ret = methodDoc.addReturn();
+ ret.add("returns "+retType.getName());
+ }
+ if(methodJavaDoc != null)
+ methodDoc.add(methodJavaDoc);
+
+ writeWebMethod(operation, m);
+ JClass holder = cm.ref(Holder.class);
+ for (JavaParameter parameter: method.getParametersList()) {
+ JVar var = null;
+ JAXBTypeAndAnnotation paramType = parameter.getType().getType();
+ if (parameter.isHolder()) {
+ var = m.param(holder.narrow(paramType.getType().boxify()), parameter.getName());
+ }else{
+ var = m.param(paramType.getType(), parameter.getName());
+ }
+
+ //annotate parameter with JAXB annotations
+ paramType.annotate(var);
+ methodDoc.addParam(var);
+ JAnnotationUse paramAnn = var.annotate(cm.ref(WebParam.class));
+ writeWebParam(operation, parameter, paramAnn);
+ }
+ for(Fault fault:operation.getFaultsSet()){
+ m._throws(fault.getExceptionClass());
+ methodDoc.addThrows(fault.getExceptionClass());
+ }
+ }
+ CodeWriter cw = new WSCodeWriter(sourceDir,env);
+
+ if(env.verbose())
+ cw = new ProgressCodeWriter(cw, System.out);
+ cm.build(cw);
+ }
+
+ private void writeWebMethod(Operation operation, JMethod m) {
+ Response response = operation.getResponse();
+ JAnnotationUse webMethodAnn = m.annotate(cm.ref(WebMethod.class));;
+ String operationName = (operation instanceof AsyncOperation)?
+ ((AsyncOperation)operation).getNormalOperation().getName().getLocalPart():
+ operation.getName().getLocalPart();
+
+ if(!m.name().equals(operationName)){
+ webMethodAnn.param("operationName", operationName);
+ }
+
+ if (operation.getSOAPAction() != null && operation.getSOAPAction().length() > 0){
+ webMethodAnn.param("action", operation.getSOAPAction());
+ }
+
+ if (operation.getResponse() == null){
+ m.annotate(javax.jws.Oneway.class);
+ }else if (!operation.getJavaMethod().getReturnType().getName().equals("void") &&
+ operation.getResponse().getParametersList().size() > 0){
+ Block block = null;
+ String resultName = null;
+ String nsURI = null;
+ if (operation.getResponse().getBodyBlocks().hasNext()) {
+ block = operation.getResponse().getBodyBlocks().next();
+ resultName = block.getName().getLocalPart();
+ if(isDocStyle || block.getLocation() == Block.HEADER){
+ nsURI = block.getName().getNamespaceURI();
+ }
+ }
+
+ for (Parameter parameter : operation.getResponse().getParametersList()) {
+ if (parameter.getParameterIndex() == -1) {
+ if(operation.isWrapped()||!isDocStyle){
+ if(parameter.getBlock().getLocation() == Block.HEADER){
+ resultName = parameter.getBlock().getName().getLocalPart();
+ }else{
+ resultName = parameter.getName();
+ }
+ if (isDocStyle || (parameter.getBlock().getLocation() == Block.HEADER)) {
+ nsURI = parameter.getType().getName().getNamespaceURI();
+ }
+ }else if(isDocStyle){
+ JAXBType t = (JAXBType)parameter.getType();
+ resultName = t.getName().getLocalPart();
+ nsURI = t.getName().getNamespaceURI();
+ }
+ if(!(operation instanceof AsyncOperation)){
+ JAnnotationUse wr = null;
+
+ if(!resultName.equals("return")){
+ if(wr == null)
+ wr = m.annotate(javax.jws.WebResult.class);
+ wr.param("name", resultName);
+ }
+ //if (operation.getStyle().equals(SOAPStyle.DOCUMENT) && !(nsURI.equals(serviceNS))) {
+ if((nsURI != null) && (!nsURI.equals(serviceNS) || (isDocStyle && operation.isWrapped()))){
+ if(wr == null)
+ wr = m.annotate(javax.jws.WebResult.class);
+ wr.param("targetNamespace", nsURI);
+ }
+ //doclit wrapped could have additional headers
+ if(!(isDocStyle && operation.isWrapped()) ||
+ (parameter.getBlock().getLocation() == Block.HEADER)){
+ if(wr == null)
+ wr = m.annotate(javax.jws.WebResult.class);
+ wr.param("partName", parameter.getName());
+ }
+ if(parameter.getBlock().getLocation() == Block.HEADER){
+ if(wr == null)
+ wr = m.annotate(javax.jws.WebResult.class);
+ wr.param("header",true);
+ }
+ }
+ }
+
+ }
+ }
+
+ //DOC/BARE
+ if (!sameParamStyle) {
+ if(!operation.isWrapped()) {
+ JAnnotationUse sb = m.annotate(SOAPBinding.class);
+ sb.param("parameterStyle", SOAPBinding.ParameterStyle.BARE);
+ }
+ }
+
+ if (operation.isWrapped() && operation.getStyle().equals(SOAPStyle.DOCUMENT)) {
+ Block reqBlock = operation.getRequest().getBodyBlocks().next();
+ JAnnotationUse reqW = m.annotate(javax.xml.ws.RequestWrapper.class);
+ reqW.param("localName", reqBlock.getName().getLocalPart());
+ reqW.param("targetNamespace", reqBlock.getName().getNamespaceURI());
+ reqW.param("className", reqBlock.getType().getJavaType().getName());
+
+ if (response != null) {
+ JAnnotationUse resW = m.annotate(javax.xml.ws.ResponseWrapper.class);
+ Block resBlock = response.getBodyBlocks().next();
+ resW.param("localName", resBlock.getName().getLocalPart());
+ resW.param("targetNamespace", resBlock.getName().getNamespaceURI());
+ resW.param("className", resBlock.getType().getJavaType().getName());
+ }
+ }
+ }
+
+ //TODO: JAXB should expose the annotations so that it can be added to JAnnotationUse
+ protected void writeJAXBTypeAnnotations(JAnnotationUse annUse, Parameter param) throws IOException{
+ List<String> annotations = param.getAnnotations();
+ if(annotations == null)
+ return;
+
+ for(String annotation:param.getAnnotations()){
+ //p.pln(annotation);
+ //annUse.
+ }
+ }
+
+ private boolean isMessageParam(Parameter param, Message message) {
+ Block block = param.getBlock();
+
+ return (message.getBodyBlockCount() > 0 && block.equals(message.getBodyBlocks().next())) ||
+ (message.getHeaderBlockCount() > 0 &&
+ block.equals(message.getHeaderBlocks().next()));
+ }
+
+ private boolean isHeaderParam(Parameter param, Message message) {
+ if (message.getHeaderBlockCount() == 0)
+ return false;
+
+ for (Block headerBlock : message.getHeaderBlocksMap().values())
+ if (param.getBlock().equals(headerBlock))
+ return true;
+
+ return false;
+ }
+
+ private boolean isAttachmentParam(Parameter param, Message message){
+ if (message.getAttachmentBlockCount() == 0)
+ return false;
+
+ for (Block attBlock : message.getAttachmentBlocksMap().values())
+ if (param.getBlock().equals(attBlock))
+ return true;
+
+ return false;
+ }
+
+ private boolean isUnboundParam(Parameter param, Message message){
+ if (message.getUnboundBlocksCount() == 0)
+ return false;
+
+ for (Block unboundBlock : message.getUnboundBlocksMap().values())
+ if (param.getBlock().equals(unboundBlock))
+ return true;
+
+ return false;
+ }
+
+ private void writeWebParam(Operation operation, JavaParameter javaParameter, JAnnotationUse paramAnno) {
+ Parameter param = javaParameter.getParameter();
+ Request req = operation.getRequest();
+ Response res = operation.getResponse();
+
+ boolean header = isHeaderParam(param, req) ||
+ (res != null ? isHeaderParam(param, res) : false);
+
+ String name;
+ boolean isWrapped = operation.isWrapped();
+
+ if((param.getBlock().getLocation() == Block.HEADER) || (isDocStyle && !isWrapped))
+ name = param.getBlock().getName().getLocalPart();
+ else
+ name = param.getName();
+
+ paramAnno.param("name", name);
+
+ String ns= null;
+
+ if (isDocStyle) {
+ ns = param.getBlock().getName().getNamespaceURI(); // its bare nsuri
+ if(isWrapped){
+ ns = ((JAXBType)param.getType()).getName().getNamespaceURI();
+ }
+ }else if(!isDocStyle && header){
+ ns = param.getBlock().getName().getNamespaceURI();
+ }
+
+ if((ns != null) && (!ns.equals(serviceNS) || (isDocStyle && isWrapped)))
+ paramAnno.param("targetNamespace", ns);
+
+ if (header) {
+ paramAnno.param("header", true);
+ }
+
+ if (param.isINOUT()){
+ paramAnno.param("mode", javax.jws.WebParam.Mode.INOUT);
+ }else if ((res != null) && (isMessageParam(param, res) || isHeaderParam(param, res) || isAttachmentParam(param, res) ||
+ isUnboundParam(param,res))){
+ paramAnno.param("mode", javax.jws.WebParam.Mode.OUT);
+ }
+
+ //doclit wrapped could have additional headers
+ if(!(isDocStyle && isWrapped) || header)
+ paramAnno.param("partName", javaParameter.getParameter().getName());
+ }
+
+ boolean isDocStyle = true;
+ boolean sameParamStyle = true;
+ private void writeSOAPBinding(Port port, JDefinedClass cls) {
+ JAnnotationUse soapBindingAnn = null;
+ isDocStyle = port.getStyle() != null ? port.getStyle().equals(SOAPStyle.DOCUMENT) : true;
+ if(!isDocStyle){
+ if(soapBindingAnn == null)
+ soapBindingAnn = cls.annotate(SOAPBinding.class);
+ soapBindingAnn.param("style", SOAPBinding.Style.RPC);
+ port.setWrapped(true);
+ }
+ if(isDocStyle){
+ boolean first = true;
+ boolean isWrapper = true;
+ for(Operation operation:port.getOperations()){
+ if(first){
+ isWrapper = operation.isWrapped();
+ first = false;
+ continue;
+ }
+ sameParamStyle = (isWrapper == operation.isWrapped());
+ if(!sameParamStyle)
+ break;
+ }
+ if(sameParamStyle)
+ port.setWrapped(isWrapper);
+ }
+ if(sameParamStyle && !port.isWrapped()){
+ if(soapBindingAnn == null)
+ soapBindingAnn = cls.annotate(SOAPBinding.class);
+ soapBindingAnn.param("parameterStyle", SOAPBinding.ParameterStyle.BARE);
+ }
+ }
+
+ private void writeWebServiceAnnotation(Service service, Port port, JAnnotationUse wsa) {
+ QName name = (QName) port.getProperty(ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
+ wsa.param("name", name.getLocalPart());
+ wsa.param("targetNamespace", name.getNamespaceURI());
+ }
+
+
+
+
+ public void visit(Model model) throws Exception {
+ for(Service s:model.getServices()){
+ s.accept(this);
+ }
+ }
+
+ public void visit(Service service) throws Exception {
+ String jd = model.getJavaDoc();
+ if(jd != null){
+ JPackage pkg = cm._package(wsdlModelInfo.getJavaPackageName());
+ pkg.javadoc().add(jd);
+ }
+
+ for(Port p:service.getPorts()){
+ visitPort(service, p);
+ }
+ }
+
+ private void visitPort(Service service, Port port) {
+ if (port.isProvider()) {
+ return; // Not generating for Provider based endpoint
+ }
+
+
+ try {
+ write(service, port);
+ } catch (Exception e) {
+ throw new GeneratorException(
+ "generator.nestedGeneratorError",
+ e);
+ }
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SeiGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/ServiceGenerator.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/ServiceGenerator.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/ServiceGenerator.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,216 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import com.sun.codemodel.*;
+import com.sun.codemodel.writer.ProgressCodeWriter;
+import java.util.Properties;
+
+import com.sun.tools.xjc.api.XJC;
+import com.sun.xml.bind.api.JAXBRIContext;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+import java.net.MalformedURLException;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorAction;
+import org.jboss.com.sun.tools.ws.processor.config.Configuration;
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+import org.jboss.com.sun.tools.ws.wscompile.WSCodeWriter;
+import org.jboss.com.sun.xml.ws.encoding.soap.SOAPVersion;
+import org.jboss.com.sun.xml.ws.util.JAXWSUtils;
+import org.jboss.com.sun.xml.ws.util.StringUtils;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class ServiceGenerator extends GeneratorBase implements ProcessorAction {
+ private String serviceNS;
+ private WSDLModelInfo wsdlModelInfo;
+
+ public ServiceGenerator() {
+ super();
+ }
+
+ private ServiceGenerator(
+ Model model,
+ Configuration config,
+ Properties properties) {
+ super(model, config, properties);
+ this.wsdlModelInfo = (WSDLModelInfo)config.getModelInfo();
+ }
+
+ public GeneratorBase getGenerator(
+ Model model,
+ Configuration config,
+ Properties properties) {
+ return new ServiceGenerator(model, config, properties);
+ }
+
+ public GeneratorBase getGenerator(
+ Model model,
+ Configuration config,
+ Properties properties,
+ SOAPVersion ver) {
+ return new ServiceGenerator(model, config, properties);
+ }
+
+ /**
+ * Generates an expression that evaluates to "new QName(...)"
+ */
+ private JInvocation createQName(QName name) {
+ return JExpr._new(cm.ref(QName.class)).arg(name.getNamespaceURI()).arg(name.getLocalPart());
+ }
+
+ private JInvocation createURL(URL url) {
+ return JExpr._new(cm.ref(URL.class)).arg(url.toExternalForm());
+ }
+
+ protected void visitService(Service service) {
+ try {
+ JavaInterface intf = (JavaInterface) service.getJavaInterface();
+ String className = env.getNames().customJavaTypeClassName(intf);
+ if (donotOverride && GeneratorUtil.classExists(env, className)) {
+ log("Class " + className + " exists. Not overriding.");
+ return;
+ }
+
+ JDefinedClass cls = getClass(className, ClassType.CLASS);
+
+ cls._extends(javax.xml.ws.Service.class);
+ String serviceFieldName = JAXBRIContext.mangleNameToClassName(service.getName().getLocalPart()).toUpperCase();
+ String wsdlLocationName = serviceFieldName+"_WSDL_LOCATION";
+ JFieldVar urlField = cls.field(JMod.PRIVATE|JMod.STATIC|JMod.FINAL, URL.class, wsdlLocationName);
+ JClass qNameCls = cm.ref(QName.class);
+ JInvocation inv;
+ inv = JExpr._new(qNameCls);
+ inv.arg("namespace");
+ inv.arg("localpart");
+
+
+ JBlock staticBlock = cls.init();
+ URL url = new URL(JAXWSUtils.absolutize(JAXWSUtils.getFileOrURLName(wsdlLocation)));
+ JVar urlVar = staticBlock.decl(cm.ref(URL.class),"url", JExpr._null());
+ JTryBlock tryBlock = staticBlock._try();
+ tryBlock.body().assign(urlVar, createURL(url));
+ JCatchBlock catchBlock = tryBlock._catch(cm.ref(MalformedURLException.class));
+ catchBlock.param("e");
+ catchBlock.body().directStatement("e.printStackTrace();");
+ staticBlock.assign(urlField, urlVar);
+
+ //write class comment - JAXWS warning
+ JDocComment comment = cls.javadoc();
+
+ if(service.getJavaDoc() != null){
+ comment.add(service.getJavaDoc());
+ comment.add("\n\n");
+ }
+
+ for (String doc : getJAXWSClassComment()) {
+ comment.add(doc);
+ }
+
+ JMethod constructor = cls.constructor(JMod.PUBLIC);
+ constructor.param(URL.class, "wsdlLocation");
+ constructor.param(QName.class, "serviceName");
+ constructor.body().directStatement("super(wsdlLocation, serviceName);");
+
+ constructor = cls.constructor(JMod.PUBLIC);
+ constructor.body().directStatement("super("+wsdlLocationName+", new QName(\""+service.getName().getNamespaceURI()+"\", \""+service.getName().getLocalPart()+"\"));");
+
+ //@WebService
+ JAnnotationUse webServiceClientAnn = cls.annotate(cm.ref(WebServiceClient.class));
+ writeWebServiceClientAnnotation(service, webServiceClientAnn);
+
+ //@HandlerChain
+ writeHandlerConfig(env.getNames().customJavaTypeClassName(service.getJavaInterface()), cls, wsdlModelInfo);
+
+ for (Port port: service.getPorts()) {
+ if (port.isProvider()) {
+ continue; // No getXYZPort() for porvider based endpoint
+ }
+ //@WebEndpoint
+ JMethod m = null;
+ JDocComment methodDoc = null;
+ JType retType = getClass(port.getJavaInterface().getName(), ClassType.INTERFACE);
+ m = cls.method(JMod.PUBLIC, retType, port.getPortGetter());
+ methodDoc = m.javadoc();
+ if(port.getJavaDoc() != null)
+ methodDoc.add(port.getJavaDoc());
+ JCommentPart ret = methodDoc.addReturn();
+ ret.add("returns "+retType.name());
+ JBlock body = m.body();
+ StringBuffer statement = new StringBuffer("return (");
+ statement.append(retType.name());
+ statement.append(")super.getPort(new QName(\""+port.getName().getNamespaceURI()+"\", \""+ port.getName().getLocalPart()+"\"), ");
+ statement.append(retType.name());
+ statement.append(".class);");
+ body.directStatement(statement.toString());
+ writeWebEndpoint(port, m);
+ }
+ CodeWriter cw = new WSCodeWriter(sourceDir,env);
+
+ if(env.verbose())
+ cw = new ProgressCodeWriter(cw, System.out);
+ cm.build(cw);
+
+ } catch (IOException e) {
+ throw new GeneratorException(
+ "generator.nestedGeneratorError",
+ e);
+ }
+ }
+
+ protected JDefinedClass getClass(String className, ClassType type) {
+ JDefinedClass cls = null;
+ try {
+ cls = cm._class(className, type);
+ } catch (JClassAlreadyExistsException e){
+ cls = cm._getClass(className);
+ }
+ return cls;
+ }
+
+ private void writeWebServiceClientAnnotation(Service service, JAnnotationUse wsa) {
+ String serviceName = service.getName().getLocalPart();
+ serviceNS = service.getName().getNamespaceURI();
+ wsa.param("name", serviceName);
+ wsa.param("targetNamespace", serviceNS);
+ wsa.param("wsdlLocation", wsdlLocation);
+ }
+
+ private void writeWebEndpoint(Port port, JMethod m) {
+ JAnnotationUse webEndpointAnn = m.annotate(cm.ref(WebEndpoint.class));
+ webEndpointAnn.param("name", port.getName().getLocalPart());
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/ServiceGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SimpleToBoxedUtil.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SimpleToBoxedUtil.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SimpleToBoxedUtil.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,110 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.generator;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public final class SimpleToBoxedUtil {
+
+ public static String getBoxedExpressionOfType(String s, String c) {
+ if (isPrimitive(c)) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("new ");
+ sb.append(getBoxedClassName(c));
+ sb.append('(');
+ sb.append(s);
+ sb.append(')');
+ return sb.toString();
+ } else
+ return s;
+ }
+
+ public static String getUnboxedExpressionOfType(String s, String c) {
+ if (isPrimitive(c)) {
+ StringBuffer sb = new StringBuffer();
+ sb.append('(');
+ sb.append(s);
+ sb.append(").");
+ sb.append(c);
+ sb.append("Value()");
+ return sb.toString();
+ } else
+ return s;
+ }
+
+ public static String convertExpressionFromTypeToType(
+ String s,
+ String from,
+ String to)
+ throws Exception {
+ if (from.equals(to))
+ return s;
+ else {
+ if (!isPrimitive(to) && isPrimitive(from))
+ return getBoxedExpressionOfType(s, from);
+ else if (isPrimitive(to) && isPrimitive(from))
+ return getUnboxedExpressionOfType(s, to);
+ else
+ return s;
+ }
+ }
+
+ public static String getBoxedClassName(String className) {
+ if (isPrimitive(className)) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("java.lang.");
+ if (className.equals(int.class.getName()))
+ sb.append("Integer");
+ else if (className.equals(char.class.getName()))
+ sb.append("Character");
+ else {
+ sb.append(Character.toUpperCase(className.charAt(0)));
+ sb.append(className.substring(1));
+ }
+ return sb.toString();
+ } else
+ return className;
+ }
+
+ public static boolean isPrimitive(String className) {
+ return primitiveSet.contains(className);
+ }
+
+ static Set primitiveSet = null;
+
+ static {
+ primitiveSet = new HashSet();
+ primitiveSet.add("boolean");
+ primitiveSet.add("byte");
+ primitiveSet.add("double");
+ primitiveSet.add("float");
+ primitiveSet.add("int");
+ primitiveSet.add("long");
+ primitiveSet.add("short");
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/generator/SimpleToBoxedUtil.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AbstractType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AbstractType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AbstractType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,144 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+import org.jboss.com.sun.xml.ws.util.NullIterator;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public abstract class AbstractType {
+
+ protected AbstractType() {}
+
+ protected AbstractType(QName name) {
+ this(name, null, null);
+ }
+
+ protected AbstractType(QName name, String version) {
+ this(name, null, version);
+ }
+
+ protected AbstractType(QName name, JavaType javaType) {
+ this(name, javaType, null);
+ }
+
+ protected AbstractType(QName name, JavaType javaType, String version) {
+ this.name = name;
+ this.javaType = javaType;
+ this.version = version;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void setName(QName name) {
+ this.name = name;
+ }
+
+ public JavaType getJavaType() {
+ return javaType;
+ }
+
+ public void setJavaType(JavaType javaType) {
+ this.javaType = javaType;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ public boolean isNillable() {
+ return false;
+ }
+
+ public boolean isSOAPType() {
+ return false;
+ }
+
+ public boolean isLiteralType() {
+ return false;
+ }
+
+ public Object getProperty(String key) {
+ if (properties == null) {
+ return null;
+ }
+ return properties.get(key);
+ }
+
+ public void setProperty(String key, Object value) {
+ if (value == null) {
+ removeProperty(key);
+ return;
+ }
+
+ if (properties == null) {
+ properties = new HashMap();
+ }
+ properties.put(key, value);
+ }
+
+ public void removeProperty(String key) {
+ if (properties != null) {
+ properties.remove(key);
+ }
+ }
+
+ public Iterator getProperties() {
+ if (properties == null) {
+ return NullIterator.getInstance();
+ } else {
+ return properties.keySet().iterator();
+ }
+ }
+
+ /* serialization */
+ public Map getPropertiesMap() {
+ return properties;
+ }
+
+ /* serialization */
+ public void setPropertiesMap(Map m) {
+ properties = m;
+ }
+
+ private QName name;
+ private JavaType javaType;
+ private String version = null;
+ private Map properties;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AbstractType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperation.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperation.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperation.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,130 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaSimpleType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+
+import com.sun.codemodel.JClass;
+import com.sun.codemodel.JCodeModel;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ *
+ */
+public class AsyncOperation extends Operation {
+
+ /**
+ *
+ */
+ public AsyncOperation() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @param operation
+ */
+ public AsyncOperation(Operation operation) {
+ super(operation);
+ this.operation = operation;
+ }
+
+ /**
+ * @param name
+ */
+ public AsyncOperation(QName name) {
+ super(name);
+ // TODO Auto-generated constructor stub
+ }
+
+ /**
+ * @return Returns the async.
+ */
+ public boolean isAsync() {
+ return _async;
+ }
+
+ public void setAsyncType(AsyncOperationType type) {
+ this._asyncOpType = type;
+ _async = true;
+ }
+
+ public AsyncOperationType getAsyncType(){
+ return _asyncOpType;
+ }
+
+ public void setResponseBean(AbstractType type){
+ _responseBean = type;
+ }
+
+ public AbstractType getResponseBeanType(){
+ return _responseBean;
+ }
+
+ public JavaType getResponseBeanJavaType(){
+ JCodeModel cm = _responseBean.getJavaType().getType().getType().owner();
+ if(_asyncOpType.equals(AsyncOperationType.CALLBACK)){
+ JClass future = cm.ref(java.util.concurrent.Future.class).narrow(cm.ref(Object.class).wildcard());
+ return new JavaSimpleType(new JAXBTypeAndAnnotation(future));
+ }else if(_asyncOpType.equals(AsyncOperationType.POLLING)){
+ JClass polling = cm.ref(javax.xml.ws.Response.class).narrow(_responseBean.getJavaType().getType().getType().boxify());
+ return new JavaSimpleType(new JAXBTypeAndAnnotation(polling));
+ }
+ return null;
+ }
+
+ public JavaType getCallBackType(){
+ if(_asyncOpType.equals(AsyncOperationType.CALLBACK)){
+ JCodeModel cm = _responseBean.getJavaType().getType().getType().owner();
+ JClass cb = cm.ref(javax.xml.ws.AsyncHandler.class).narrow(_responseBean.getJavaType().getType().getType().boxify());
+ return new JavaSimpleType(new JAXBTypeAndAnnotation(cb));
+
+ }
+ return null;
+ }
+
+ public Operation getNormalOperation(){
+ return operation;
+ }
+
+ public void setNormalOperation(Operation operation){
+ this.operation = operation;
+ }
+
+ @Override public String getJavaMethodName() {
+ return super.getJavaMethodName() + "Async";
+ }
+
+ //Normal operation
+ private Operation operation;
+ private boolean _async;
+ private AsyncOperationType _asyncOpType;
+ private AbstractType _responseBean;
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperationType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperationType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperationType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,39 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model;
+
+
+
+/**
+ * @author Vivek Pandey
+ *
+ * Async Operation type
+ */
+public final class AsyncOperationType {
+
+ public static final AsyncOperationType POLLING = new AsyncOperationType();
+ public static final AsyncOperationType CALLBACK = new AsyncOperationType();
+
+ private AsyncOperationType() {
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/AsyncOperationType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Block.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Block.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Block.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,88 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import javax.xml.namespace.QName;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Block extends ModelObject {
+
+ public static final int UNBOUND = 0;
+ public static final int BODY = 1;
+ public static final int HEADER = 2;
+ public static final int ATTACHMENT = 3;
+
+ public Block() {}
+
+ public Block(QName name) {
+ this.name = name;
+ }
+
+ public Block(QName name, AbstractType type) {
+ this.name = name;
+ this.type = type;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void setName(QName n) {
+ name = n;
+ }
+
+ public AbstractType getType() {
+ return type;
+ }
+
+ public void setType(AbstractType type) {
+ this.type = type;
+ }
+
+ public int getLocation() {
+ return location;
+ }
+
+ public void setLocation(int i) {
+ location = i;
+ }
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ private QName name;
+ private AbstractType type;
+ private int location;
+
+ /**
+ * @return true if the block is unbound
+ */
+ public boolean isUnbound() {
+ if(location == UNBOUND)
+ return true;
+ return false;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Block.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ExtendedModelVisitor.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ExtendedModelVisitor.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ExtendedModelVisitor.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,134 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.Iterator;
+
+/**
+ *
+ * A model visitor incorporating all the logic required to walk through the model.
+ *
+ * @author WS Development Team
+ */
+public class ExtendedModelVisitor {
+
+ public ExtendedModelVisitor() {}
+
+ public void visit(Model model) throws Exception {
+ preVisit(model);
+ for (Service service : model.getServices()) {
+ preVisit(service);
+ for (Port port : service.getPorts()) {
+ preVisit(port);
+ if (shouldVisit(port)) {
+ for (Operation operation : port.getOperations()) {
+ preVisit(operation);
+ Request request = operation.getRequest();
+ if (request != null) {
+ preVisit(request);
+ for (Iterator iter4 = request.getHeaderBlocks();
+ iter4.hasNext();) {
+
+ Block block = (Block) iter4.next();
+ visitHeaderBlock(block);
+ }
+ for (Iterator iter4 = request.getBodyBlocks();
+ iter4.hasNext();) {
+
+ Block block = (Block) iter4.next();
+ visitBodyBlock(block);
+ }
+ for (Iterator iter4 = request.getParameters();
+ iter4.hasNext();) {
+
+ Parameter parameter = (Parameter) iter4.next();
+ visit(parameter);
+ }
+ postVisit(request);
+ }
+
+ Response response = operation.getResponse();
+ if (response != null) {
+ preVisit(response);
+ for (Iterator iter4 = response.getHeaderBlocks();
+ iter4.hasNext();) {
+
+ Block block = (Block) iter4.next();
+ visitHeaderBlock(block);
+ }
+ for (Iterator iter4 = response.getBodyBlocks();
+ iter4.hasNext();) {
+
+ Block block = (Block) iter4.next();
+ visitBodyBlock(block);
+ }
+ for (Iterator iter4 = response.getParameters();
+ iter4.hasNext();) {
+
+ Parameter parameter = (Parameter) iter4.next();
+ visit(parameter);
+ }
+ postVisit(response);
+ }
+
+ for (Iterator iter4 = operation.getFaults();
+ iter4.hasNext();) {
+
+ Fault fault = (Fault) iter4.next();
+ preVisit(fault);
+ visitFaultBlock(fault.getBlock());
+ postVisit(fault);
+ }
+ postVisit(operation);
+ }
+ }
+ postVisit(port);
+ }
+ postVisit(service);
+ }
+ postVisit(model);
+ }
+
+ protected boolean shouldVisit(Port port) {
+ return true;
+ }
+
+ // these methods are intended for subclasses
+ protected void preVisit(Model model) throws Exception {}
+ protected void postVisit(Model model) throws Exception {}
+ protected void preVisit(Service service) throws Exception {}
+ protected void postVisit(Service service) throws Exception {}
+ protected void preVisit(Port port) throws Exception {}
+ protected void postVisit(Port port) throws Exception {}
+ protected void preVisit(Operation operation) throws Exception {}
+ protected void postVisit(Operation operation) throws Exception {}
+ protected void preVisit(Request request) throws Exception {}
+ protected void postVisit(Request request) throws Exception {}
+ protected void preVisit(Response response) throws Exception {}
+ protected void postVisit(Response response) throws Exception {}
+ protected void preVisit(Fault fault) throws Exception {}
+ protected void postVisit(Fault fault) throws Exception {}
+ protected void visitBodyBlock(Block block) throws Exception {}
+ protected void visitHeaderBlock(Block block) throws Exception {}
+ protected void visitFaultBlock(Block block) throws Exception {}
+ protected void visit(Parameter parameter) throws Exception {}
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ExtendedModelVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Fault.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Fault.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Fault.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,188 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.TreeSet;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.generator.GeneratorUtil;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaException;
+
+import com.sun.codemodel.JClass;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Fault extends ModelObject {
+
+ public Fault() {}
+
+ public Fault(String name) {
+ this.name = name;
+ parentFault = null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String s) {
+ name = s;
+ }
+
+ public Block getBlock() {
+ return block;
+ }
+
+ public void setBlock(Block b) {
+ block = b;
+ }
+
+ public JavaException getJavaException() {
+ return javaException;
+ }
+
+ public void setJavaException(JavaException e) {
+ javaException = e;
+ }
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ public Fault getParentFault() {
+ return parentFault;
+ }
+
+ public void setParentFault(Fault parentFault) {
+ if (this.parentFault != null &&
+ parentFault != null &&
+ !this.parentFault.equals(parentFault)) {
+
+ throw new ModelException("model.parent.fault.already.set",
+ new Object[] {
+ getName(),
+ this.parentFault.getName(),
+ parentFault.getName()
+ });
+ }
+ this.parentFault = parentFault;
+ }
+
+ public void addSubfault(Fault fault) {
+ subfaults.add(fault);
+ fault.setParentFault(this);
+ }
+
+ public Iterator getSubfaults() {
+ if (subfaults.size() == 0) {
+ return null;
+ }
+ return subfaults.iterator();
+ }
+
+ public Iterator getSortedSubfaults() {
+ Set sortedFaults = new TreeSet(new GeneratorUtil.FaultComparator());
+ sortedFaults.addAll(subfaults);
+ return sortedFaults.iterator();
+ }
+
+ /* serialization */
+ public Set getSubfaultsSet() {
+ return subfaults;
+ }
+
+ /* serialization */
+ public void setSubfaultsSet(Set s) {
+ subfaults = s;
+ }
+
+ public Iterator getAllFaults() {
+ Set allFaults = getAllFaultsSet();
+ if (allFaults.size() == 0) {
+ return null;
+ }
+ return allFaults.iterator();
+ }
+
+ public Set getAllFaultsSet() {
+ Set transSet = new HashSet();
+ Iterator iter = subfaults.iterator();
+ while (iter.hasNext()) {
+ transSet.addAll(((Fault)iter.next()).getAllFaultsSet());
+ }
+ transSet.addAll(subfaults);
+ return transSet;
+ }
+
+ public QName getElementName() {
+ return elementName;
+ }
+
+ public void setElementName(QName elementName) {
+ this.elementName = elementName;
+ }
+
+ public String getJavaMemberName() {
+ return javaMemberName;
+ }
+
+ public void setJavaMemberName(String javaMemberName) {
+ this.javaMemberName = javaMemberName;
+ }
+
+ /**
+ * @return Returns the wsdlFault.
+ */
+ public boolean isWsdlException() {
+ return wsdlException;
+ }
+ /**
+ * @param wsdlFault The wsdlFault to set.
+ */
+ public void setWsdlException(boolean wsdlFault) {
+ this.wsdlException = wsdlFault;
+ }
+
+ public void setExceptionClass(JClass ex){
+ exceptionClass = ex;
+ }
+
+ public JClass getExceptionClass(){
+ return exceptionClass;
+ }
+
+ private boolean wsdlException = true;
+ private String name;
+ private Block block;
+ private JavaException javaException;
+ private Fault parentFault;
+ private Set subfaults = new HashSet();
+ private QName elementName = null;
+ private String javaMemberName = null;
+ private JClass exceptionClass;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Fault.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/HeaderFault.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/HeaderFault.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/HeaderFault.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,53 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import javax.xml.namespace.QName;
+
+public class HeaderFault extends Fault {
+
+ public HeaderFault() {}
+
+ public HeaderFault(String name) {
+ super(name);
+ }
+
+ public QName getMessage() {
+ return _message;
+ }
+
+ public void setMessage(QName message) {
+ _message = message;
+ }
+
+ public String getPart() {
+ return _part;
+ }
+
+ public void setPart(String part) {
+ _part = part;
+ }
+
+ private QName _message;
+ private String _part;
+}
+
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/HeaderFault.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Message.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Message.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Message.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,225 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public abstract class Message extends ModelObject {
+
+ public void addBodyBlock(Block b) {
+ if (_bodyBlocks.containsKey(b.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _bodyBlocks.put(b.getName(), b);
+ b.setLocation(Block.BODY);
+ }
+
+ public Iterator<Block> getBodyBlocks() {
+ return _bodyBlocks.values().iterator();
+ }
+
+ public int getBodyBlockCount() {
+ return _bodyBlocks.size();
+ }
+
+ /* serialization */
+ public Map<QName, Block> getBodyBlocksMap() {
+ return _bodyBlocks;
+ }
+
+ /* serialization */
+ public void setBodyBlocksMap(Map<QName, Block> m) {
+ _bodyBlocks = m;
+ }
+
+ public boolean isBodyEmpty() {
+ return getBodyBlocks().hasNext();
+ }
+
+ public boolean isBodyEncoded() {
+ boolean isEncoded = false;
+ for (Iterator iter = getBodyBlocks(); iter.hasNext();) {
+ Block bodyBlock = (Block) iter.next();
+ if (bodyBlock.getType().isSOAPType()) {
+ isEncoded = true;
+ }
+ }
+ return isEncoded;
+ }
+
+ public void addHeaderBlock(Block b) {
+ if (_headerBlocks.containsKey(b.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _headerBlocks.put(b.getName(), b);
+ b.setLocation(Block.HEADER);
+ }
+
+ public Iterator<Block> getHeaderBlocks() {
+ return _headerBlocks.values().iterator();
+ }
+
+ public Collection<Block> getHeaderBlockCollection() {
+ return _headerBlocks.values();
+ }
+
+ public int getHeaderBlockCount() {
+ return _headerBlocks.size();
+ }
+
+ /* serialization */
+ public Map<QName, Block> getHeaderBlocksMap() {
+ return _headerBlocks;
+ }
+
+ /* serialization */
+ public void setHeaderBlocksMap(Map<QName, Block> m) {
+ _headerBlocks = m;
+ }
+
+ /** attachment block */
+ public void addAttachmentBlock(Block b) {
+ if (_attachmentBlocks.containsKey(b.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _attachmentBlocks.put(b.getName(), b);
+ b.setLocation(Block.ATTACHMENT);
+ }
+
+ public void addUnboundBlock(Block b) {
+ if (_unboundBlocks.containsKey(b.getName())) {
+ return;
+ }
+ _unboundBlocks.put(b.getName(), b);
+ b.setLocation(Block.UNBOUND);
+ }
+
+ public Iterator<Block> getUnboundBlocks() {
+ return _unboundBlocks.values().iterator();
+ }
+
+ /* serialization */
+ public Map<QName, Block> getUnboundBlocksMap() {
+ return _unboundBlocks;
+ }
+
+ public int getUnboundBlocksCount() {
+ return _unboundBlocks.size();
+ }
+
+ /* serialization */
+ public void setUnboundBlocksMap(Map<QName, Block> m) {
+ _unboundBlocks = m;
+ }
+
+
+ public Iterator<Block> getAttachmentBlocks() {
+ return _attachmentBlocks.values().iterator();
+ }
+
+ public int getAttachmentBlockCount () {
+ return _attachmentBlocks.size();
+ }
+
+ /* serialization */
+ public Map<QName, Block> getAttachmentBlocksMap() {
+ return _attachmentBlocks;
+ }
+
+ /* serialization */
+ public void setAttachmentBlocksMap(Map<QName, Block> m) {
+ _attachmentBlocks = m;
+ }
+
+ public void addParameter(Parameter p) {
+ if (_parametersByName.containsKey(p.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _parameters.add(p);
+ _parametersByName.put(p.getName(), p);
+ }
+
+ public Parameter getParameterByName(String name) {
+ if (_parametersByName.size() != _parameters.size()) {
+ initializeParametersByName();
+ }
+ return (Parameter) _parametersByName.get(name);
+ }
+
+ public Iterator<Parameter> getParameters() {
+ return _parameters.iterator();
+ }
+
+ /* serialization */
+ public List<Parameter> getParametersList() {
+ return _parameters;
+ }
+
+ /* serialization */
+ public void setParametersList(List<Parameter> l) {
+ _parameters = l;
+ }
+
+ private void initializeParametersByName() {
+ _parametersByName = new HashMap();
+ if (_parameters != null) {
+ for (Iterator iter = _parameters.iterator(); iter.hasNext();) {
+ Parameter param = (Parameter) iter.next();
+ if (param.getName() != null &&
+ _parametersByName.containsKey(param.getName())) {
+
+ throw new ModelException("model.uniqueness");
+ }
+ _parametersByName.put(param.getName(), param);
+ }
+ }
+ }
+
+ public Set<Block> getAllBlocks(){
+ Set<Block> blocks = new HashSet<Block>();
+ blocks.addAll(_bodyBlocks.values());
+ blocks.addAll(_headerBlocks.values());
+ blocks.addAll(_attachmentBlocks.values());
+ return blocks;
+ }
+
+ private Map<QName, Block> _attachmentBlocks = new HashMap<QName, Block>();
+ private Map<QName, Block> _bodyBlocks = new HashMap<QName, Block>();
+ private Map<QName, Block> _headerBlocks = new HashMap<QName, Block>();
+ private Map<QName, Block> _unboundBlocks = new HashMap<QName, Block>();
+ private List<Parameter> _parameters = new ArrayList<Parameter>();
+ private Map<String, Parameter> _parametersByName = new HashMap<String, Parameter>();
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Message.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Model.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Model.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Model.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,187 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.EnumSet;
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorActionVersion;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBModel;
+
+
+/**
+ * The model is used to represent the entire Web Service. The JAX-WS ProcessorActions can process
+ * this Model to generate Java artifacts such as the service interface.
+ *
+ * @author WS Development Team
+ */
+public class Model extends ModelObject {
+
+ public Model() {
+ }
+
+ public Model(QName name) {
+ this.name = name;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void setName(QName n) {
+ name = n;
+ }
+
+ public String getTargetNamespaceURI() {
+ return targetNamespace;
+ }
+
+ public void setTargetNamespaceURI(String s) {
+ targetNamespace = s;
+ }
+
+ public void addService(Service service) {
+ if (servicesByName.containsKey(service.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ services.add(service);
+ servicesByName.put(service.getName(), service);
+ }
+
+ public Service getServiceByName(QName name) {
+ if (servicesByName.size() != services.size()) {
+ initializeServicesByName();
+ }
+ return (Service)servicesByName.get(name);
+ }
+
+ /* serialization */
+ public List<Service> getServices() {
+ return services;
+ }
+
+ /* serialization */
+ public void setServices(List<Service> l) {
+ services = l;
+ }
+
+ private void initializeServicesByName() {
+ servicesByName = new HashMap();
+ if (services != null) {
+ for (Service service : services) {
+ if (service.getName() != null &&
+ servicesByName.containsKey(service.getName())) {
+
+ throw new ModelException("model.uniqueness");
+ }
+ servicesByName.put(service.getName(), service);
+ }
+ }
+ }
+
+ public void addExtraType(AbstractType type) {
+ extraTypes.add(type);
+ }
+
+ public Iterator getExtraTypes() {
+ return extraTypes.iterator();
+ }
+
+ /* serialization */
+ public Set<AbstractType> getExtraTypesSet() {
+ return extraTypes;
+ }
+
+ /* serialization */
+ public void setExtraTypesSet(Set<AbstractType> s) {
+ extraTypes = s;
+ }
+
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ /**
+ * @return the source version
+ */
+ public String getSource() {
+ return source;
+ }
+
+ /**
+ * @param string
+ */
+ public void setSource(String string) {
+ source = string;
+ }
+
+ public ProcessorActionVersion getProcessorActionVersion(){
+ return processorActionVersion;
+ }
+
+ public void setProcessorActionVersion(ProcessorActionVersion version){
+ this.processorActionVersion = version;
+ }
+
+ public void setProcessorActionVersion(String version){
+ for(ProcessorActionVersion paVersion : EnumSet.allOf(ProcessorActionVersion.class)){
+ switch(paVersion){
+ case PRE_20:
+ if(version.equals(ProcessorActionVersion.PRE_20.toString()))
+ processorActionVersion = ProcessorActionVersion.PRE_20;
+ break;
+ case VERSION_20:
+ if(version.equals(ProcessorActionVersion.VERSION_20.toString()))
+ processorActionVersion = ProcessorActionVersion.VERSION_20;
+ break;
+ default:
+ throw new ModelException("model.invalid.processorActionVersion", new Object[]{version});
+ }
+ }
+ }
+
+ public void setJAXBModel(JAXBModel jaxBModel) {
+ this.jaxBModel = jaxBModel;
+ }
+
+ public JAXBModel getJAXBModel() {
+ return jaxBModel;
+ }
+
+ private QName name;
+ private String targetNamespace;
+ private List<Service> services = new ArrayList<Service>();
+ private Map<QName, Service> servicesByName = new HashMap<QName, Service>();
+ private Set<AbstractType> extraTypes = new HashSet<AbstractType>();
+ private String source;
+ private JAXBModel jaxBModel = null;
+ private ProcessorActionVersion processorActionVersion = ProcessorActionVersion.VERSION_20;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Model.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelException.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelException.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelException.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,54 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorException;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+
+/**
+ * ModelException represents an exception that occurred while
+ * visiting service model.
+ *
+ * @see ProcessorException
+ *
+ * @author WS Development Team
+ */
+public class ModelException extends ProcessorException {
+
+ public ModelException(String key, Object... args) {
+ super(key, args);
+ }
+
+ public ModelException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ModelException(Localizable arg) {
+ super("model.nestedModelError", arg);
+ }
+
+ public String getResourceBundleName() {
+ return "org.jboss.com.sun.tools.ws.resources.model";
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelObject.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelObject.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelObject.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,93 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.com.sun.xml.ws.util.NullIterator;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public abstract class ModelObject {
+
+ public abstract void accept(ModelVisitor visitor) throws Exception;
+
+ public Object getProperty(String key) {
+ if (_properties == null) {
+ return null;
+ }
+ return _properties.get(key);
+ }
+
+ public void setProperty(String key, Object value) {
+ if (value == null) {
+ removeProperty(key);
+ return;
+ }
+
+ if (_properties == null) {
+ _properties = new HashMap();
+ }
+ _properties.put(key, value);
+ }
+
+ public void removeProperty(String key) {
+ if (_properties != null) {
+ _properties.remove(key);
+ }
+ }
+
+ public Iterator getProperties() {
+ if (_properties == null) {
+ return NullIterator.getInstance();
+ } else {
+ return _properties.keySet().iterator();
+ }
+ }
+
+ /* serialization */
+ public Map getPropertiesMap() {
+ return _properties;
+ }
+
+ /* serialization */
+ public void setPropertiesMap(Map m) {
+ _properties = m;
+ }
+
+ public String getJavaDoc() {
+ return javaDoc;
+ }
+
+ public void setJavaDoc(String javaDoc) {
+ this.javaDoc = javaDoc;
+ }
+
+ private String javaDoc;
+ private Map _properties;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelProperties.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelProperties.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelProperties.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,73 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public interface ModelProperties {
+
+ //to set WSDL_MODELER_NAME from inside WSDLModeler
+ public static final String WSDL_MODELER_NAME =
+ "org.jboss.com.sun.xml.ws.processor.modeler.wsdl.WSDLModeler";
+ public static final String PROPERTY_PARAM_MESSAGE_PART_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.ParamMessagePartName";
+ public static final String PROPERTY_ANONYMOUS_TYPE_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.AnonymousTypeName";
+ public static final String PROPERTY_ANONYMOUS_ARRAY_TYPE_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.AnonymousArrayTypeName";
+ public static final String PROPERTY_ANONYMOUS_ARRAY_JAVA_TYPE =
+ "org.jboss.com.sun.xml.ws.processor.model.AnonymousArrayJavaType";
+
+ public static final String PROPERTY_PTIE_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.PtieClassName";
+ public static final String PROPERTY_EPTFF_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.EPTFFClassName";
+ public static final String PROPERTY_SED_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.SEDClassName";
+ public static final String PROPERTY_WSDL_PORT_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.WSDLPortName";
+ public static final String PROPERTY_WSDL_PORT_TYPE_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.WSDLPortTypeName";
+ public static final String PROPERTY_WSDL_BINDING_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.WSDLBindingName";
+ public static final String PROPERTY_WSDL_MESSAGE_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.WSDLMessageName";
+ public static final String PROPERTY_MODELER_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.ModelerName";
+ public static final String PROPERTY_STUB_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.StubClassName";
+ public static final String PROPERTY_STUB_OLD_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.StubOldClassName";
+ public static final String PROPERTY_DELEGATE_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.DelegateClassName";
+ public static final String PROPERTY_CLIENT_ENCODER_DECODER_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.ClientEncoderClassName";
+ public static final String PROPERTY_CLIENT_CONTACTINFOLIST_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.ClientContactInfoListClassName";
+ public static final String PROPERTY_TIE_CLASS_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.TieClassName";
+ public static final String PROPERTY_JAVA_PORT_NAME =
+ "org.jboss.com.sun.xml.ws.processor.model.JavaPortName";
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelProperties.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelVisitor.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelVisitor.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelVisitor.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,39 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public interface ModelVisitor {
+ public void visit(Model model) throws Exception;
+ public void visit(Service service) throws Exception;
+ public void visit(Port port) throws Exception;
+ public void visit(Operation operation) throws Exception;
+ public void visit(Request request) throws Exception;
+ public void visit(Response response) throws Exception;
+ public void visit(Fault fault) throws Exception;
+ public void visit(Block block) throws Exception;
+ public void visit(Parameter parameter) throws Exception;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/ModelVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Operation.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Operation.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Operation.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,241 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import com.sun.xml.bind.api.JAXBRIContext;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaMethod;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPStyle;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPUse;
+
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Operation extends ModelObject {
+
+ public Operation() {}
+
+ public Operation(Operation operation){
+ this(operation._name);
+ this._style = operation._style;
+ this._use = operation._use;
+ this.customizedName = operation.customizedName;
+ }
+ public Operation(QName name) {
+ _name = name;
+ _uniqueName = name.getLocalPart();
+ _faultNames = new HashSet<String>();
+ _faults = new HashSet<Fault>();
+ }
+
+ public QName getName() {
+ return _name;
+ }
+
+ public void setName(QName n) {
+ _name = n;
+ }
+
+ public String getUniqueName() {
+ return _uniqueName;
+ }
+
+ public void setUniqueName(String s) {
+ _uniqueName = s;
+ }
+
+ public Request getRequest() {
+ return _request;
+ }
+
+ public void setRequest(Request r) {
+ _request = r;
+ }
+
+ public Response getResponse() {
+ return _response;
+ }
+
+ public void setResponse(Response r) {
+ _response = r;
+ }
+
+ public boolean isOverloaded() {
+ return !_name.getLocalPart().equals(_uniqueName);
+ }
+
+ public void addFault(Fault f) {
+ if (_faultNames.contains(f.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _faultNames.add(f.getName());
+ _faults.add(f);
+ }
+
+ public Iterator<Fault> getFaults() {
+ return _faults.iterator();
+ }
+
+ public Set<Fault> getFaultsSet() {
+ return _faults;
+ }
+
+ /* serialization */
+ public void setFaultsSet(Set<Fault> s) {
+ _faults = s;
+ initializeFaultNames();
+ }
+
+ private void initializeFaultNames() {
+ _faultNames = new HashSet<String>();
+ if (_faults != null) {
+ for (Iterator iter = _faults.iterator(); iter.hasNext();) {
+ Fault f = (Fault) iter.next();
+ if (f.getName() != null && _faultNames.contains(f.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _faultNames.add(f.getName());
+ }
+ }
+ }
+
+ public Iterator<Fault> getAllFaults() {
+ Set<Fault> allFaults = getAllFaultsSet();
+ return allFaults.iterator();
+ }
+
+ public Set<Fault> getAllFaultsSet() {
+ Set transSet = new HashSet();
+ transSet.addAll(_faults);
+ Iterator iter = _faults.iterator();
+ Fault fault;
+ Set tmpSet;
+ while (iter.hasNext()) {
+ tmpSet = ((Fault)iter.next()).getAllFaultsSet();
+ transSet.addAll(tmpSet);
+ }
+ return transSet;
+ }
+
+ public int getFaultCount() {
+ return _faults.size();
+ }
+
+ public Set<Block> getAllFaultBlocks(){
+ Set<Block> blocks = new HashSet<Block>();
+ Iterator faults = _faults.iterator();
+ while(faults.hasNext()){
+ Fault f = (Fault)faults.next();
+ blocks.add(f.getBlock());
+ }
+ return blocks;
+ }
+
+ public JavaMethod getJavaMethod() {
+ return _javaMethod;
+ }
+
+ public void setJavaMethod(JavaMethod i) {
+ _javaMethod = i;
+ }
+
+ public String getSOAPAction() {
+ return _soapAction;
+ }
+
+ public void setSOAPAction(String s) {
+ _soapAction = s;
+ }
+
+ public SOAPStyle getStyle() {
+ return _style;
+ }
+
+ public void setStyle(SOAPStyle s) {
+ _style = s;
+ }
+
+ public SOAPUse getUse() {
+ return _use;
+ }
+
+ public void setUse(SOAPUse u) {
+ _use = u;
+ }
+
+ public boolean isWrapped() {
+ return _isWrapped;
+ }
+
+ public void setWrapped(boolean isWrapped) {
+ _isWrapped = isWrapped;
+ }
+
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ public void setCustomizedName(String name){
+ this.customizedName = name;
+ }
+
+ public String getCustomizedName(){
+ return customizedName;
+ }
+
+ public String getJavaMethodName(){
+ //if JavaMethod is created return the name
+ if(_javaMethod != null){
+ return _javaMethod.getName();
+ }
+
+ //return the customized operation name if any without mangling
+ if(customizedName != null){
+ return customizedName;
+ }
+
+ return JAXBRIContext.mangleNameToVariableName(_name.getLocalPart());
+ }
+
+ private String customizedName;
+ private boolean _isWrapped = true;
+ private QName _name;
+ private String _uniqueName;
+ private Request _request;
+ private Response _response;
+ private JavaMethod _javaMethod;
+ private String _soapAction;
+ private SOAPStyle _style = SOAPStyle.DOCUMENT;
+ private SOAPUse _use = SOAPUse.LITERAL;
+ private Set<String> _faultNames;
+ private Set<Fault> _faults;
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Operation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Parameter.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Parameter.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Parameter.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,176 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaParameter;
+import org.jboss.com.sun.xml.ws.model.Mode;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Parameter extends ModelObject {
+
+ public Parameter() {}
+
+ public Parameter(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String s) {
+ name = s;
+ }
+
+ public JavaParameter getJavaParameter() {
+ return javaParameter;
+ }
+
+ public void setJavaParameter(JavaParameter p) {
+ javaParameter = p;
+ }
+
+ public AbstractType getType() {
+ return type;
+ }
+
+ public void setType(AbstractType t) {
+ type = t;
+ }
+
+ public String getTypeName() {
+ return typeName;
+ }
+
+ public void setTypeName(String t) {
+ typeName = t;
+ }
+
+ public Block getBlock() {
+ return block;
+ }
+
+ public void setBlock(Block d) {
+ block = d;
+ }
+
+ public Parameter getLinkedParameter() {
+ return link;
+ }
+
+ public void setLinkedParameter(Parameter p) {
+ link = p;
+ }
+
+ public boolean isEmbedded() {
+ return embedded;
+ }
+
+ public void setEmbedded(boolean b) {
+ embedded = b;
+ }
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ private String name;
+ private JavaParameter javaParameter;
+ private AbstractType type;
+ private Block block;
+ private Parameter link;
+ private boolean embedded;
+ private String typeName;
+ private String customName;
+ private Mode mode;
+
+ public int getParameterIndex() {
+ return parameterOrderPosition;
+ }
+
+ public void setParameterIndex(int parameterOrderPosition) {
+ this.parameterOrderPosition = parameterOrderPosition;
+ }
+
+ public boolean isReturn(){
+ return (parameterOrderPosition == -1);
+ }
+
+ // 0 is the first parameter, -1 is the return type
+ private int parameterOrderPosition;
+ /**
+ * @return Returns the customName.
+ */
+ public String getCustomName() {
+ return customName;
+ }
+ /**
+ * @param customName The customName to set.
+ */
+ public void setCustomName(String customName) {
+ this.customName = customName;
+ }
+
+ private List<String> annotations = new ArrayList<String>();
+
+ /**
+ * @return Returns the annotations.
+ */
+ public List<String> getAnnotations() {
+ return annotations;
+ }
+
+
+ /**
+ * @param annotations The annotations to set.
+ */
+ public void setAnnotations(List<String> annotations) {
+ this.annotations = annotations;
+ }
+
+ public void setMode(Mode mode){
+ this.mode = mode;
+ }
+
+ public boolean isIN(){
+ return (mode == Mode.IN);
+ }
+
+ public boolean isOUT(){
+ return (mode == Mode.OUT);
+ }
+
+ public boolean isINOUT(){
+ return (mode == Mode.INOUT);
+ }
+
+
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Parameter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Port.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Port.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Port.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,208 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.config.HandlerChainInfo;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPStyle;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPUse;
+import org.jboss.com.sun.xml.ws.encoding.soap.SOAPVersion;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Port extends ModelObject {
+
+ public Port() {}
+
+ public Port(QName name) {
+ _name = name;
+ }
+
+ public QName getName() {
+ return _name;
+ }
+
+ public void setName(QName n) {
+ _name = n;
+ }
+
+ public void addOperation(Operation operation) {
+ _operations.add(operation);
+ operationsByName.put(operation.getUniqueName(), operation);
+ }
+
+ public Operation getOperationByUniqueName(String name) {
+ if (operationsByName.size() != _operations.size()) {
+ initializeOperationsByName();
+ }
+ return (Operation)operationsByName.get(name);
+ }
+
+ private void initializeOperationsByName() {
+ operationsByName = new HashMap();
+ if (_operations != null) {
+ for (Operation operation : _operations) {
+ if (operation.getUniqueName() != null &&
+ operationsByName.containsKey(operation.getUniqueName())) {
+
+ throw new ModelException("model.uniqueness");
+ }
+ operationsByName.put(operation.getUniqueName(), operation);
+ }
+ }
+ }
+
+ /* serialization */
+ public List<Operation> getOperations() {
+ return _operations;
+ }
+
+ /* serialization */
+ public void setOperations(List<Operation> l) {
+ _operations = l;
+ }
+
+ public JavaInterface getJavaInterface() {
+ return _javaInterface;
+ }
+
+ public void setJavaInterface(JavaInterface i) {
+ _javaInterface = i;
+ }
+
+ public String getAddress() {
+ return _address;
+ }
+
+ public void setAddress(String s) {
+ _address = s;
+ }
+
+ public HandlerChainInfo getClientHandlerChainInfo() {
+ if (_clientHandlerChainInfo == null) {
+ _clientHandlerChainInfo = new HandlerChainInfo();
+ }
+ return _clientHandlerChainInfo;
+ }
+
+ public void setClientHandlerChainInfo(HandlerChainInfo i) {
+ _clientHandlerChainInfo = i;
+ }
+
+ public HandlerChainInfo getServerHandlerChainInfo() {
+ if (_serverHandlerChainInfo == null) {
+ _serverHandlerChainInfo = new HandlerChainInfo();
+ }
+ return _serverHandlerChainInfo;
+ }
+
+ public void setServerHandlerChainInfo(HandlerChainInfo i) {
+ _serverHandlerChainInfo = i;
+ }
+
+ public SOAPVersion getSOAPVersion() {
+ return _soapVersion;
+ }
+
+ public void setSOAPVersion(SOAPVersion soapVersion) {
+ _soapVersion = soapVersion;
+ }
+
+ public String getServiceImplName() {
+ return _serviceImplName;
+ }
+
+ public void setServiceImplName(String name) {
+ _serviceImplName = name;
+ }
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ public boolean isProvider() {
+ JavaInterface intf = getJavaInterface();
+ if (intf != null) {
+ String sei = intf.getName();
+ if (sei.equals(javax.xml.ws.Provider.class.getName())) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * XYZ_Service.getABC() method name
+ * @return Returns the portGetterName.
+ */
+ public String getPortGetter() {
+ return portGetter;
+ }
+
+ /**
+ * @param portGetterName The portGetterName to set.
+ */
+ public void setPortGetter(String portGetterName) {
+ this.portGetter = portGetterName;
+ }
+
+ public SOAPStyle getStyle() {
+ return _style;
+ }
+
+ public void setStyle(SOAPStyle s) {
+ _style = s;
+ }
+
+ public boolean isWrapped() {
+ return _isWrapped;
+ }
+
+ public void setWrapped(boolean isWrapped) {
+ _isWrapped = isWrapped;
+ }
+
+ private SOAPStyle _style = null;
+ private boolean _isWrapped = true;
+
+ private String portGetter;
+ private QName _name;
+ private List<Operation> _operations = new ArrayList();
+ private JavaInterface _javaInterface;
+ private String _address;
+ private String _serviceImplName;
+ private Map operationsByName = new HashMap();
+ private HandlerChainInfo _clientHandlerChainInfo;
+ private HandlerChainInfo _serverHandlerChainInfo;
+ private SOAPVersion _soapVersion = SOAPVersion.SOAP_11;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Port.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Request.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Request.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Request.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,36 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Request extends Message {
+
+ public Request() {}
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Request.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Response.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Response.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Response.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,66 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Response extends Message {
+
+ public Response() {}
+
+ public void addFaultBlock(Block b) {
+ if (_faultBlocks.containsKey(b.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _faultBlocks.put(b.getName(), b);
+ }
+
+ public Iterator getFaultBlocks() {
+ return _faultBlocks.values().iterator();
+ }
+
+ public int getFaultBlockCount () {
+ return _faultBlocks.size();
+ }
+
+ /* serialization */
+ public Map getFaultBlocksMap() {
+ return _faultBlocks;
+ }
+
+ public void setFaultBlocksMap(Map m) {
+ _faultBlocks = m;
+ }
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ private Map _faultBlocks = new HashMap();
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Response.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Service.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Service.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Service.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,119 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model;
+
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class Service extends ModelObject {
+
+ public Service() {}
+
+ public Service(QName name, JavaInterface javaInterface) {
+ this.name = name;
+ this.javaInterface = javaInterface;
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void setName(QName n) {
+ name = n;
+ }
+
+ public void addPort(Port port) {
+ if (portsByName.containsKey(port.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ ports.add(port);
+ portsByName.put(port.getName(), port);
+ }
+
+
+ public Port getPortByName(QName n) {
+ if (portsByName.size() != ports.size()) {
+ initializePortsByName();
+ }
+ return (Port) portsByName.get(n);
+ }
+
+ /* serialization */
+ public List<Port> getPorts() {
+ return ports;
+ }
+
+ /* serialization */
+ public void setPorts(List<Port> m) {
+ ports = m;
+// initializePortsByName();
+ }
+
+ private void initializePortsByName() {
+ portsByName = new HashMap();
+ if (ports != null) {
+ for (Iterator iter = ports.iterator(); iter.hasNext();) {
+ Port port = (Port) iter.next();
+ if (port.getName() != null &&
+ portsByName.containsKey(port.getName())) {
+
+ throw new ModelException("model.uniqueness");
+ }
+ portsByName.put(port.getName(), port);
+ }
+ }
+ }
+
+ public JavaInterface getJavaIntf() {
+ return getJavaInterface();
+ }
+
+ public JavaInterface getJavaInterface() {
+ return javaInterface;
+ }
+
+ public void setJavaInterface(JavaInterface i) {
+ javaInterface = i;
+ }
+
+ public void accept(ModelVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ private QName name;
+ private List<Port> ports = new ArrayList();
+ private Map<QName, Port> portsByName = new HashMap<QName, Port>();
+ private JavaInterface javaInterface;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/Service.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/exporter/ExternalObject.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/exporter/ExternalObject.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/exporter/ExternalObject.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,44 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.exporter;
+
+import org.xml.sax.ContentHandler;
+
+/**
+ * "Opaque" object in the object graph that knows how
+ * to persist itself to XML.
+ *
+ * TODO: ExternalObjectReader
+ *
+ */
+public interface ExternalObject {
+ /**
+ * Type name of this object. This will be used
+ * when loading the object back from XML.
+ */
+ String getType();
+
+ /**
+ * Saves the object into XML.
+ */
+ void saveTo(ContentHandler receiver);
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/exporter/ExternalObject.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaArrayType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaArrayType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaArrayType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,74 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaArrayType extends JavaType {
+
+ public JavaArrayType() {
+ }
+
+ public JavaArrayType(String name) {
+ super(name, true, "null");
+ }
+
+ public JavaArrayType(String name, String elementName,
+ JavaType elementType) {
+
+ super(name, true, "null");
+ this.elementName = elementName;
+ this.elementType = elementType;
+ }
+
+ public String getElementName() {
+ return elementName;
+ }
+
+ public void setElementName(String name) {
+ elementName = name;
+ }
+
+ public JavaType getElementType() {
+ return elementType;
+ }
+
+ public void setElementType(JavaType type) {
+ elementType = type;
+ }
+
+ // bug fix:4904604
+ public String getSOAPArrayHolderName() {
+ return soapArrayHolderName;
+ }
+
+ public void setSOAPArrayHolderName(String holderName) {
+ this.soapArrayHolderName = holderName;
+ }
+
+ private String elementName;
+ private JavaType elementType;
+ private String soapArrayHolderName;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaArrayType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaException.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaException.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaException.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,36 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaException extends JavaStructureType {
+
+ public JavaException() {}
+
+ public JavaException(String name, boolean present, Object owner) {
+ super(name, present, owner);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaInterface.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaInterface.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaInterface.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,165 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.com.sun.tools.ws.processor.model.ModelException;
+import org.jboss.com.sun.tools.ws.util.ClassNameInfo;
+
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaInterface {
+
+ public JavaInterface() {}
+
+ public JavaInterface(String name) {
+ this(name, null);
+ }
+
+ public JavaInterface(String name, String impl) {
+ this.realName = name;
+ this.name = name.replace('$', '.');
+ this.impl = impl;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getFormalName() {
+ return name;
+ }
+
+ public void setFormalName(String s) {
+ name = s;
+ }
+
+ public String getRealName() {
+ return realName;
+ }
+
+ public void setRealName(String s) {
+ realName = s;
+ }
+
+ public String getImpl() {
+ return impl;
+ }
+
+ public void setImpl(String s) {
+ impl = s;
+ }
+
+ public Iterator getMethods() {
+ return methods.iterator();
+ }
+
+ public boolean hasMethod(JavaMethod method) {
+ for (int i=0; i<methods.size();i++) {
+ if (method.equals(((JavaMethod)methods.get(i)))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void addMethod(JavaMethod method) {
+
+ if (hasMethod(method)) {
+ throw new ModelException("model.uniqueness");
+ }
+ methods.add(method);
+ }
+
+ /* serialization */
+ public List getMethodsList() {
+ return methods;
+ }
+
+ /* serialization */
+ public void setMethodsList(List l) {
+ methods = l;
+ }
+
+ public boolean hasInterface(String interfaceName) {
+ for (int i=0; i<interfaces.size();i++) {
+ if (interfaceName.equals((String)interfaces.get(i))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void addInterface(String interfaceName) {
+
+ // verify that an exception with this name does not already exist
+ if (hasInterface(interfaceName)) {
+ return;
+ }
+ interfaces.add(interfaceName);
+ }
+
+ public Iterator getInterfaces() {
+ return interfaces.iterator();
+ }
+
+ /* serialization */
+ public List getInterfacesList() {
+ return interfaces;
+ }
+
+ /* serialization */
+ public void setInterfacesList(List l) {
+ interfaces = l;
+ }
+
+ public String getSimpleName() {
+ return ClassNameInfo.getName(name);
+ }
+
+ /* NOTE - all these fields (except "interfaces") were final, but had to
+ * remove this modifier to enable serialization
+ */
+ private String javadoc;
+
+ public String getJavaDoc() {
+ return javadoc;
+ }
+
+ public void setJavaDoc(String javadoc) {
+ this.javadoc = javadoc;
+ }
+
+ private String name;
+ private String realName;
+ private String impl;
+ private List methods = new ArrayList();
+ private List interfaces = new ArrayList();
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaInterface.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaMethod.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaMethod.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaMethod.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,167 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.jboss.com.sun.tools.ws.processor.model.ModelException;
+
+import com.sun.codemodel.JClass;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaMethod {
+
+ public JavaMethod() {}
+
+ public JavaMethod(String name) {
+ this.name = name;
+ this.returnType = null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public JavaType getReturnType() {
+ return returnType;
+ }
+
+ public void setReturnType(JavaType returnType) {
+ this.returnType = returnType;
+ }
+
+ public boolean hasParameter(String paramName) {
+ for (int i=0; i<parameters.size();i++) {
+ if (paramName.equals(
+ ((JavaParameter)parameters.get(i)).getName())) {
+
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public void addParameter(JavaParameter param) {
+ // verify that this member does not already exist
+ if (hasParameter(param.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ parameters.add(param);
+ }
+
+ public JavaParameter getParameter(String paramName){
+ for (int i=0; i<parameters.size();i++) {
+ JavaParameter jParam = parameters.get(i);
+ if (paramName.equals(jParam.getParameter().getName())) {
+ return jParam;
+ }
+ }
+ return null;
+ }
+
+ public Iterator<JavaParameter> getParameters() {
+ return parameters.iterator();
+ }
+
+ public int getParameterCount() {
+ return parameters.size();
+ }
+
+ /* serialization */
+ public List<JavaParameter> getParametersList() {
+ return parameters;
+ }
+
+ /* serialization */
+ public void setParametersList(List<JavaParameter> l) {
+ parameters = l;
+ }
+
+ public boolean hasException(String exception) {
+ return exceptions.contains(exception);
+ }
+
+ public void addException(String exception) {
+
+ // verify that this exception does not already exist
+ if (hasException(exception)) {
+ throw new ModelException("model.uniqueness");
+ }
+ exceptions.add(exception);
+ }
+
+ public Iterator getExceptions() {
+ return exceptions.iterator();
+ }
+
+ /* serialization */
+ public List getExceptionsList() {
+ return exceptions;
+ }
+
+ /* serialization */
+ public void setExceptionsList(List l) {
+ exceptions = l;
+ }
+
+ public String getDeclaringClass() {
+ return declaringClass;
+ }
+ public void setDeclaringClass(String declaringClass) {
+ this.declaringClass = declaringClass;
+ }
+
+ // TODO fix model importer/exporter to handle this
+ public boolean getThrowsRemoteException() {
+ return throwsRemoteException;
+ }
+ public void setThrowsRemoteException(boolean throwsRemoteException) {
+ this.throwsRemoteException = throwsRemoteException;
+ }
+
+ public void addExceptionClass(JClass ex){
+ exceptionClasses.add(ex);
+ }
+
+ public List<JClass> getExceptionClasses(){
+ return exceptionClasses;
+ }
+
+ private String name;
+ private List<JavaParameter> parameters = new ArrayList<JavaParameter>();
+ private List<String> exceptions = new ArrayList<String>();
+ private List<JClass> exceptionClasses = new ArrayList<JClass>();
+
+ private JavaType returnType;
+ private String declaringClass;
+ private boolean throwsRemoteException = true;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaMethod.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaParameter.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaParameter.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaParameter.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,93 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+import org.jboss.com.sun.tools.ws.processor.model.Parameter;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaParameter {
+
+ public JavaParameter() {}
+
+ public JavaParameter(String name, JavaType type, Parameter parameter) {
+ this(name, type, parameter, false);
+ }
+
+ public JavaParameter(String name, JavaType type, Parameter parameter,
+ boolean holder) {
+
+ this.name = name;
+ this.type = type;
+ this.parameter = parameter;
+ this.holder = holder;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String s) {
+ name = s;
+ }
+
+ public JavaType getType() {
+ return type;
+ }
+
+ public void setType(JavaType t) {
+ type = t;
+ }
+
+ public Parameter getParameter() {
+ return parameter;
+ }
+
+ public void setParameter(Parameter p) {
+ parameter = p;
+ }
+
+ public boolean isHolder() {
+ return holder;
+ }
+
+ public void setHolder(boolean b) {
+ holder = b;
+ }
+
+ public String getHolderName() {
+ return holderName;
+ }
+
+ public void setHolderName(String holderName) {
+ this.holderName = holderName;
+ }
+
+ private String name;
+ private JavaType type;
+ private Parameter parameter;
+ private boolean holder;
+ private String holderName;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaParameter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaSimpleType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaSimpleType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaSimpleType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,46 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+
+import com.sun.codemodel.JType;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaSimpleType extends JavaType {
+
+ public JavaSimpleType() {}
+
+ public JavaSimpleType(String name, String initString) {
+ super(name, true, initString);
+ }
+
+ public JavaSimpleType(JAXBTypeAndAnnotation jtype) {
+ super(jtype);
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaSimpleType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureMember.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureMember.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureMember.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,126 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaStructureMember {
+
+ public JavaStructureMember() {}
+
+ public JavaStructureMember(String name, JavaType type, Object owner) {
+ this(name, type, owner, false);
+ }
+ public JavaStructureMember(String name, JavaType type,
+ Object owner, boolean isPublic) {
+
+ this.name = name;
+ this.type = type;
+ this.owner = owner;
+ this.isPublic = isPublic;
+ constructorPos = -1;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String s) {
+ name = s;
+ }
+
+ public JavaType getType() {
+ return type;
+ }
+
+ public void setType(JavaType t) {
+ type = t;
+ }
+
+ public boolean isPublic() {
+ return isPublic;
+ }
+
+ public void setPublic(boolean b) {
+ isPublic = b;
+ }
+
+ public boolean isInherited() {
+ return isInherited;
+ }
+
+ public void setInherited(boolean b) {
+ isInherited = b;
+ }
+
+ public String getReadMethod() {
+ return readMethod;
+ }
+
+ public void setReadMethod(String readMethod) {
+ this.readMethod = readMethod;
+ }
+
+ public String getWriteMethod() {
+ return writeMethod;
+ }
+
+ public void setWriteMethod(String writeMethod) {
+ this.writeMethod = writeMethod;
+ }
+
+ public String getDeclaringClass() {
+ return declaringClass;
+ }
+ public void setDeclaringClass(String declaringClass) {
+ this.declaringClass = declaringClass;
+ }
+
+ public Object getOwner() {
+ return owner;
+ }
+
+ public void setOwner(Object owner) {
+ this.owner = owner;
+ }
+
+ public int getConstructorPos() {
+ return constructorPos;
+ }
+
+ public void setConstructorPos(int idx) {
+ constructorPos = idx;
+ }
+
+ private String name;
+ private JavaType type;
+ private boolean isPublic = false;
+ private boolean isInherited = false;
+ private String readMethod;
+ private String writeMethod;
+ private String declaringClass;
+ private Object owner;
+ private int constructorPos;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureMember.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,179 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.com.sun.tools.ws.processor.model.ModelException;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaStructureType extends JavaType {
+
+ public JavaStructureType() {}
+
+ public JavaStructureType(String name, boolean present, Object owner) {
+ super(name, present, "null");
+ this.owner = owner;
+ }
+
+ public void add(JavaStructureMember m) {
+ if (membersByName.containsKey(m.getName())) {
+ throw new ModelException("model.uniqueness.javastructuretype",
+ new Object[] {m.getName(), getRealName()});
+ }
+ members.add(m);
+ membersByName.put(m.getName(), m);
+ }
+
+
+ public JavaStructureMember getMemberByName(String name) {
+ if (membersByName.size() != members.size()) {
+ initializeMembersByName();
+ }
+ return membersByName.get(name);
+ }
+
+ public Iterator getMembers() {
+ return members.iterator();
+ }
+
+ public int getMembersCount() {
+ return members.size();
+ }
+
+ /* serialization */
+ public List<JavaStructureMember> getMembersList() {
+ return members;
+ }
+
+ /* serialization */
+ public void setMembersList(List<JavaStructureMember> l) {
+ members = l;
+ }
+
+ private void initializeMembersByName() {
+ membersByName = new HashMap<String, JavaStructureMember>();
+ if (members != null) {
+ for (JavaStructureMember m : members) {
+ if (m.getName() != null &&
+ membersByName.containsKey(m.getName())) {
+
+ throw new ModelException("model.uniqueness");
+ }
+ membersByName.put(m.getName(), m);
+ }
+ }
+ }
+
+ public boolean isAbstract() {
+ return isAbstract;
+ }
+
+ public void setAbstract(boolean isAbstract) {
+ this.isAbstract = isAbstract;
+ }
+
+ public JavaStructureType getSuperclass() {
+ return superclass;
+ }
+
+ public void setSuperclass(JavaStructureType superclassType) {
+ superclass = superclassType;
+ }
+
+ public void addSubclass(JavaStructureType subclassType) {
+ subclasses.add(subclassType);
+ subclassType.setSuperclass(this);
+ }
+
+ public Iterator getSubclasses() {
+ if (subclasses == null || subclasses.size() == 0) {
+ return null;
+ }
+ return subclasses.iterator();
+ }
+
+ public Set getSubclassesSet() {
+ return subclasses;
+ }
+
+ /* serialization */
+ public void setSubclassesSet(Set s) {
+ subclasses = s;
+ for (Iterator iter = s.iterator(); iter.hasNext();) {
+ ((JavaStructureType) iter.next()).setSuperclass(this);
+ }
+ }
+
+ public Iterator getAllSubclasses() {
+ Set subs = getAllSubclassesSet();
+ if (subs.size() == 0) {
+ return null;
+ }
+ return subs.iterator();
+ }
+
+ public Set getAllSubclassesSet() {
+ Set transitiveSet = new HashSet();
+ Iterator subs = subclasses.iterator();
+ while (subs.hasNext()) {
+ transitiveSet.addAll(
+ ((JavaStructureType)subs.next()).getAllSubclassesSet());
+ }
+ transitiveSet.addAll(subclasses);
+ return transitiveSet;
+ }
+
+ public Object getOwner() {
+
+ // usually a SOAPStructureType
+ return owner;
+ }
+
+ public void setOwner(Object owner) {
+
+ // usually a SOAPStructureType
+ this.owner = owner;
+ }
+
+ private List<JavaStructureMember> members = new ArrayList();
+ private Map<String, JavaStructureMember> membersByName = new HashMap();
+
+ // known subclasses of this type
+ private Set subclasses = new HashSet();
+ private JavaStructureType superclass;
+
+ // usually a SOAPStructureType
+ private Object owner;
+ private boolean isAbstract = false;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaStructureType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,145 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.model.java;
+
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+
+import com.sun.codemodel.JType;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public abstract class JavaType {
+
+ private String name;
+ private String realName;
+ private boolean present;
+ private boolean holder;
+ private boolean holderPresent;
+ private String initString;
+ private String holderName;
+ private JAXBTypeAndAnnotation type;
+
+ public JavaType() {}
+
+ public JavaType(JAXBTypeAndAnnotation type){
+ this.type = type;
+ init(type.getName(), false, null, null);
+ }
+
+ public JavaType(String name, boolean present, String initString) {
+ init(name, present, initString, null);
+ }
+
+ public JavaType(String name, boolean present, String initString,
+ String holderName) {
+
+ init(name, present, initString, holderName);
+ }
+
+ public JAXBTypeAndAnnotation getType(){
+ return type;
+ }
+
+ private void init(String name, boolean present, String initString,
+ String holderName) {
+
+ this.realName = name;
+ this.name = name.replace('$', '.');
+ this.present = present;
+ this.initString = initString;
+ this.holderName = holderName;
+ holder = holderName != null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void doSetName(String name) {
+
+ // renamed to avoid creating a "name" property with broken semantics
+ this.realName = name;
+ this.name = name.replace('$', '.');
+ }
+
+ public String getRealName() {
+ return realName;
+ }
+
+ /* serialization */
+ public void setRealName(String s) {
+ realName = s;
+ }
+
+ public String getFormalName() {
+ return name;
+ }
+
+ public void setFormalName(String s) {
+ name = s;
+ }
+
+ public boolean isPresent() {
+ return present;
+ }
+
+ /* serialization */
+ public void setPresent(boolean b) {
+ present = b;
+ }
+
+ public boolean isHolder() {
+ return holder;
+ }
+
+ public void setHolder(boolean holder) {
+ this.holder = holder;
+ }
+
+ public boolean isHolderPresent() {
+ return holderPresent;
+ }
+ public void setHolderPresent(boolean holderPresent) {
+ this.holderPresent = holderPresent;
+ }
+
+ public String getInitString() {
+ return initString;
+ }
+
+ /* serialization */
+ public void setInitString(String s) {
+ initString = s;
+ }
+
+ public String getHolderName() {
+ return holderName;
+ }
+
+ public void setHolderName(String holderName) {
+ this.holderName = holderName;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/java/JavaType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBElementMember.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBElementMember.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBElementMember.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,96 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureMember;
+
+/**
+ * @author Kathy Walsh, Vivek Pandey
+ *
+ *
+ */
+
+public class JAXBElementMember {
+ public JAXBElementMember() {
+ }
+ public JAXBElementMember(QName name, JAXBType type) {
+ this(name, type, null);
+ }
+ public JAXBElementMember(QName name, JAXBType type,
+ JavaStructureMember javaStructureMember) {
+ _name = name;
+ _type = type;
+ _javaStructureMember = javaStructureMember;
+ }
+ public QName getName() {
+ return _name;
+ }
+ public void setName(QName n) {
+ _name = n;
+ }
+ public JAXBType getType() {
+ return _type;
+ }
+ public void setType(JAXBType t) {
+ _type = t;
+ }
+ public boolean isRepeated() {
+ return _repeated;
+ }
+ public void setRepeated(boolean b) {
+ _repeated = b;
+ }
+ public JavaStructureMember getJavaStructureMember() {
+ return _javaStructureMember;
+ }
+ public void setJavaStructureMember(JavaStructureMember javaStructureMember) {
+ _javaStructureMember = javaStructureMember;
+ }
+ public boolean isInherited() {
+ return isInherited;
+ }
+ public void setInherited(boolean b) {
+ isInherited = b;
+ }
+ public JAXBProperty getProperty() {
+ if(_prop == null && _type != null) {
+ for (JAXBProperty prop: _type.getWrapperChildren()){
+ if(prop.getElementName().equals(_name))
+ setProperty(prop);
+ }
+ }
+ return _prop;
+ }
+ public void setProperty(JAXBProperty prop) {
+ _prop = prop;
+ }
+
+ private QName _name;
+ private JAXBType _type;
+ private JavaStructureMember _javaStructureMember;
+ private boolean _repeated;
+ private boolean isInherited = false;
+ private JAXBProperty _prop;
+ private static final String JAXB_UNIQUE_PARRAM = "__jaxbUniqueParam_";
+}
\ No newline at end of file
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBElementMember.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBMapping.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBMapping.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBMapping.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,99 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import java.util.List;
+import java.util.ArrayList;
+
+import javax.xml.namespace.QName;
+
+import com.sun.tools.xjc.api.Mapping;
+import com.sun.tools.xjc.api.Property;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+import com.sun.codemodel.JType;
+
+/**
+ * @author Kohsuke Kawaguchi, Vivek Pandey
+ */
+public class JAXBMapping {
+
+ /**
+ * @see Mapping#getElement()
+ */
+ private QName elementName;
+
+ /**
+ *
+ */
+ private JAXBTypeAndAnnotation type;
+
+ /**
+ * @see Mapping#getWrapperStyleDrilldown()
+ */
+ private List<JAXBProperty> wrapperStyleDrilldown;
+
+ /**
+ * Default constructor for the persistence.
+ */
+ public JAXBMapping() {}
+
+ /**
+ * Constructor that fills in the values from the given raw model
+ */
+ JAXBMapping( com.sun.tools.xjc.api.Mapping rawModel ) {
+ elementName = rawModel.getElement();
+ TypeAndAnnotation typeAndAnno = rawModel.getType();
+ type = new JAXBTypeAndAnnotation(typeAndAnno);
+ List<? extends Property> list = rawModel.getWrapperStyleDrilldown();
+ if(list==null)
+ wrapperStyleDrilldown = null;
+ else {
+ wrapperStyleDrilldown = new ArrayList<JAXBProperty>(list.size());
+ for( Property p : list )
+ wrapperStyleDrilldown.add(new JAXBProperty(p));
+ }
+
+ }
+
+ /**
+ * @see Mapping#getElement()
+ */
+ public QName getElementName() {
+ return elementName;
+ }
+
+ public void setElementName(QName elementName) {
+ this.elementName = elementName;
+ }
+
+
+ public JAXBTypeAndAnnotation getType() {
+ return type;
+ }
+
+ /**
+ * @see Mapping#getWrapperStyleDrilldown()
+ */
+ public List<JAXBProperty> getWrapperStyleDrilldown() {
+ return wrapperStyleDrilldown;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBMapping.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBModel.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBModel.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBModel.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,143 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import com.sun.tools.xjc.api.*;
+
+import javax.xml.namespace.QName;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.sun.codemodel.JType;
+
+/**
+ * Root of the JAXB Model.
+ *
+ * <p>
+ * This is just a wrapper around a list of {@link JAXBMapping}s.
+ *
+ * @author Kohsuke Kawaguchi, Vivek Pandey
+ */
+public class JAXBModel {
+
+ /**
+ * All the mappings known to this model.
+ */
+ private List<JAXBMapping> mappings;
+
+ // index for faster access.
+ private final Map<QName,JAXBMapping> byQName = new HashMap<QName,JAXBMapping>();
+ private final Map<String,JAXBMapping> byClassName = new HashMap<String,JAXBMapping>();
+
+ private com.sun.tools.xjc.api.JAXBModel rawJAXBModel;
+
+ public com.sun.tools.xjc.api.JAXBModel getRawJAXBModel() {
+ return rawJAXBModel;
+ }
+
+ /**
+ * @return Schema to Java model
+ */
+ public S2JJAXBModel getS2JJAXBModel(){
+ if(rawJAXBModel instanceof S2JJAXBModel)
+ return (S2JJAXBModel)rawJAXBModel;
+ return null;
+ }
+
+ /**
+ * @return Java to Schema JAXBModel
+ */
+ public J2SJAXBModel getJ2SJAXBModel(){
+ if(rawJAXBModel instanceof J2SJAXBModel)
+ return (J2SJAXBModel)rawJAXBModel;
+ return null;
+ }
+
+
+ /**
+ * Default constructor for the persistence.
+ */
+ public JAXBModel() {}
+
+ /**
+ * Constructor that fills in the values from the given raw model
+ */
+ public JAXBModel( com.sun.tools.xjc.api.JAXBModel rawModel ) {
+ this.rawJAXBModel = rawModel;
+ if(rawModel instanceof S2JJAXBModel){
+ S2JJAXBModel model = (S2JJAXBModel)rawModel;
+ List<JAXBMapping> ms = new ArrayList<JAXBMapping>(model.getMappings().size());
+ for( Mapping m : model.getMappings())
+ ms.add(new JAXBMapping(m));
+ setMappings(ms);
+ }
+ }
+
+ /**
+ */
+ public List<JAXBMapping> getMappings() {
+ return mappings;
+ }
+
+ //public void setMappings(List<JAXBMapping> mappings) {
+ public void setMappings(List<JAXBMapping> mappings) {
+ this.mappings = mappings;
+ byQName.clear();
+ byClassName.clear();
+ for( JAXBMapping m : mappings ) {
+ byQName.put(m.getElementName(),m);
+ byClassName.put(m.getType().getName(),m);
+ }
+ }
+
+ /**
+ */
+ public JAXBMapping get( QName elementName ) {
+ return byQName.get(elementName);
+ }
+
+ /**
+ */
+ public JAXBMapping get( String className ) {
+ return byClassName.get(className);
+ }
+
+
+ /**
+ *
+ * @return set of full qualified class names that jaxb will generate
+ */
+ public Set<String> getGeneratedClassNames() {
+ return generatedClassNames;
+ }
+
+ public void setGeneratedClassNames(Set<String> generatedClassNames) {
+ this.generatedClassNames = generatedClassNames;
+ }
+
+ private Set<String> generatedClassNames;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBModel.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBProperty.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBProperty.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBProperty.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,80 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import javax.xml.namespace.QName;
+
+import com.sun.tools.xjc.api.Property;
+
+import com.sun.codemodel.JType;
+/**
+ * @author Kohsuke Kawaguchi
+ */
+public class JAXBProperty {
+
+ /**
+ * @see Property#name()
+ */
+ private String name;
+
+ private JAXBTypeAndAnnotation type;
+ /**
+ * @see Property#elementName()
+ */
+ private QName elementName;
+
+ /**
+ * Default constructor for the persistence.
+ */
+ public JAXBProperty() {}
+
+ /**
+ * Constructor that fills in the values from the given raw model
+ */
+ JAXBProperty( Property prop ) {
+ this.name = prop.name();
+ this.type = new JAXBTypeAndAnnotation(prop.type());
+ this.elementName = prop.elementName();
+ }
+
+ /**
+ * @see Property#name()
+ */
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public JAXBTypeAndAnnotation getType() {
+ return type;
+ }
+
+ /**
+ * @see Property#elementName()
+ */
+ public QName getElementName() {
+ return elementName;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBProperty.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBStructuredType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBStructuredType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBStructuredType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,142 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.ModelException;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureType;
+
+
+/**
+ * Top-level binding between JAXB generated Java type
+ * and XML Schema element declaration.
+ *
+ * @author
+ * Kohsuke Kawaguchi (kohsuke.kawaguchi(a)sun.com)
+ */
+public class JAXBStructuredType extends JAXBType {
+
+ public JAXBStructuredType(JAXBType jaxbType){
+ super(jaxbType);
+ }
+
+ public JAXBStructuredType() {}
+
+ public JAXBStructuredType(QName name) {
+ this(name, null);
+ }
+
+ public JAXBStructuredType(QName name, JavaStructureType javaType) {
+ super(name, javaType);
+ }
+
+ public void add(JAXBElementMember m) {
+ if (_elementMembersByName.containsKey(m.getName())) {
+ throw new ModelException("model.uniqueness");
+ }
+ _elementMembers.add(m);
+ if (m.getName() != null) {
+ _elementMembersByName.put(m.getName().getLocalPart(), m);
+ }
+ }
+
+ public Iterator getElementMembers() {
+ return _elementMembers.iterator();
+ }
+
+ public int getElementMembersCount() {
+ return _elementMembers.size();
+ }
+
+ /* serialization */
+ public List getElementMembersList() {
+ return _elementMembers;
+ }
+
+ /* serialization */
+ public void setElementMembersList(List l) {
+ _elementMembers = l;
+ }
+
+ public void addSubtype(JAXBStructuredType type) {
+ if (_subtypes == null) {
+ _subtypes = new HashSet();
+ }
+ _subtypes.add(type);
+ type.setParentType(this);
+ }
+
+ public Iterator getSubtypes() {
+ if (_subtypes != null) {
+ return _subtypes.iterator();
+ }
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see JAXBType#isUnwrapped()
+ */
+ public boolean isUnwrapped() {
+ return true;
+ }
+ /* serialization */
+ public Set getSubtypesSet() {
+ return _subtypes;
+ }
+
+ /* serialization */
+ public void setSubtypesSet(Set s) {
+ _subtypes = s;
+ }
+
+ public void setParentType(JAXBStructuredType parent) {
+ if (_parentType != null &&
+ parent != null &&
+ !_parentType.equals(parent)) {
+
+ throw new ModelException("model.parent.type.already.set",
+ new Object[] { getName().toString(),
+ _parentType.getName().toString(),
+ parent.getName().toString()});
+ }
+ this._parentType = parent;
+ }
+
+ public JAXBStructuredType getParentType() {
+ return _parentType;
+ }
+
+
+ private List _elementMembers = new ArrayList();
+ private Map _elementMembersByName = new HashMap();
+ private Set _subtypes = null;
+ private JAXBStructuredType _parentType = null;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBStructuredType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBType.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBType.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBType.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,124 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+import com.sun.codemodel.JType;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.AbstractType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Top-level binding between JAXB generated Java type
+ * and XML Schema element declaration.
+ *
+ * @author
+ * Vivek Pandey
+ */
+public class JAXBType extends AbstractType{
+ public JAXBType(JAXBType jaxbType){
+ setName(jaxbType.getName());
+ this.jaxbMapping = jaxbType.getJaxbMapping();
+ this.jaxbModel = jaxbType.getJaxbModel();
+ init();
+ }
+
+ public JAXBType(){}
+
+ public JAXBType(QName name, JavaType type){
+ super(name, type);
+ }
+
+ public JAXBType(QName name, JavaType type, JAXBMapping jaxbMapping, JAXBModel jaxbModel){
+ super(name, type);
+ this.jaxbMapping = jaxbMapping;
+ this.jaxbModel = jaxbModel;
+ init();
+ }
+
+ public void accept(JAXBTypeVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ private void init() {
+ if (jaxbMapping != null)
+ wrapperChildren = jaxbMapping.getWrapperStyleDrilldown();
+ else
+ wrapperChildren = new ArrayList<JAXBProperty>();
+ }
+
+ public boolean isUnwrappable(){
+ return getJaxbMapping().getWrapperStyleDrilldown() != null;
+ }
+
+ public boolean hasWrapperChildren(){
+ return (getWrapperChildren().size() > 0) ? true : false;
+ }
+
+ public boolean isLiteralType() {
+ return true;
+ }
+
+ public List<JAXBProperty> getWrapperChildren(){
+ return wrapperChildren;
+ }
+
+ public void setWrapperChildren(List<JAXBProperty> children) {
+ wrapperChildren = children;
+ }
+
+ public JAXBMapping getJaxbMapping() {
+ return jaxbMapping;
+ }
+
+ public void setJaxbMapping(JAXBMapping jaxbMapping) {
+ this.jaxbMapping = jaxbMapping;
+ init();
+ }
+
+ public void setUnwrapped(boolean unwrapped) {
+ this.unwrapped = unwrapped;
+ }
+
+ public boolean isUnwrapped() {
+ return unwrapped;
+ }
+
+ private JAXBMapping jaxbMapping;
+
+ public JAXBModel getJaxbModel() {
+ return jaxbModel;
+ }
+
+ public void setJaxbModel(JAXBModel jaxbModel) {
+ this.jaxbModel = jaxbModel;
+ }
+
+ private JAXBModel jaxbModel;
+ private boolean unwrapped = false;
+ private List<JAXBProperty> wrapperChildren;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBType.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,74 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+import com.sun.codemodel.JType;
+import com.sun.codemodel.JAnnotatable;
+
+/**
+ * Holds JAXB JType and TypeAndAnnotation. This provides abstration over
+ * types from JAXBMapping and Property.
+ */
+public class JAXBTypeAndAnnotation {
+ TypeAndAnnotation typeAnn;
+ JType type;
+
+ public JAXBTypeAndAnnotation(TypeAndAnnotation typeAnn) {
+ this.typeAnn = typeAnn;
+ this.type = typeAnn.getTypeClass();
+ }
+
+ public JAXBTypeAndAnnotation(JType type) {
+ this.type = type;
+ }
+
+ public JAXBTypeAndAnnotation(TypeAndAnnotation typeAnn, JType type) {
+ this.typeAnn = typeAnn;
+ this.type = type;
+ }
+
+ public void annotate(JAnnotatable typeVar) {
+ if(typeAnn != null)
+ typeAnn.annotate(typeVar);
+ }
+
+ public JType getType() {
+ return type;
+ }
+
+ public String getName(){
+ return type.fullName();
+ }
+
+ public TypeAndAnnotation getTypeAnn() {
+ return typeAnn;
+ }
+
+ public void setTypeAnn(TypeAndAnnotation typeAnn) {
+ this.typeAnn = typeAnn;
+ }
+
+ public void setType(JType type) {
+ this.type = type;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeAndAnnotation.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeVisitor.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeVisitor.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeVisitor.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,33 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+/**
+ * @author Vivek Pandey
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public interface JAXBTypeVisitor {
+ public void visit(JAXBType type) throws Exception;
+ public void visit(RpcLitStructure type) throws Exception;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/JAXBTypeVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitMember.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitMember.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitMember.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,82 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.AbstractType;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ * Represents RpcLit member parts
+ */
+public class RpcLitMember extends AbstractType {
+
+ //wsdl:part type attribute java mapped object
+ private String javaTypeName;
+ private QName schemaTypeName;
+
+ /**
+ *
+ */
+ public RpcLitMember() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+ public RpcLitMember(QName name, String javaTypeName){
+ setName(name);
+ this.javaTypeName = javaTypeName;
+ }
+ public RpcLitMember(QName name, String javaTypeName, QName schemaTypeName){
+ setName(name);
+ this.javaTypeName = javaTypeName;
+ this.schemaTypeName = schemaTypeName;
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public String getJavaTypeName() {
+ return javaTypeName;
+ }
+ /**
+ * @param type The type to set.
+ */
+ public void setJavaTypeName(String type) {
+ this.javaTypeName = type;
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public QName getSchemaTypeName() {
+ return schemaTypeName;
+ }
+ /**
+ * @param type The type to set.
+ */
+ public void setSchemaTypeName(QName type) {
+ this.schemaTypeName = type;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitMember.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitStructure.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitStructure.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitStructure.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,90 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.AbstractType;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ * RPC Structure that will be used to create RpcLitPayload latter
+ */
+public class RpcLitStructure extends AbstractType {
+ private List<RpcLitMember> members;
+ private JAXBModel jaxbModel;
+
+ /**
+ *
+ */
+ public RpcLitStructure() {
+ super();
+ // TODO Auto-generated constructor stub
+ }
+ public RpcLitStructure(QName name, JAXBModel jaxbModel){
+ setName(name);
+ this.jaxbModel = jaxbModel;
+ this.members = new ArrayList<RpcLitMember>();
+
+ }
+ public RpcLitStructure(QName name, JAXBModel jaxbModel, List<RpcLitMember> members){
+ setName(name);
+ this.members = members;
+ }
+
+ public void accept(JAXBTypeVisitor visitor) throws Exception {
+ visitor.visit(this);
+ }
+
+ public List<RpcLitMember> getRpcLitMembers(){
+ return members;
+ }
+
+ public List<RpcLitMember> setRpcLitMembers(List<RpcLitMember> members){
+ return this.members = members;
+ }
+
+ public void addRpcLitMember(RpcLitMember member){
+ members.add(member);
+ }
+ /**
+ * @return Returns the jaxbModel.
+ */
+ public JAXBModel getJaxbModel() {
+ return jaxbModel;
+ }
+ /**
+ * @param jaxbModel The jaxbModel to set.
+ */
+ public void setJaxbModel(JAXBModel jaxbModel) {
+ this.jaxbModel = jaxbModel;
+ }
+
+ public boolean isLiteralType() {
+ return true;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/RpcLitStructure.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/Util.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/Util.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/Util.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,62 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.model.jaxb;
+
+/**
+ * @author Kohsuke Kawaguchi
+ */
+class Util {
+ /**
+ * Replaces the marcros in the first string by the actual given arguments.
+ */
+ static String replace( String macro, String... args ) {
+ int len = macro.length();
+ StringBuilder buf = new StringBuilder(len);
+ for( int i=0; i<len; i++ ) {
+ char ch = macro.charAt(i);
+ if(ch=='=' && i+2<len) {
+ char tail = macro.charAt(i+1);
+ char ch2 = macro.charAt(i+2);
+ if('0'<=ch2 && ch2<='9' && tail==':') {
+ buf.append(args[ch2-'0']);
+ i+=2;
+ continue;
+ }
+ }
+ buf.append(ch);
+ }
+ return buf.toString();
+ }
+
+ /**
+ * Creates a macro tempate so that it can be later used with {@link #replace(String, String[])}.
+ */
+ static String createMacroTemplate( String s ) {
+ return s;
+ }
+
+ static final String MAGIC = "=:";
+
+ static final String MAGIC0 = MAGIC+"0";
+ static final String MAGIC1 = MAGIC+"1";
+ static final String MAGIC2 = MAGIC+"2";
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/model/jaxb/Util.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/JavaSimpleTypeCreator.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/JavaSimpleTypeCreator.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/JavaSimpleTypeCreator.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,163 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.modeler;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaSimpleType;
+import org.jboss.com.sun.xml.ws.util.VersionUtil;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class JavaSimpleTypeCreator implements ModelerConstants {
+
+ /*
+ * Mapped JavaSimpleTypes
+ */
+ public JavaSimpleType BOOLEAN_JAVATYPE;
+ public JavaSimpleType BOXED_BOOLEAN_JAVATYPE;
+ public JavaSimpleType BYTE_JAVATYPE;
+ public JavaSimpleType BYTE_ARRAY_JAVATYPE;
+ public JavaSimpleType BOXED_BYTE_JAVATYPE;
+ public JavaSimpleType BOXED_BYTE_ARRAY_JAVATYPE;
+ public JavaSimpleType DOUBLE_JAVATYPE;
+ public JavaSimpleType BOXED_DOUBLE_JAVATYPE;
+ public JavaSimpleType FLOAT_JAVATYPE;
+ public JavaSimpleType BOXED_FLOAT_JAVATYPE;
+ public JavaSimpleType INT_JAVATYPE;
+ public JavaSimpleType BOXED_INTEGER_JAVATYPE;
+ public JavaSimpleType LONG_JAVATYPE;
+ public JavaSimpleType BOXED_LONG_JAVATYPE;
+ public JavaSimpleType SHORT_JAVATYPE;
+ public JavaSimpleType BOXED_SHORT_JAVATYPE;
+ public JavaSimpleType DECIMAL_JAVATYPE;
+ public JavaSimpleType BIG_INTEGER_JAVATYPE;
+ public JavaSimpleType CALENDAR_JAVATYPE;
+ public JavaSimpleType DATE_JAVATYPE;
+ public JavaSimpleType STRING_JAVATYPE;
+ public JavaSimpleType STRING_ARRAY_JAVATYPE;
+ public JavaSimpleType QNAME_JAVATYPE;
+ public JavaSimpleType VOID_JAVATYPE;
+ public JavaSimpleType OBJECT_JAVATYPE;
+ public JavaSimpleType SOAPELEMENT_JAVATYPE;
+ public JavaSimpleType URI_JAVATYPE;
+
+ // Attachment types
+ public JavaSimpleType IMAGE_JAVATYPE;
+ public JavaSimpleType MIME_MULTIPART_JAVATYPE;
+ public JavaSimpleType SOURCE_JAVATYPE;
+ public JavaSimpleType DATA_HANDLER_JAVATYPE;
+
+ // bug fix: 4923650
+ private Map javaTypes = new HashMap();
+
+ public JavaSimpleTypeCreator() {
+ BOOLEAN_JAVATYPE = new JavaSimpleType(BOOLEAN_CLASSNAME, FALSE_STR);
+ javaTypes.put(BOOLEAN_CLASSNAME, BOOLEAN_JAVATYPE);
+ BOXED_BOOLEAN_JAVATYPE =
+ new JavaSimpleType(BOXED_BOOLEAN_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_BOOLEAN_CLASSNAME, BOXED_BOOLEAN_JAVATYPE);
+ BYTE_JAVATYPE = new JavaSimpleType(BYTE_CLASSNAME, "(byte)"+ZERO_STR);
+ javaTypes.put(BYTE_CLASSNAME, BYTE_JAVATYPE);
+ BYTE_ARRAY_JAVATYPE =
+ new JavaSimpleType(BYTE_ARRAY_CLASSNAME, NULL_STR);
+ javaTypes.put(BYTE_ARRAY_CLASSNAME, BYTE_ARRAY_JAVATYPE);
+ BOXED_BYTE_JAVATYPE =
+ new JavaSimpleType(BOXED_BYTE_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_BYTE_CLASSNAME, BOXED_BYTE_JAVATYPE);
+ BOXED_BYTE_ARRAY_JAVATYPE =
+ new JavaSimpleType(BOXED_BYTE_ARRAY_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_BYTE_ARRAY_CLASSNAME, BOXED_BYTE_ARRAY_JAVATYPE);
+ DOUBLE_JAVATYPE = new JavaSimpleType(DOUBLE_CLASSNAME, ZERO_STR);
+ javaTypes.put(DOUBLE_CLASSNAME, DOUBLE_JAVATYPE);
+ BOXED_DOUBLE_JAVATYPE =
+ new JavaSimpleType(BOXED_DOUBLE_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_DOUBLE_CLASSNAME, BOXED_DOUBLE_JAVATYPE);
+ FLOAT_JAVATYPE = new JavaSimpleType(FLOAT_CLASSNAME, ZERO_STR);
+ javaTypes.put(FLOAT_CLASSNAME, FLOAT_JAVATYPE);
+ BOXED_FLOAT_JAVATYPE =
+ new JavaSimpleType(BOXED_FLOAT_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_FLOAT_CLASSNAME, BOXED_FLOAT_JAVATYPE);
+ INT_JAVATYPE = new JavaSimpleType(INT_CLASSNAME, ZERO_STR);
+ javaTypes.put(INT_CLASSNAME, INT_JAVATYPE);
+ BOXED_INTEGER_JAVATYPE =
+ new JavaSimpleType(BOXED_INTEGER_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_INTEGER_CLASSNAME, BOXED_INTEGER_JAVATYPE);
+ LONG_JAVATYPE = new JavaSimpleType(LONG_CLASSNAME, ZERO_STR);
+ javaTypes.put(LONG_CLASSNAME, LONG_JAVATYPE);
+ BOXED_LONG_JAVATYPE =
+ new JavaSimpleType(BOXED_LONG_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_LONG_CLASSNAME, BOXED_LONG_JAVATYPE);
+ SHORT_JAVATYPE =
+ new JavaSimpleType(SHORT_CLASSNAME, "(short)"+ZERO_STR);
+ javaTypes.put(SHORT_CLASSNAME, SHORT_JAVATYPE);
+ BOXED_SHORT_JAVATYPE =
+ new JavaSimpleType(BOXED_SHORT_CLASSNAME, NULL_STR);
+ javaTypes.put(BOXED_SHORT_CLASSNAME, BOXED_SHORT_JAVATYPE);
+ DECIMAL_JAVATYPE = new JavaSimpleType(BIGDECIMAL_CLASSNAME, NULL_STR);
+ javaTypes.put(BIGDECIMAL_CLASSNAME, DECIMAL_JAVATYPE);
+ BIG_INTEGER_JAVATYPE =
+ new JavaSimpleType(BIGINTEGER_CLASSNAME, NULL_STR);
+ javaTypes.put(BIGINTEGER_CLASSNAME, BIG_INTEGER_JAVATYPE);
+ CALENDAR_JAVATYPE = new JavaSimpleType(CALENDAR_CLASSNAME, NULL_STR);
+ javaTypes.put(CALENDAR_CLASSNAME, CALENDAR_JAVATYPE);
+ DATE_JAVATYPE = new JavaSimpleType(DATE_CLASSNAME, NULL_STR);
+ javaTypes.put(DATE_CLASSNAME, DATE_JAVATYPE);
+ STRING_JAVATYPE = new JavaSimpleType(STRING_CLASSNAME, NULL_STR);
+ javaTypes.put(STRING_CLASSNAME, STRING_JAVATYPE);
+ STRING_ARRAY_JAVATYPE =
+ new JavaSimpleType(STRING_ARRAY_CLASSNAME, NULL_STR);
+ javaTypes.put(STRING_ARRAY_CLASSNAME, STRING_ARRAY_JAVATYPE);
+ QNAME_JAVATYPE = new JavaSimpleType(QNAME_CLASSNAME, NULL_STR);
+ javaTypes.put(QNAME_CLASSNAME, QNAME_JAVATYPE);
+
+
+ VOID_JAVATYPE = new JavaSimpleType(VOID_CLASSNAME, null);
+ javaTypes.put(VOID_CLASSNAME, VOID_JAVATYPE);
+ OBJECT_JAVATYPE = new JavaSimpleType(OBJECT_CLASSNAME, null);
+ javaTypes.put(OBJECT_CLASSNAME, OBJECT_JAVATYPE);
+ SOAPELEMENT_JAVATYPE = new JavaSimpleType(SOAPELEMENT_CLASSNAME, null);
+ javaTypes.put(SOAPELEMENT_CLASSNAME, SOAPELEMENT_JAVATYPE);
+ URI_JAVATYPE = new JavaSimpleType(URI_CLASSNAME, null);
+ javaTypes.put(URI_CLASSNAME, URI_JAVATYPE);
+
+ // Attachment types
+ IMAGE_JAVATYPE = new JavaSimpleType(IMAGE_CLASSNAME, null);
+ javaTypes.put(IMAGE_CLASSNAME, IMAGE_JAVATYPE);
+ MIME_MULTIPART_JAVATYPE = new JavaSimpleType(MIME_MULTIPART_CLASSNAME, null);
+ javaTypes.put(MIME_MULTIPART_CLASSNAME, MIME_MULTIPART_JAVATYPE);
+ SOURCE_JAVATYPE = new JavaSimpleType(SOURCE_CLASSNAME, null);
+ javaTypes.put(SOURCE_CLASSNAME, SOURCE_JAVATYPE);
+ DATA_HANDLER_JAVATYPE = new JavaSimpleType(DATA_HANDLER_CLASSNAME, null);
+ javaTypes.put(DATA_HANDLER_CLASSNAME, DATA_HANDLER_JAVATYPE);
+ }
+
+ // bug fix: 4923650
+ public JavaSimpleType getJavaSimpleType(String classname) {
+ return (JavaSimpleType) javaTypes.get(classname);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/JavaSimpleTypeCreator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/Modeler.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/Modeler.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/Modeler.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,44 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+
+package org.jboss.com.sun.tools.ws.processor.modeler;
+
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+
+/**
+ * A Modeler is used to create a Model of a Web Service from a particular Web
+ * Web Service description such as a WSDL
+ *
+ * @author WS Development Team
+*/
+public interface Modeler {
+ /**
+ * Returns the top model of a Web Service. May throw a
+ * ModelException if there is a problem with the model.
+ *
+ * @return Model - the root Node of the model of the Web Service
+ *
+ * @exception ModelerException
+ */
+ public Model buildModel();
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/Modeler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerConstants.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerConstants.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerConstants.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,100 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.modeler;
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public interface ModelerConstants {
+
+ public static final String BRACKETS = "[]";
+ public static final String FALSE_STR = "false";
+ public static final String ZERO_STR = "0";
+ public static final String NULL_STR = "null";
+ public static final String ARRAY_STR = "Array";
+
+ /*
+ * Java ClassNames
+ */
+ /*
+ * Java ClassNames
+ */
+ public static final String IOEXCEPTION_CLASSNAME = "java.io.IOException";
+ public static final String BOOLEAN_CLASSNAME = "boolean";
+ public static final String BOXED_BOOLEAN_CLASSNAME = "java.lang.Boolean";
+ public static final String BYTE_CLASSNAME = "byte";
+ public static final String BYTE_ARRAY_CLASSNAME = BYTE_CLASSNAME+BRACKETS;
+ public static final String BOXED_BYTE_CLASSNAME = "java.lang.Byte";
+ public static final String BOXED_BYTE_ARRAY_CLASSNAME = BOXED_BYTE_CLASSNAME+BRACKETS;
+ public static final String CLASS_CLASSNAME = "java.lang.Class";
+ public static final String CHAR_CLASSNAME = "char";
+ public static final String BOXED_CHAR_CLASSNAME = "java.lang.Character";
+ public static final String DOUBLE_CLASSNAME = "double";
+ public static final String BOXED_DOUBLE_CLASSNAME = "java.lang.Double";
+ public static final String FLOAT_CLASSNAME = "float";
+ public static final String BOXED_FLOAT_CLASSNAME = "java.lang.Float";
+ public static final String INT_CLASSNAME = "int";
+ public static final String BOXED_INTEGER_CLASSNAME = "java.lang.Integer";
+ public static final String LONG_CLASSNAME = "long";
+ public static final String BOXED_LONG_CLASSNAME = "java.lang.Long";
+ public static final String SHORT_CLASSNAME = "short";
+ public static final String BOXED_SHORT_CLASSNAME = "java.lang.Short";
+ public static final String BIGDECIMAL_CLASSNAME = "java.math.BigDecimal";
+ public static final String BIGINTEGER_CLASSNAME = "java.math.BigInteger";
+ public static final String CALENDAR_CLASSNAME = "java.util.Calendar";
+ public static final String DATE_CLASSNAME = "java.util.Date";
+ public static final String STRING_CLASSNAME = "java.lang.String";
+ public static final String STRING_ARRAY_CLASSNAME = STRING_CLASSNAME+BRACKETS;
+ public static final String QNAME_CLASSNAME = "javax.xml.namespace.QName";
+ public static final String VOID_CLASSNAME = "void";
+ public static final String OBJECT_CLASSNAME = "java.lang.Object";
+ public static final String SOAPELEMENT_CLASSNAME = "javax.xml.soap.SOAPElement";
+ public static final String IMAGE_CLASSNAME = "java.awt.Image";
+ public static final String MIME_MULTIPART_CLASSNAME = "javax.mail.internet.MimeMultipart";
+ public static final String SOURCE_CLASSNAME = "javax.xml.transform.Source";
+ public static final String DATA_HANDLER_CLASSNAME = "javax.activation.DataHandler";
+ public static final String URI_CLASSNAME = "java.net.URI";
+// public static final String URI_CLASSNAME = "java.lang.String";
+ // Collections
+ public static final String COLLECTION_CLASSNAME = "java.util.Collection";
+ public static final String LIST_CLASSNAME = "java.util.List";
+ public static final String SET_CLASSNAME = "java.util.Set";
+ public static final String VECTOR_CLASSNAME = "java.util.Vector";
+ public static final String STACK_CLASSNAME = "java.util.Stack";
+ public static final String LINKED_LIST_CLASSNAME = "java.util.LinkedList";
+ public static final String ARRAY_LIST_CLASSNAME = "java.util.ArrayList";
+ public static final String HASH_SET_CLASSNAME = "java.util.HashSet";
+ public static final String TREE_SET_CLASSNAME = "java.util.TreeSet";
+
+ // Maps
+ public static final String MAP_CLASSNAME = "java.util.Map";
+ public static final String HASH_MAP_CLASSNAME = "java.util.HashMap";
+ public static final String TREE_MAP_CLASSNAME = "java.util.TreeMap";
+ public static final String HASHTABLE_CLASSNAME = "java.util.Hashtable";
+ public static final String PROPERTIES_CLASSNAME = "java.util.Properties";
+// public static final String WEAK_HASH_MAP_CLASSNAME = "java.util.WeakHashMap";
+ public static final String JAX_WS_MAP_ENTRY_CLASSNAME = "org.jboss.com.sun.xml.ws.encoding.soap.JAXWSMapEntry";
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerException.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerException.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerException.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,55 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.modeler;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorException;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+
+/**
+ * ModelerException represents an exception that occurred while
+ * visiting service model.
+ *
+ * @see ProcessorException
+ *
+ * @author WS Development Team
+*/
+public class ModelerException extends ProcessorException {
+
+ public ModelerException(String key, Object... args) {
+ super(key, args);
+ }
+
+ public ModelerException(Throwable throwable) {
+ super(throwable);
+ }
+
+ public ModelerException(Localizable arg) {
+ super("modeler.nestedModelError", arg);
+ }
+
+ public String getResourceBundleName() {
+ return "org.jboss.com.sun.tools.ws.resources.modeler";
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerException.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerUtils.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerUtils.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerUtils.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,258 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.AbstractType;
+import org.jboss.com.sun.tools.ws.processor.model.Block;
+import org.jboss.com.sun.tools.ws.processor.model.ModelProperties;
+import org.jboss.com.sun.tools.ws.processor.model.Parameter;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaSimpleType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureMember;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.*;
+import org.jboss.com.sun.tools.ws.util.ClassNameInfo;
+import org.jboss.com.sun.tools.ws.wsdl.document.Message;
+import org.jboss.com.sun.tools.ws.wsdl.document.MessagePart;
+
+import com.sun.tools.xjc.api.S2JJAXBModel;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+
+/**
+ * Utilities to be used by modelers such as WSDLModeler and Rmimodeler
+ *
+ * @author Vivek Pandey
+ *
+ */
+public class ModelerUtils {
+
+ /**
+ * This method should be called incase of wrapper style operations. This is
+ * equivalent to wrapper style schema component or JAXB Mapping object.
+ *
+ * @param jaxbType JAXBType from which a JAXBStructured type will be created.
+ * @return returns JAXBStructured type
+ */
+ public static JAXBStructuredType createJAXBStructureType(JAXBType jaxbType) {
+ JAXBStructuredType type = new JAXBStructuredType(jaxbType);
+ type.setName(jaxbType.getName());
+ type.setJavaType(jaxbType.getJavaType());
+ return type;
+ }
+
+ /**
+ * This method uses JAXBStructured type (wrapper style operations) and
+ * unwraps it to create list of parameters.
+ *
+ *
+ * @param jaxbType instance of JAXBType, could be JAXBStructured type.
+ * @param block The Block (body/Header/Attachment) to which the created Parameter belong.
+ * @return list of Parameters
+ */
+ public static List<Parameter> createUnwrappedParameters(JAXBType jaxbType,
+ Block block) {
+ List<Parameter> paramList = new ArrayList<Parameter>();
+ JAXBStructuredType type = null;
+ if (!(jaxbType instanceof JAXBStructuredType))
+ type = createJAXBStructureType(jaxbType);
+ else
+ type = (JAXBStructuredType) jaxbType;
+
+ JavaStructureType jst = new JavaStructureType(jaxbType.getJavaType()
+ .getRealName(), true, type);
+ type.setJavaType(jst);
+ block.setType(type);
+ List memberList = jaxbType.getWrapperChildren();
+ Iterator props = memberList.iterator();
+ while (props.hasNext()) {
+ JAXBProperty prop = (JAXBProperty) props.next();
+ paramList.add(createUnwrappedParameter(prop, jaxbType, block, type,
+ jst));
+ }
+
+ return paramList;
+ }
+
+ /**
+ * @param prop
+ * @param jaxbType
+ * @param block
+ * @return
+ */
+ private static Parameter createUnwrappedParameter(JAXBProperty prop,
+ JAXBType jaxbType, Block block, JAXBStructuredType type,
+ JavaStructureType jst) {
+ QName elementName = prop.getElementName();
+ JavaType javaType = new JavaSimpleType(prop.getType());
+ JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
+ JavaStructureMember jsm = new JavaStructureMember(elementName
+ .getLocalPart(), javaType, eType);
+ eType.setJavaStructureMember(jsm);
+ jst.add(jsm);
+ eType.setProperty(prop);
+ type.add(eType);
+ JAXBType t = new JAXBType(elementName, javaType, jaxbType
+ .getJaxbMapping(), jaxbType.getJaxbModel());
+ t.setUnwrapped(true);
+ Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
+ parameter.setEmbedded(true);
+ return parameter;
+ }
+
+ public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel){
+ RpcLitStructure rpcStruct = (RpcLitStructure)block.getType();
+
+ List<Parameter> parameters = new ArrayList<Parameter>();
+ for(MessagePart part : message.getParts()){
+ if(!ModelerUtils.isBoundToSOAPBody(part))
+ continue;
+ QName name = part.getDescriptor();
+ TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
+ if(typeAndAnn == null){
+ String msgQName = "{"+message.getDefining().getTargetNamespaceURI()+"}"+message.getName();
+ throw new ModelerException("wsdlmodeler.rpclit.unkownschematype", name.toString(),
+ part.getName(), msgQName);
+ }
+ String type = typeAndAnn.getTypeClass().fullName();
+ type = ClassNameInfo.getGenericClass(type);
+ RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
+ JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
+ param.setJavaType(javaType);
+ rpcStruct.addRpcLitMember(param);
+ Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
+ parameter.setEmbedded(true);
+ parameters.add(parameter);
+ }
+ return parameters;
+ }
+
+ /**
+ * Called for non-wrapper style operations. It returns a Parameter constructed
+ * using the JAXBType and the Block.
+ *
+ * @param partName typically wsdl:part or any name to be given to the parameter
+ * @param jaxbType type of Parameter
+ * @param block Block to which the parameter belongs to
+ * @return Parameter created.
+ */
+ public static Parameter createParameter(String partName, AbstractType jaxbType,
+ Block block) {
+ Parameter parameter = new Parameter(partName);
+ parameter.setProperty(ModelProperties.PROPERTY_PARAM_MESSAGE_PART_NAME,
+ partName);
+ parameter.setEmbedded(false);
+ parameter.setType(jaxbType);
+ parameter.setTypeName(jaxbType.getJavaType().getType().getName());
+ parameter.setBlock(block);
+ return parameter;
+ }
+
+ /**
+ * Get Parameter from the list of parameters.
+ *
+ * @param paramName
+ * @param parameters
+ * @return the Parameter with name paramName from parameters
+ */
+ public static Parameter getParameter(String paramName, List<Parameter> parameters){
+ if(parameters == null)
+ return null;
+ for(Parameter param: parameters){
+ //if(param.getName().equals("_return") && paramName.equals("return") || param.getName().equals(paramName)) {
+ if(param.getName().equals(paramName)){
+ return param;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Compares two JAXBStructures.
+ *
+ * @param struct1
+ * @param struct2
+ * @return true if struct1 and struct2 are equivalent.
+ */
+ public static boolean isEquivalentLiteralStructures(
+ JAXBStructuredType struct1,
+ JAXBStructuredType struct2) {
+ if (struct1.getElementMembersCount() != struct2.getElementMembersCount())
+ return false;
+ Iterator members = struct1.getElementMembers();
+ JAXBElementMember member1;
+ JavaStructureMember javaMember1, javaMember2;
+ for (int i = 0; members.hasNext(); i++) {
+ member1 = (JAXBElementMember)members.next();
+ javaMember1 = member1.getJavaStructureMember();
+ javaMember2 =
+ ((JavaStructureType)struct2.getJavaType()).getMemberByName(
+ member1.getJavaStructureMember().getName());
+ if (javaMember2.getConstructorPos() != i
+ || !javaMember1.getType().equals(javaMember2.getType())) {
+ return false;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @param part
+ * @return true if part is bound to Mime content
+ */
+ public static boolean isBoundToMimeContent(MessagePart part) {
+ if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.WSDL_MIME_BINDING)
+ return true;
+ return false;
+ }
+
+ /**
+ * @param part
+ * @return true if part is bound to SOAPBody
+ */
+ public static boolean isBoundToSOAPBody(MessagePart part) {
+ if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.SOAP_BODY_BINDING)
+ return true;
+ return false;
+ }
+
+ /**
+ * @param part
+ * @return true if part is bound to SOAPHeader
+ */
+ public static boolean isBoundToSOAPHeader(MessagePart part) {
+ if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.SOAP_HEADER_BINDING)
+ return true;
+ return false;
+ }
+
+ public static boolean isUnbound(MessagePart part) {
+ if((part != null) && part.getBindingExtensibilityElementKind() == MessagePart.PART_NOT_BOUNDED)
+ return true;
+ return false;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/ModelerUtils.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/AnnotationProcessorContext.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/AnnotationProcessorContext.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/AnnotationProcessorContext.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,297 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.ParameterDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.TypeMirror;
+
+import com.sun.tools.xjc.api.Reference;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.Operation;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBModel;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPUse;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+
+/**
+ *
+ * @author dkohlert
+ */
+public class AnnotationProcessorContext {
+
+ private Map<String, SEIContext> seiContextMap;
+ private int round = 1;
+ private boolean modelCompleted = false;
+
+ /** Creates a new instance of AnnotationProcessorContext */
+ public AnnotationProcessorContext() {
+ seiContextMap = new HashMap<String, SEIContext>();
+ }
+
+ public void addSEIContext(String seiName, SEIContext seiContext) {
+ seiContextMap.put(seiName, seiContext);
+ }
+
+ public SEIContext getSEIContext(String seiName) {
+ SEIContext context = seiContextMap.get(seiName);
+ if (context == null) {
+ context = new SEIContext(seiName);
+ addSEIContext(seiName, context);
+ }
+ return context;
+ }
+
+ public SEIContext getSEIContext(TypeDeclaration d) {
+ SEIContext context = getSEIContext(d.getQualifiedName());
+ return context;
+ }
+
+ public Collection<SEIContext> getSEIContexts() {
+ return seiContextMap.values();
+ }
+
+ public boolean allEncoded() {
+ for (SEIContext seiContext : seiContextMap.values()) {
+ if (!isEncoded(seiContext.getModel()))
+ return false;
+ }
+ return true;
+ }
+
+ public int getRound() {
+ return round;
+ }
+
+ public void incrementRound() {
+ round++;
+ }
+
+ public static boolean isEncoded(Model model) {
+ if (model == null)
+ return false;
+ for (Service service : model.getServices()) {
+ for (Port port : service.getPorts()) {
+ for (Operation operation : port.getOperations()) {
+ if (operation.getUse() != null && operation.getUse().equals(SOAPUse.LITERAL))
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public void setModelCompleted(boolean modelCompleted) {
+ this.modelCompleted = modelCompleted;
+ }
+
+ public boolean isModelCompleted() {
+ return modelCompleted;
+ }
+
+ public static class SEIContext {
+ private Map<String, WrapperInfo> reqOperationWrapperMap;
+ private Map<String, WrapperInfo> resOperationWrapperMap;
+ private Map<String, FaultInfo> exceptionBeanMap;
+
+ private Model model;
+ private Map<Object, Reference> schemaReferences;
+ private Map<QName, Reference> schemaElements;
+
+ private boolean modelCompiled = false;
+ private String seiName;
+ private String seiImplName;
+ private boolean implementsSEI = false;
+ private JAXBModel jaxBModel;
+ private String namespaceURI = null;
+
+ public SEIContext(String seiName) {
+ reqOperationWrapperMap = new HashMap<String, WrapperInfo>();
+ resOperationWrapperMap = new HashMap<String, WrapperInfo>();
+ exceptionBeanMap = new HashMap<String,FaultInfo>();
+ schemaReferences = new HashMap<Object, Reference>();
+ schemaElements = new HashMap<QName, Reference>();
+ this.seiName = seiName;
+ }
+
+ public void setImplementsSEI(boolean implementsSEI) {
+ this.implementsSEI = implementsSEI;
+ }
+
+ public boolean getImplementsSEI() {
+ return implementsSEI;
+ }
+
+ public void setNamespaceURI(String namespaceURI) {
+ this.namespaceURI = namespaceURI;
+ }
+
+ public String getNamespaceURI() {
+ return namespaceURI;
+ }
+
+ public void setJAXBModel(JAXBModel model) {
+ this.jaxBModel = model;
+ if (this.model != null)
+ this.model.setJAXBModel(model);
+ }
+
+ public JAXBModel getJAXBModel() {
+ return jaxBModel;
+ }
+
+ public String getSEIName() {
+ return seiName;
+ }
+
+ public String getSEIImplName() {
+ return seiImplName;
+ }
+
+ public void setSEIImplName(String implName) {
+ seiImplName = implName;
+ }
+
+ public void setReqWrapperOperation(MethodDeclaration method, WrapperInfo wrapperInfo) {
+ reqOperationWrapperMap.put(methodToString(method), wrapperInfo);
+ }
+
+ public WrapperInfo getReqOperationWrapper(MethodDeclaration method) {
+ return reqOperationWrapperMap.get(methodToString(method));
+ }
+
+ public void setResWrapperOperation(MethodDeclaration method, WrapperInfo wrapperInfo) {
+ resOperationWrapperMap.put(methodToString(method), wrapperInfo);
+ }
+
+ public WrapperInfo getResOperationWrapper(MethodDeclaration method) {
+ return resOperationWrapperMap.get(methodToString(method));
+ }
+
+ public String methodToString(MethodDeclaration method) {
+ StringBuffer buf = new StringBuffer(method.getSimpleName());
+ for (ParameterDeclaration param : method.getParameters())
+ buf.append(";"+param.getType().toString());
+ return buf.toString();
+ }
+
+ public void setModel(Model model) {
+ this.model = model;
+ model.setJAXBModel(jaxBModel);
+ }
+
+ public Model getModel() {
+ return model;
+ }
+
+ public boolean getModelCompiled() {
+ return modelCompiled;
+ }
+
+ public void setModelCompiled(boolean compiled) {
+ modelCompiled = compiled;
+ }
+
+ public Collection<Reference> getSchemaReferences(ModelBuilder builder) {
+ return schemaReferences.values();
+ }
+
+ public Map<QName, Reference> getSchemaElementMap(ModelBuilder builder) {
+ return schemaElements;
+ }
+
+ public Collection<Reference> getSchemaReferences() {
+ return schemaReferences.values();
+ }
+
+ public void clearExceptionMap() {
+ exceptionBeanMap.clear();
+ }
+
+ public void addExceptionBeanEntry(String exception, FaultInfo faultInfo, ModelBuilder builder) {
+ exceptionBeanMap.put(exception,faultInfo);
+ }
+
+ public FaultInfo getExceptionBeanName(String exception) {
+ return exceptionBeanMap.get(exception);
+ }
+
+ public Reference addReference(MethodDeclaration method) {
+ Reference ref = schemaReferences.get(method);
+ if (ref == null)
+ ref = new Reference(method);
+ addReference(method, ref);
+ return ref;
+ }
+
+ public Reference addReference(ParameterDeclaration param) {
+ Reference ref = schemaReferences.get(param);
+ if (ref == null)
+ ref = new Reference(param);
+ addReference(param, ref);
+ return ref;
+ }
+
+ public Reference addReference(TypeMirror type, ParameterDeclaration param) {
+ Reference ref = schemaReferences.get(param);
+ if (ref == null)
+ ref = new Reference(type, param);
+ addReference(param, ref);
+ return ref;
+ }
+
+ public Reference addReference(TypeDeclaration type, AnnotationProcessorEnvironment apEnv) {
+ Reference ref = schemaReferences.get(type);
+ if (ref == null)
+ ref = new Reference(type, apEnv);
+ addReference(type, ref);
+ return ref;
+ }
+
+ private void addReference(Object key, Reference reference) {
+ schemaReferences.put(key, reference);
+ }
+
+ public Reference getReference(Object key) {
+ return schemaReferences.get(key);
+ }
+
+ public void addSchemaElement(QName elemName, Reference reference) {
+ if (elemName == null)
+ throw new RuntimeException();
+ schemaElements.put(elemName, reference);
+ }
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/AnnotationProcessorContext.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/FaultInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/FaultInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/FaultInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,97 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * @author dkohlert
+ */
+public class FaultInfo {
+ public String beanName;
+ public TypeMoniker beanTypeMoniker;
+ public boolean isWSDLException;
+ public QName elementName;
+ public List<MemberInfo> members;
+
+ /** Creates a new instance of FaultInfo */
+ public FaultInfo() {
+ }
+ public FaultInfo(String beanName) {
+ this.beanName = beanName;
+ }
+ public FaultInfo(String beanName, boolean isWSDLException) {
+ this.beanName = beanName;
+ this.isWSDLException = isWSDLException;
+ }
+ public FaultInfo(TypeMoniker typeMoniker, boolean isWSDLException) {
+ this.beanTypeMoniker = typeMoniker;
+ this.isWSDLException = isWSDLException;
+ }
+
+ public void setIsWSDLException(boolean isWSDLException) {
+ this.isWSDLException = isWSDLException;
+ }
+
+ public boolean isWSDLException() {
+ return isWSDLException;
+ }
+
+ public void setBeanName(String beanName) {
+ this.beanName = beanName;
+ }
+
+ public String getBeanName() {
+ return beanName;
+ }
+
+ public void setElementName(QName elementName) {
+ this.elementName = elementName;
+ }
+
+ public QName getElementName() {
+ return elementName;
+ }
+ public void setBeanTypeMoniker(TypeMoniker typeMoniker) {
+ this.beanTypeMoniker = typeMoniker;
+ }
+ public TypeMoniker getBeanTypeMoniker() {
+ return beanTypeMoniker;
+ }
+ public List<MemberInfo> getMembers() {
+ return members;
+ }
+ public void setMembers(List<MemberInfo> members) {
+ this.members = members;
+ }
+ public void addMember(MemberInfo member) {
+ if (members == null)
+ members = new ArrayList<MemberInfo>();
+ members.add(member);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/FaultInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,105 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+
+
+import com.sun.istack.tools.APTTypeVisitor;
+
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.ArrayType;
+import com.sun.mirror.type.ClassType;
+import com.sun.mirror.type.DeclaredType;
+import com.sun.mirror.type.InterfaceType;
+import com.sun.mirror.type.PrimitiveType;
+import com.sun.mirror.type.ReferenceType;
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.type.TypeVariable;
+import com.sun.mirror.type.VoidType;
+import com.sun.mirror.type.WildcardType;
+import com.sun.mirror.util.Types;
+
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ *
+ * @author dkohlert
+ */
+public class MakeSafeTypeVisitor extends APTTypeVisitor<TypeMirror, Types> implements WebServiceConstants {
+ TypeDeclaration collectionDecl;
+ TypeDeclaration mapDecl;
+
+ /**
+ * Creates a new instance of MakeSafeTypeVisitor
+ */
+ public MakeSafeTypeVisitor(AnnotationProcessorEnvironment apEnv) {
+ collectionDecl = apEnv.getTypeDeclaration(COLLECTION_CLASSNAME);
+ mapDecl = apEnv.getTypeDeclaration(MAP_CLASSNAME);
+ }
+
+ protected TypeMirror onArrayType(ArrayType type, Types apTypes) {
+ return apTypes.getErasure(type);
+ }
+
+ protected TypeMirror onPrimitiveType(PrimitiveType type, Types apTypes) {
+ return apTypes.getErasure(type);
+ }
+
+ protected TypeMirror onClassType(ClassType type, Types apTypes) {
+ return processDeclaredType(type, apTypes);
+ }
+
+ protected TypeMirror onInterfaceType(InterfaceType type, Types apTypes) {
+ return processDeclaredType(type, apTypes);
+ }
+
+ private TypeMirror processDeclaredType(DeclaredType type, Types apTypes) {
+ if (TypeModeler.isSubtype(type.getDeclaration(), collectionDecl) ||
+ TypeModeler.isSubtype(type.getDeclaration(), mapDecl)) {
+ Collection<TypeMirror> args = type.getActualTypeArguments();
+ TypeMirror[] safeArgs = new TypeMirror[args.size()];
+ int i = 0;
+ for (TypeMirror arg : args) {
+ safeArgs[i++]= apply(arg, apTypes);
+ }
+ return apTypes.getDeclaredType(type.getDeclaration(), safeArgs);
+ }
+ return apTypes.getErasure(type);
+ }
+
+ protected TypeMirror onTypeVariable(TypeVariable type, Types apTypes) {
+ return apTypes.getErasure(type);
+ }
+
+ protected TypeMirror onVoidType(VoidType type, Types apTypes) {
+ return type;
+ }
+
+ protected TypeMirror onWildcard(WildcardType type, Types apTypes) {
+ return apTypes.getErasure(type);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MakeSafeTypeVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MemberInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MemberInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MemberInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,65 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import javax.xml.namespace.QName;
+
+import com.sun.mirror.type.TypeMirror;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class MemberInfo implements Comparable<MemberInfo> {
+ int paramIndex;
+ TypeMirror paramType;
+ String paramName;
+ QName elementName;
+
+ public MemberInfo(int paramIndex, TypeMirror paramType, String paramName,
+ QName elementName) {
+ this.paramIndex = paramIndex;
+ this.paramType = paramType;
+ this.paramName = paramName;
+ this.elementName = elementName;
+ }
+
+ public int getParamIndex() {
+ return paramIndex;
+ }
+
+ public TypeMirror getParamType() {
+ return paramType;
+ }
+
+ public String getParamName() {
+ return paramName;
+ }
+
+ public QName getElementName() {
+ return elementName;
+ }
+
+ public int compareTo(MemberInfo member) {
+ return paramName.compareTo(member.paramName);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/MemberInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/ModelBuilder.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/ModelBuilder.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/ModelBuilder.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,73 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import java.io.File;
+
+
+import java.net.URL;
+import java.util.Properties;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerException;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public interface ModelBuilder {
+ public AnnotationProcessorEnvironment getAPEnv();
+ public void createModel(TypeDeclaration d, QName modelName, String targetNamespace, String modelerClassName);
+ public void setService(Service service);
+ public void setPort(Port port);
+ public String getOperationName(String methodName);
+ public String getResponseName(String operationName);
+ public TypeMirror getHolderValueType(TypeMirror type);
+ public boolean checkAndSetProcessed(TypeDeclaration typeDecl);
+ public boolean isRemoteException(TypeDeclaration typeDecl);
+ public boolean isRemote(TypeDeclaration typeDecl);
+ public boolean canOverWriteClass(String className);
+ public void setWrapperGenerated(boolean wrapperGenerated);
+ public TypeDeclaration getTypeDeclaration(String typeName);
+ public String getSourceVersion();
+ public ProcessorEnvironment getProcessorEnvironment();
+ public File getSourceDir();
+ public String getXMLName(String javaName);
+ public void onError(String key);
+ public void onError(String key, Object[] args) throws ModelerException;
+ public void onError(SourcePosition srcPos, String key, Object[] args) throws ModelerException;
+ public void onError(Localizable msg) throws ModelerException;
+ public void onWarning(Localizable msg);
+ public void onInfo(Localizable msg);
+ public void log(String msg);
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/ModelBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeModeler.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeModeler.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeModeler.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,283 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+import org.jboss.com.sun.xml.ws.util.StringUtils;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.*;
+
+
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class TypeModeler implements WebServiceConstants {
+
+ public static TypeDeclaration getDeclaration(TypeMirror typeMirror) {
+ TypeDeclaration retDecl = null;
+ if (typeMirror instanceof DeclaredType)
+ return ((DeclaredType)typeMirror).getDeclaration();
+ return null;
+ }
+
+ public static TypeDeclaration getTypeDeclaration(TypeMirror type) {
+ TypeDeclaration typeDecl = null;
+ if (type instanceof ClassType)
+ typeDecl = ((ClassType)type).getDeclaration();
+ else
+ typeDecl = ((InterfaceType)type).getDeclaration();
+ return typeDecl;
+ }
+
+ public static Collection<InterfaceType> getSuperinterfaces(TypeMirror type) {
+ Collection<InterfaceType> interfaces = null;
+ if (type instanceof ClassType)
+ interfaces = ((ClassType)type).getSuperinterfaces();
+ else
+ interfaces = ((InterfaceType)type).getSuperinterfaces();
+ return interfaces;
+ }
+
+ public static Collection<InterfaceType> getSuperinterfaces(TypeDeclaration type) {
+ Collection<InterfaceType> interfaces = null;
+ if (type instanceof ClassDeclaration)
+ interfaces = ((ClassDeclaration)type).getSuperinterfaces();
+ else
+ interfaces = ((InterfaceDeclaration)type).getSuperinterfaces();
+ return interfaces;
+ }
+
+ public static TypeDeclaration getDeclaringClassMethod(
+ TypeMirror theClass,
+ String methodName,
+ TypeMirror[] args) {
+
+ return getDeclaringClassMethod(getDeclaration(theClass), methodName, args);
+ }
+
+ public static TypeDeclaration getDeclaringClassMethod(
+ TypeDeclaration theClass,
+ String methodName,
+ TypeMirror[] args) {
+
+ TypeDeclaration retClass = null;
+ if (theClass instanceof ClassDeclaration) {
+ ClassType superClass = ((ClassDeclaration)theClass).getSuperclass();
+ if (superClass != null)
+ retClass = getDeclaringClassMethod(superClass, methodName, args);
+ }
+ if (retClass == null) {
+ for (InterfaceType interfaceType : getSuperinterfaces(theClass))
+ retClass =
+ getDeclaringClassMethod(interfaceType, methodName, args);
+ }
+ if (retClass == null) {
+ Collection<? extends MethodDeclaration> methods;
+ methods = theClass.getMethods();
+ for (MethodDeclaration method : methods) {
+ if (method.getSimpleName().equals(methodName) &&
+ method.getDeclaringType().equals(theClass)) {
+ retClass = theClass;
+ break;
+ }
+ }
+ }
+ return retClass;
+ }
+
+ public static Collection<InterfaceType> collectInterfaces(TypeDeclaration type) {
+ Collection<InterfaceType> superInterfaces = type.getSuperinterfaces();
+ Collection<InterfaceType> interfaces = type.getSuperinterfaces();
+ for (InterfaceType interfaceType : superInterfaces) {
+ interfaces.addAll(collectInterfaces(getDeclaration(interfaceType)));
+ }
+ return interfaces;
+ }
+
+ public static boolean isSubclass(String subTypeName, String superTypeName,
+ AnnotationProcessorEnvironment env) {
+ return isSubclass(env.getTypeDeclaration(subTypeName),
+ env.getTypeDeclaration(superTypeName));
+ }
+
+ public static boolean isSubclass(
+ TypeDeclaration subType,
+ TypeDeclaration superType) {
+
+ if (subType.equals(superType))
+ return false;
+ return isSubtype(subType, superType);
+ }
+
+ public static TypeMirror getHolderValueType(
+ TypeMirror type,
+ TypeDeclaration defHolder,
+ AnnotationProcessorEnvironment env) {
+
+ TypeDeclaration typeDecl = getDeclaration(type);
+ if (typeDecl == null)
+ return null;
+
+ if (isSubtype(typeDecl, defHolder)) {
+ if (type instanceof DeclaredType) {
+ Collection<TypeMirror> argTypes = ((DeclaredType)type).getActualTypeArguments();
+ if (argTypes.size() == 1) {
+ TypeMirror mirror = argTypes.iterator().next();
+// System.out.println("argsTypes.iterator().next(): "+mirror);
+ return mirror;
+ }
+ else if (argTypes.size() == 0) {
+ FieldDeclaration member = getValueMember(typeDecl);
+ if (member != null) {
+// System.out.println("member: "+member+" getType(): "+member.getType());
+ return member.getType();
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public static FieldDeclaration getValueMember(TypeMirror classType) {
+ return getValueMember(getDeclaration(classType));
+ }
+
+ public static FieldDeclaration getValueMember(TypeDeclaration type) {
+ FieldDeclaration member = null;
+ for (FieldDeclaration field : type.getFields()){
+ if (field.getSimpleName().equals("value")) {
+ member = field;
+ break;
+ }
+ }
+ if (member == null) {
+ if (type instanceof ClassDeclaration)
+ member = getValueMember(((ClassDeclaration)type).getSuperclass());
+ }
+ return member;
+ }
+
+
+ /* is d1 a subtype of d2 */
+ public static boolean isSubtype(TypeDeclaration d1, TypeDeclaration d2) {
+ if (d1.equals(d2))
+ return true;
+ ClassDeclaration superClassDecl = null;
+ if (d1 instanceof ClassDeclaration) {
+ ClassType superClass = ((ClassDeclaration)d1).getSuperclass();
+ if (superClass != null) {
+ superClassDecl = superClass.getDeclaration();
+ if (superClassDecl.equals(d2))
+ return true;
+ }
+ }
+ for (InterfaceType superIntf : d1.getSuperinterfaces()) {
+ if (superIntf.getDeclaration().equals(d2)) {
+ return true;
+ }
+ if (isSubtype(superIntf.getDeclaration(), d2)) {
+ return true;
+ } else if (superClassDecl != null && isSubtype(superClassDecl, d2)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static Map<String,TypeMirror> getExceptionProperties(TypeMirror type) {
+ return getExceptionProperties(getDeclaration(type));
+ }
+
+ public static Map<String,TypeMirror> getExceptionProperties(TypeDeclaration type) {
+ Map<String, TypeMirror> members = new HashMap<String, TypeMirror>();
+ collectExceptionProperties(type, members);
+ return members;
+ }
+
+ public static void collectExceptionProperties(TypeMirror type, Map<String,TypeMirror> members) {
+ collectExceptionProperties(getDeclaration(type), members);
+ }
+
+ public static void collectExceptionProperties(TypeDeclaration type, Map<String,TypeMirror> members) {
+// System.out.println("type: "+type.toString());
+ Collection<? extends MethodDeclaration> methods;
+ methods = type.getMethods();
+ for (MethodDeclaration method : methods) {
+ Collection<Modifier> modifiers = method.getModifiers();
+ if (!modifiers.contains(Modifier.PUBLIC)
+ || (modifiers.contains(Modifier.FINAL) &&
+ modifiers.contains(Modifier.STATIC))
+ || modifiers.contains(Modifier.TRANSIENT)) { // no final static, transient, non-public
+ continue;
+ }
+ String name = method.getSimpleName();
+ if (name.length() <= 3 && !name.startsWith(IS_PREFIX) ||
+ skipProperties.contains(name)) {
+ // Optimization. Don't bother with invalid propertyNames.
+ continue;
+ }
+ TypeMirror resultType = method.getReturnType();
+ Collection<ParameterDeclaration> params = method.getParameters();
+ if (params.size() == 0) {
+ if (name.startsWith(GET_PREFIX) &&
+ !(resultType instanceof PrimitiveType &&
+ ((PrimitiveType)resultType).getKind() == PrimitiveType.Kind.BOOLEAN)) {
+ // Simple getter
+// System.out.println("exception property: "+ StringUtils.decapitalize(name.substring(3)));
+ members.put(StringUtils.decapitalize(name.substring(3)), resultType);
+ } else if (resultType instanceof PrimitiveType &&
+ ((PrimitiveType)resultType).getKind() == PrimitiveType.Kind.BOOLEAN &&
+ name.startsWith(IS_PREFIX)) {
+ // Boolean getter
+// System.out.println("exception property: "+ StringUtils.decapitalize(name.substring(2)));
+ members.put(StringUtils.decapitalize(name.substring(2)), resultType);
+ }
+ }
+ }
+// System.out.println("type class: "+type.getClass().toString());
+ if (type instanceof ClassDeclaration && ((ClassDeclaration)type).getSuperclass() != null) {
+ collectExceptionProperties(((ClassDeclaration)type).getSuperclass(), members);
+ }
+ for (InterfaceType intfType : getSuperinterfaces(type)) {
+ collectExceptionProperties(intfType, members);
+ }
+ }
+
+ private static Set<String> skipProperties = new HashSet<String> ();
+ static{
+ skipProperties.add("getCause");
+ skipProperties.add("getLocalizedMessage");
+ skipProperties.add("getClass");
+ skipProperties.add("getStackTrace");
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeModeler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMoniker.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMoniker.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMoniker.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,36 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+
+/**
+ *
+ * @author dkohlert
+ */
+public interface TypeMoniker {
+
+ public TypeMirror create(AnnotationProcessorEnvironment apEnv);
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMoniker.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMonikerFactory.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMonikerFactory.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMonikerFactory.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,108 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.*;
+import com.sun.mirror.util.Types;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+
+import java.util.Collection;
+import java.util.ArrayList;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+
+/**
+ *
+ * @author dkohlert
+ */
+public class TypeMonikerFactory {
+
+ public static TypeMoniker getTypeMoniker(TypeMirror typeMirror) {
+ if (typeMirror instanceof PrimitiveType)
+ return new PrimitiveTypeMoniker((PrimitiveType)typeMirror);
+ else if (typeMirror instanceof ArrayType)
+ return new ArrayTypeMoniker((ArrayType)typeMirror);
+ else if (typeMirror instanceof DeclaredType)
+ return new DeclaredTypeMoniker((DeclaredType)typeMirror);
+ return getTypeMoniker(typeMirror.toString());
+ }
+
+ public static TypeMoniker getTypeMoniker(String typeName) {
+ return new StringMoniker(typeName);
+ }
+
+ static class ArrayTypeMoniker implements TypeMoniker {
+ private TypeMoniker arrayType;
+
+ public ArrayTypeMoniker(ArrayType type) {
+ arrayType = TypeMonikerFactory.getTypeMoniker(type.getComponentType());
+ }
+
+ public TypeMirror create(AnnotationProcessorEnvironment apEnv) {
+ return apEnv.getTypeUtils().getArrayType(arrayType.create(apEnv));
+ }
+ }
+ static class DeclaredTypeMoniker implements TypeMoniker {
+ private String typeDeclName;
+ private Collection<TypeMoniker> typeArgs = new ArrayList<TypeMoniker>();
+
+ public DeclaredTypeMoniker(DeclaredType type) {
+ typeDeclName = type.getDeclaration().getQualifiedName();
+ for (TypeMirror arg : type.getActualTypeArguments())
+ typeArgs.add(TypeMonikerFactory.getTypeMoniker(arg));
+ }
+
+ public TypeMirror create(AnnotationProcessorEnvironment apEnv) {
+ TypeDeclaration typeDecl = apEnv.getTypeDeclaration(typeDeclName);
+ TypeMirror[] tmpArgs = new TypeMirror[typeArgs.size()];
+ int idx = 0;
+ for (TypeMoniker moniker : typeArgs)
+ tmpArgs[idx++] = moniker.create(apEnv);
+
+ return apEnv.getTypeUtils().getDeclaredType(typeDecl, tmpArgs);
+ }
+ }
+ static class PrimitiveTypeMoniker implements TypeMoniker {
+ private PrimitiveType.Kind kind;
+
+ public PrimitiveTypeMoniker(PrimitiveType type) {
+ kind = type.getKind();
+ }
+
+ public TypeMirror create(AnnotationProcessorEnvironment apEnv) {
+ return apEnv.getTypeUtils().getPrimitiveType(kind);
+ }
+ }
+ static class StringMoniker implements TypeMoniker {
+ private String typeName;
+
+ public StringMoniker(String typeName) {
+ this.typeName = typeName;
+ }
+
+ public TypeMirror create(AnnotationProcessorEnvironment apEnv) {
+ return apEnv.getTypeUtils().getDeclaredType(apEnv.getTypeDeclaration(typeName));
+ }
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/TypeMonikerFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceAP.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceAP.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceAP.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,493 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.Messager;
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.declaration.TypeParameterDeclaration;
+import com.sun.mirror.type.ClassType;
+import com.sun.mirror.type.InterfaceType;
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.util.SourcePosition;
+import com.sun.tools.xjc.api.JavaCompiler;
+import com.sun.tools.xjc.api.Reference;
+import com.sun.tools.xjc.api.XJC;
+
+import javax.jws.WebService;
+import javax.xml.namespace.QName;
+import javax.xml.ws.WebServiceProvider;
+
+import org.jboss.com.sun.tools.ws.ToolVersion;
+import org.jboss.com.sun.tools.ws.processor.ProcessorNotificationListener;
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.generator.GeneratorUtil;
+import org.jboss.com.sun.tools.ws.processor.generator.Names;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.ModelProperties;
+import org.jboss.com.sun.tools.ws.processor.model.Operation;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBModel;
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerException;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.AnnotationProcessorContext.SEIContext;
+import org.jboss.com.sun.tools.ws.processor.util.ClientProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.util.ToolBase;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+import org.jboss.com.sun.xml.ws.util.localization.LocalizableMessage;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+
+
+/**
+ * WebServiceAP is a APT AnnotationProcessor for processing javax.jws.* and
+ * javax.xml.ws.* annotations. This class is used either by the WsGen (CompileTool) tool or
+ * idirectly via the {@link org.jboss.com.sun.istack.ws.WSAP WSAP} when invoked by APT.
+ *
+ * @author WS Development Team
+ */
+public class WebServiceAP extends ToolBase implements AnnotationProcessor, ModelBuilder, WebServiceConstants,
+ ProcessorNotificationListener {
+
+ protected AnnotationProcessorEnvironment apEnv;
+ protected ProcessorEnvironment env;
+
+ private File sourceDir;
+
+ // the model being build
+ private Model model;
+
+ private TypeDeclaration remoteDecl;
+ private TypeDeclaration remoteExceptionDecl;
+ private TypeDeclaration exceptionDecl;
+ private TypeDeclaration defHolderDecl;
+ private Service service;
+ private Port port;
+ protected AnnotationProcessorContext context;
+ private Set<TypeDeclaration> processedTypeDecls = new HashSet<TypeDeclaration>();
+ protected Messager messager;
+ private ByteArrayOutputStream output;
+ private ToolBase tool;
+ private boolean doNotOverWrite = false;
+ private boolean wrapperGenerated = false;
+ /*
+ * Is this invocation from APT or JavaC?
+ */
+ private boolean isAPTInvocation = false;
+
+
+ public void run() {
+ }
+
+ protected boolean parseArguments(String[] args) {
+ return true;
+ }
+
+ public WebServiceAP(ToolBase tool, ProcessorEnvironment env, Properties options, AnnotationProcessorContext context) {
+ super(System.out, "WebServiceAP");
+ this.context = context;
+ this.tool = tool;
+ this.env = env;
+ if (options != null) {
+ sourceDir = new File(options.getProperty(ProcessorOptions.SOURCE_DIRECTORY_PROPERTY));
+ String key = ProcessorOptions.DONOT_OVERWRITE_CLASSES;
+ this.doNotOverWrite =
+ Boolean.valueOf(options.getProperty(key));
+ }
+ }
+
+ public void init(AnnotationProcessorEnvironment apEnv) {
+ this.apEnv = apEnv;
+ remoteDecl = this.apEnv.getTypeDeclaration(REMOTE_CLASSNAME);
+ remoteExceptionDecl = this.apEnv.getTypeDeclaration(REMOTE_EXCEPTION_CLASSNAME);
+ exceptionDecl = this.apEnv.getTypeDeclaration(EXCEPTION_CLASSNAME);
+ defHolderDecl = this.apEnv.getTypeDeclaration(HOLDER_CLASSNAME);
+
+ if (env == null) {
+ Map<String, String> apOptions = apEnv.getOptions();
+ output = new ByteArrayOutputStream();
+ String classDir = apOptions.get("-d");
+ if (classDir == null)
+ classDir = ".";
+ if (apOptions.get("-s") != null)
+ sourceDir = new File(apOptions.get("-s"));
+ else
+ sourceDir = new File(classDir);
+ String cp = apOptions.get("-classpath");
+ String cpath = classDir +
+ File.pathSeparator +
+ cp + File.pathSeparator +
+ System.getProperty("java.class.path");
+ env = new ClientProcessorEnvironment(output, cpath, this);
+ ((ClientProcessorEnvironment) env).setNames(new Names());
+ boolean setVerbose = false;
+ for (String key : apOptions.keySet()) {
+ if (key.equals("-verbose"))
+ setVerbose=true;
+ }
+ if (setVerbose) {
+ env.setFlags(ProcessorEnvironment.F_VERBOSE);
+ }
+ messager = apEnv.getMessager();
+ isAPTInvocation = true;
+ }
+ env.setFiler(apEnv.getFiler());
+ }
+
+ public AnnotationProcessorEnvironment getAPEnv() {
+ return apEnv;
+ }
+
+ public ProcessorEnvironment getEnvironment() {
+ return env;
+ }
+
+ public ProcessorEnvironment getProcessorEnvironment() {
+ return env;
+ }
+
+ public File getSourceDir() {
+ return sourceDir;
+ }
+
+ public void onError(String key) {
+ onError(new LocalizableMessage(getResourceBundleName(), key));
+ }
+
+ public void onError(String key, Object[] args) throws ModelerException {
+ onError(null, key, args);
+ }
+
+ public void onError(SourcePosition pos, String key, Object[] args) throws ModelerException {
+ onError(pos, new LocalizableMessage(getResourceBundleName(), key, args));
+ }
+
+ public void onError(Localizable msg) throws ModelerException {
+ onError(null, msg);
+ }
+
+ public void onError(SourcePosition pos, Localizable msg) throws ModelerException {
+ if (messager != null) {
+ messager.printError(pos, localizer.localize(msg));
+ } else {
+ throw new ModelerException(msg);
+ }
+ }
+
+ public void onWarning(String key) {
+ onWarning(new LocalizableMessage(getResourceBundleName(), key));
+ }
+
+ public void onWarning(Localizable msg) {
+ String message = localizer.localize(getMessage("webserviceap.warning", localizer.localize(msg)));
+ if (messager != null) {
+ messager.printWarning(message);
+ } else {
+ report(message);
+ }
+ }
+ public void onInfo(Localizable msg) {
+ if (messager != null) {
+ String message = localizer.localize(msg);
+ messager.printNotice(message);
+ } else {
+ String message = localizer.localize(getMessage("webserviceap.info", localizer.localize(msg)));
+ report(message);
+ }
+ }
+
+ public void process() {
+ if (context.getRound() == 1) {
+ buildModel();
+ }
+ if (!wrapperGenerated || // the wrappers already exist
+ context.getRound() == 2 ||
+ context.allEncoded()) {
+ if ((context.getRound() == 2 || !wrapperGenerated) && !context.isModelCompleted()) {
+ completeModel();
+ context.setModelCompleted(true);
+ }
+ try {
+ for (SEIContext seiContext : context.getSEIContexts()) {
+ if (!seiContext.getModelCompiled()) {
+ runProcessorActions(seiContext.getModel());
+ seiContext.setModelCompiled(true);
+ }
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ } finally {
+ if (messager != null && output != null && output.size() > 0) {
+ messager.printNotice(output.toString());
+ }
+ }
+ }
+ context.incrementRound();
+ }
+
+ public boolean checkAndSetProcessed(TypeDeclaration typeDecl) {
+ if (!processedTypeDecls.contains(typeDecl)) {
+ processedTypeDecls.add(typeDecl);
+ return false;
+ }
+ return true;
+ }
+
+ public void clearProcessed() {
+ processedTypeDecls.clear();
+ }
+
+ protected void runProcessorActions(Model model) throws Exception {
+ if (tool != null)
+ tool.runProcessorActions();
+ }
+
+
+ protected String getGenericErrorMessage() {
+ return "webserviceap.error";
+ }
+
+ protected String getResourceBundleName() {
+ return "org.jboss.com.sun.tools.ws.resources.webserviceap";
+ }
+
+ public void createModel(TypeDeclaration d, QName modelName, String targetNamespace,
+ String modelerClassName){
+
+ SEIContext seiContext = context.getSEIContext(d);
+ if (seiContext.getModel() != null) {
+ onError("webserviceap.model.already.exists");
+ return;
+ }
+ log("creating model: " + modelName);
+ model = new Model(modelName);
+ model.setTargetNamespaceURI(targetNamespace);
+ model.setProperty(
+ ModelProperties.PROPERTY_MODELER_NAME,
+ modelerClassName);
+ seiContext.setModel(model);
+ }
+
+ public void setService(Service service) {
+ this.service = service;
+ model.addService(service);
+ }
+
+ public void setPort(Port port) {
+ this.port = port;
+ service.addPort(port);
+ }
+
+ public void addOperation(Operation operation) {
+ port.addOperation(operation);
+ }
+
+ public void setWrapperGenerated(boolean wrapperGenerated) {
+ this.wrapperGenerated = wrapperGenerated;
+ }
+
+ public TypeDeclaration getTypeDeclaration(String typeName) {
+ return apEnv.getTypeDeclaration(typeName);
+ }
+
+ public String getSourceVersion() {
+ return ToolVersion.VERSION.MAJOR_VERSION;
+ }
+
+ private void buildModel() {
+ WebService webService;
+ WebServiceProvider webServiceProvider = null;
+ WebServiceVisitor wrapperGenerator = createWrapperGenerator();
+ boolean processedEndpoint = false;
+ for (TypeDeclaration typedecl: apEnv.getTypeDeclarations()) {
+ if (!(typedecl instanceof ClassDeclaration))
+ continue;
+ webServiceProvider = typedecl.getAnnotation(WebServiceProvider.class);
+ webService = typedecl.getAnnotation(WebService.class);
+ if (webServiceProvider != null) {
+ if (webService != null) {
+ onError("webserviceap.webservice.and.webserviceprovider",
+ new Object[] {typedecl.getQualifiedName()});
+ }
+ processedEndpoint = true;
+ }
+ if (!shouldProcessWebService(webService))
+ continue;
+ typedecl.accept(wrapperGenerator);
+ processedEndpoint = true;
+ }
+ if (!processedEndpoint) {
+ if (isAPTInvocation)
+ onWarning("webserviceap.no.webservice.endpoint.found");
+ else
+ onError("webserviceap.no.webservice.endpoint.found");
+ }
+ }
+
+ protected WebServiceVisitor createWrapperGenerator() {
+ return new WebServiceWrapperGenerator(this, context);
+ }
+
+ protected WebServiceVisitor createReferenceCollector() {
+ return new WebServiceReferenceCollector(this, context);
+ }
+
+ protected boolean shouldProcessWebService(WebService webService) {
+ return webService != null;
+ }
+
+
+ private void completeModel() {
+ clearProcessed();
+ JavaCompiler javaC = XJC.createJavaCompiler();
+ JAXBModel jaxBModel;
+ WebServiceVisitor referenceCollector = createReferenceCollector();
+ for (SEIContext seiContext : context.getSEIContexts()) {
+ log("completing model for endpoint: "+seiContext.getSEIImplName());
+ TypeDeclaration decl = apEnv.getTypeDeclaration(seiContext.getSEIImplName());
+ if (decl == null)
+ onError("webserviceap.could.not.find.typedecl",
+ new Object[] {seiContext.getSEIImplName(), context.getRound()});
+ decl.accept(referenceCollector);
+ }
+ clearProcessed();
+ for (SEIContext seiContext : context.getSEIContexts()) {
+ TypeDeclaration decl = apEnv.getTypeDeclaration(seiContext.getSEIName());
+ Collection<Reference> schemaMirrors = seiContext.getSchemaReferences(this);
+
+// System.out.println("schemaMirrors count: " + schemaMirrors.size());
+// for (Reference reference : schemaMirrors) {System.out.println("reference: "+reference.type);}
+// System.out.println("schemaElementMap count: "+ seiContext.getSchemaElementMap(this).entrySet().size());
+// for (Map.Entry<QName, ? extends Reference> entry : seiContext.getSchemaElementMap(this).entrySet()) {
+// System.out.println("name: " + entry.getKey()+" value: "+entry.getValue().type);
+// }
+
+// System.out.println("setting default namespaceURI: "+seiContext.getNamespaceURI());
+ jaxBModel = new JAXBModel(javaC.bind(schemaMirrors, seiContext.getSchemaElementMap(this),
+ seiContext.getNamespaceURI(), apEnv));
+// for (JAXBMapping map : jaxBModel.getMappings()) {System.out.println("map.getClazz: "+map.getClazz());}
+ seiContext.setJAXBModel(jaxBModel);
+ }
+ }
+
+ public boolean isException(TypeDeclaration typeDecl) {
+ return isSubtype(typeDecl, exceptionDecl);
+ }
+
+ public boolean isRemoteException(TypeDeclaration typeDecl) {
+ return isSubtype(typeDecl, remoteExceptionDecl);
+ }
+
+ public boolean isRemote(TypeDeclaration typeDecl) {
+ return isSubtype(typeDecl, remoteDecl);
+ }
+
+
+ public static boolean isSubtype(TypeDeclaration d1, TypeDeclaration d2) {
+ if (d1.equals(d2))
+ return true;
+ ClassDeclaration superClassDecl = null;
+ if (d1 instanceof ClassDeclaration) {
+ ClassType superClass = ((ClassDeclaration)d1).getSuperclass();
+ if (superClass != null) {
+ superClassDecl = superClass.getDeclaration();
+ if (superClassDecl.equals(d2))
+ return true;
+ }
+ }
+ InterfaceDeclaration superIntf = null;
+ for (InterfaceType interfaceType : d1.getSuperinterfaces()) {
+ superIntf = interfaceType.getDeclaration();
+ if (superIntf.equals(d2))
+ return true;
+ }
+ if (superIntf != null && isSubtype(superIntf, d2)) {
+ return true;
+ } else if (superClassDecl != null && isSubtype(superClassDecl, d2)) {
+ return true;
+ }
+ return false;
+ }
+
+
+ public static String getMethodSig(MethodDeclaration method) {
+ StringBuffer buf = new StringBuffer(method.getSimpleName() + "(");
+ Iterator<TypeParameterDeclaration> params = method.getFormalTypeParameters().iterator();
+ TypeParameterDeclaration param;
+ for (int i =0; params.hasNext(); i++) {
+ if (i > 0)
+ buf.append(", ");
+ param = params.next();
+ buf.append(param.getSimpleName());
+ }
+ buf.append(")");
+ return buf.toString();
+ }
+
+ public String getOperationName(String messageName) {
+ return messageName;
+ }
+
+ public String getResponseName(String operationName) {
+ return Names.getResponseName(operationName);
+ }
+
+
+ public TypeMirror getHolderValueType(TypeMirror type) {
+ return TypeModeler.getHolderValueType(type, defHolderDecl, apEnv);
+ }
+
+ public boolean canOverWriteClass(String className) {
+ return !((doNotOverWrite && GeneratorUtil.classExists(env, className)));
+ }
+
+ public void log(String msg) {
+ if (env != null && env.verbose()) {
+ String message = "[" + msg + "]";
+ if (messager != null) {
+ messager.printNotice(message);
+ } else {
+ System.out.println(message);
+ }
+ }
+ }
+
+ public String getXMLName(String javaName) {
+ return javaName;
+ }
+}
+
+
+
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceAP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceConstants.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceConstants.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceConstants.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,92 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+
+import javax.xml.ws.Holder;
+/**
+ *
+ * @author dkohlert
+ */
+public interface WebServiceConstants { //extends RmiConstants {
+
+ public static final String RETURN = "return";
+ public static final String RETURN_CAPPED = "Return";
+ public static final String RETURN_VALUE = "_return";
+ public static final String SERVICE = "Service";
+ public static final String PD = ".";
+ public static final String JAXWS = "jaxws";
+ public static final String JAXWS_PACKAGE_PD = JAXWS+PD;
+ public static final String PD_JAXWS_PACKAGE_PD = PD+JAXWS+PD;
+ public static final String BEAN = "Bean";
+ public static final String GET_PREFIX = "get";
+ public static final String IS_PREFIX = "is";
+ public static final String FAULT_INFO = "faultInfo";
+ public static final String GET_FAULT_INFO = "getFaultInfo";
+ public static final String HTTP_PREFIX = "http://";
+ public static final String JAVA_LANG_OBJECT = "java.lang.Object";
+ public static final String EMTPY_NAMESPACE_ID = "";
+
+
+ public static final char SIGC_INNERCLASS = '$';
+ public static final char SIGC_UNDERSCORE = '_';
+
+ public static final String DOT = ".";
+ public static final String PORT = "Port";
+ public static final String BINDING = "Binding";
+ public static final String RESPONSE = "Response";
+
+ /*
+ * Identifiers potentially useful for all Generators
+ */
+ public static final String EXCEPTION_CLASSNAME =
+ java.lang.Exception.class.getName();
+ public static final String REMOTE_CLASSNAME =
+ java.rmi.Remote.class.getName();
+ public static final String REMOTE_EXCEPTION_CLASSNAME =
+ java.rmi.RemoteException.class.getName();
+ public static final String RUNTIME_EXCEPTION_CLASSNAME =
+ java.lang.RuntimeException.class.getName();
+ public static final String SERIALIZABLE_CLASSNAME =
+ java.io.Serializable.class.getName();
+ public static final String HOLDER_CLASSNAME =
+ javax.xml.ws.Holder.class.getName();
+ public static final String COLLECTION_CLASSNAME =
+ java.util.Collection.class.getName();
+ public static final String MAP_CLASSNAME =
+ java.util.Map.class.getName();
+
+
+ // 181 constants
+ public static final String WEBSERVICE_NAMESPACE = "http://www.bea.com/xml/ns/jws";
+ public static final String HANDLER_CONFIG = "handler-config";
+ public static final String HANDLER_CHAIN = "handler-chain";
+ public static final String HANDLER_CHAIN_NAME = "handler-chain-name";
+ public static final String HANDLER = "handler";
+ public static final String HANDLER_NAME = "handler-name";
+ public static final String HANDLER_CLASS = "handler-class";
+ public static final String INIT_PARAM = "init-param";
+ public static final String SOAP_ROLE = "soap-role";
+ public static final String SOAP_HEADER = "soap-header";
+ public static final String PARAM_NAME = "param-name";
+ public static final String PARAM_VALUE = "param-value";
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceConstants.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceReferenceCollector.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceReferenceCollector.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceReferenceCollector.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,85 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import com.sun.mirror.apt.*;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.*;
+
+import com.sun.tools.xjc.api.*;
+
+import javax.jws.*;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public class WebServiceReferenceCollector extends WebServiceVisitor {
+
+ public WebServiceReferenceCollector(ModelBuilder builder, AnnotationProcessorContext context) {
+ super(builder, context);
+ }
+
+
+ protected void processWebService(WebService webService, TypeDeclaration d) {
+ }
+
+ protected void processMethod(MethodDeclaration method, WebMethod webMethod) {
+ boolean isOneway = method.getAnnotation(Oneway.class) != null;
+ boolean generatedWrapper = false;
+ builder.log("WebServiceReferenceCollector - method: "+method);
+ collectTypes(method, webMethod, seiContext.getReqOperationWrapper(method) != null);
+ if (seiContext.getReqOperationWrapper(method) != null) {
+ AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
+ TypeDeclaration typeDecl;
+ typeDecl = builder.getTypeDeclaration(seiContext.getReqOperationWrapper(method).getWrapperName());
+ seiContext.addReference(typeDecl, apEnv);
+ if (!isOneway) {
+ typeDecl = builder.getTypeDeclaration(seiContext.getResOperationWrapper(method).getWrapperName());
+ seiContext.addReference(typeDecl, apEnv);
+ }
+ }
+ collectExceptionBeans(method);
+ }
+
+ private void collectTypes(MethodDeclaration method, WebMethod webMethod, boolean isDocLitWrapped) {
+ addSchemaElements(method, isDocLitWrapped);
+ }
+
+
+ private void collectExceptionBeans(MethodDeclaration method) {
+ AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
+ for (ReferenceType thrownType : method.getThrownTypes()) {
+ FaultInfo faultInfo = seiContext.getExceptionBeanName(thrownType.toString());
+ if (faultInfo != null) {
+ if (!faultInfo.isWSDLException()) {
+ seiContext.addReference(builder.getTypeDeclaration(faultInfo.getBeanName()), apEnv);
+ } else {
+ TypeMirror bean = faultInfo.beanTypeMoniker.create(apEnv);
+ Reference ref = seiContext.addReference(((DeclaredType)bean).getDeclaration(), apEnv);
+ seiContext.addSchemaElement(faultInfo.getElementName(), ref);
+ }
+ }
+ }
+ }
+}
+
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceReferenceCollector.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceVisitor.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceVisitor.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceVisitor.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,908 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.declaration.ConstructorDeclaration;
+import com.sun.mirror.declaration.Declaration;
+import com.sun.mirror.declaration.FieldDeclaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.Modifier;
+import com.sun.mirror.declaration.PackageDeclaration;
+import com.sun.mirror.declaration.ParameterDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+import com.sun.mirror.type.ClassType;
+import com.sun.mirror.type.DeclaredType;
+import com.sun.mirror.type.InterfaceType;
+import com.sun.mirror.type.ReferenceType;
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.type.VoidType;
+import com.sun.mirror.util.DeclarationVisitor;
+import com.sun.mirror.util.SimpleDeclarationVisitor;
+import com.sun.mirror.util.SourcePosition;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.Stack;
+import java.util.StringTokenizer;
+
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+
+import javax.jws.HandlerChain;
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.ParameterStyle;
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.model.Parameter;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaSimpleType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+import org.jboss.com.sun.tools.ws.processor.modeler.JavaSimpleTypeCreator;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.AnnotationProcessorContext;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.ModelBuilder;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.WebServiceConstants;
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.AnnotationProcessorContext.SEIContext;
+import org.jboss.com.sun.tools.ws.util.ClassNameInfo;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPStyle;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPUse;
+import org.jboss.com.sun.xml.ws.modeler.RuntimeModeler;
+
+import com.sun.tools.xjc.api.Reference;
+
+/**
+ *
+ * @author WS Development Team
+ */
+public abstract class WebServiceVisitor extends SimpleDeclarationVisitor implements WebServiceConstants {
+ protected ModelBuilder builder;
+ protected String wsdlNamespace;
+ protected String typeNamespace;
+ protected Stack<SOAPBinding> soapBindingStack;
+ protected SOAPBinding typeDeclSOAPBinding;
+ protected SOAPUse soapUse = SOAPUse.LITERAL;
+ protected SOAPStyle soapStyle = SOAPStyle.DOCUMENT;
+ protected boolean wrapped = true;
+ protected HandlerChain hChain;
+ protected Port port;
+ protected String serviceImplName;
+ protected String endpointInterfaceName;
+ protected AnnotationProcessorContext context;
+ protected SEIContext seiContext;
+ protected boolean processingSEI = false;
+ protected String serviceName;
+ protected String packageName;
+ protected String portName;
+ protected boolean endpointReferencesInterface = false;
+ protected boolean hasWebMethods = false;
+ protected JavaSimpleTypeCreator simpleTypeCreator;
+ protected TypeDeclaration typeDecl;
+ protected Set<String> processedMethods;
+ protected boolean pushedSOAPBinding = false;
+ protected static final String ANNOTATION_ELEMENT_ERROR = "webserviceap.endpointinteface.plus.element";
+
+
+
+ public WebServiceVisitor(ModelBuilder builder, AnnotationProcessorContext context) {
+ this.builder = builder;
+ this.context = context;
+ this.simpleTypeCreator = new JavaSimpleTypeCreator();
+ soapBindingStack = new Stack<SOAPBinding>();
+ processedMethods = new HashSet<String>();
+ }
+
+ public void visitInterfaceDeclaration(InterfaceDeclaration d) {
+ WebService webService = (WebService)d.getAnnotation(WebService.class);
+ if (!shouldProcessWebService(webService, d))
+ return;
+ if (builder.checkAndSetProcessed(d))
+ return;
+ typeDecl = d;
+ if (endpointInterfaceName != null && !endpointInterfaceName.equals(d.getQualifiedName())) {
+ builder.onError(d.getPosition(), "webserviceap.endpointinterfaces.do.not.match", new Object[]
+ {endpointInterfaceName, d.getQualifiedName()});
+ }
+ verifySEIAnnotations(webService, d);
+ endpointInterfaceName = d.getQualifiedName();
+ processingSEI = true;
+ preProcessWebService(webService, d);
+ processWebService(webService, d);
+ postProcessWebService(webService, d);
+ }
+
+ public void visitClassDeclaration(ClassDeclaration d) {
+ WebService webService = d.getAnnotation(WebService.class);
+ if (!shouldProcessWebService(webService, d))
+ return;
+ if (builder.checkAndSetProcessed(d))
+ return;
+ typeDeclSOAPBinding = d.getAnnotation(SOAPBinding.class);
+ typeDecl = d;
+ if (serviceImplName == null)
+ serviceImplName = d.getQualifiedName();
+ String endpointInterfaceName = webService != null ? webService.endpointInterface() : null;
+ if (endpointInterfaceName != null && endpointInterfaceName.length() > 0) {
+ SourcePosition pos = pos = d.getPosition();
+ checkForInvalidImplAnnotation(d, SOAPBinding.class);
+ if (webService.name().length() > 0)
+ annotationError(pos, ANNOTATION_ELEMENT_ERROR,"name");
+ endpointReferencesInterface = true;
+ verifyImplAnnotations(d);
+ inspectEndpointInterface(endpointInterfaceName, d);
+ serviceImplName = null;
+ return;
+ }
+ processingSEI = false;
+ preProcessWebService(webService, d);
+ processWebService(webService, d);
+ serviceImplName = null;
+ postProcessWebService(webService, d);
+ serviceImplName = null;
+ }
+
+ protected void verifySEIAnnotations(WebService webService, InterfaceDeclaration d) {
+ if (webService.endpointInterface().length() > 0) {
+ builder.onError(d.getPosition(), "webservicefactory.endpointinterface.on.interface",
+ new Object[] {d.getQualifiedName(), webService.endpointInterface()});
+ }
+ if (webService.serviceName().length() > 0) {
+ builder.onError(d.getPosition(), "webserviceap.invalid.sei.annotation.element",
+ new Object[] {"serviceName", d.getQualifiedName()});
+ }
+ if (webService.portName().length() > 0) {
+ builder.onError(d.getPosition(), "webserviceap.invalid.sei.annotation.element",
+ new Object[] {"portName", d.getQualifiedName()});
+ }
+ }
+
+ protected void verifyImplAnnotations(ClassDeclaration d) {
+ for (MethodDeclaration method : d.getMethods()) {
+ checkForInvalidImplAnnotation(method, WebMethod.class);
+ checkForInvalidImplAnnotation(method, Oneway.class);
+ checkForInvalidImplAnnotation(method, WebResult.class);
+ for (ParameterDeclaration param : method.getParameters()) {
+ checkForInvalidImplAnnotation(param, WebParam.class);
+ }
+ }
+ }
+
+ protected void checkForInvalidSEIAnnotation(InterfaceDeclaration d, Class annotationClass) {
+ Object annotation = d.getAnnotation(annotationClass);
+ if (annotation != null) {
+ SourcePosition pos = d.getPosition();
+ annotationError(pos, "webserviceap.invalid.sei.annotation",
+ new Object[] {annotationClass.getName(), d.getQualifiedName()});
+ }
+ }
+
+ protected void checkForInvalidImplAnnotation(Declaration d, Class annotationClass) {
+ Object annotation = d.getAnnotation(annotationClass);
+ if (annotation != null) {
+ SourcePosition pos = d.getPosition();
+ annotationError(pos, "webserviceap.endpointinteface.plus.annotation",
+ annotationClass.getName());
+ }
+ }
+
+ protected void annotationError(SourcePosition pos, String key, String element) {
+ annotationError(pos, key, new Object[] {element});
+ }
+
+ protected void annotationError(SourcePosition pos, String key, Object[] args) {
+ builder.onError(pos, key, args);
+ }
+
+
+ protected void preProcessWebService(WebService webService, TypeDeclaration d) {
+ seiContext = context.getSEIContext(d);
+ String targetNamespace = null;
+ if (webService != null)
+ targetNamespace = webService.targetNamespace();
+ if (targetNamespace == null || targetNamespace.length() == 0) {
+ String packageName = d.getPackage().getQualifiedName();
+ if (packageName == null || packageName.length() == 0) {
+ builder.onError(d.getPosition(), "webserviceap.no.package.class.must.have.targetnamespace",
+ new Object[] {d.getQualifiedName()});
+ }
+ targetNamespace = getNamespace(d.getPackage());
+ }
+ seiContext.setNamespaceURI(targetNamespace);
+ if (serviceImplName == null)
+ serviceImplName = seiContext.getSEIImplName();
+ if (serviceImplName != null) {
+ seiContext.setSEIImplName(serviceImplName);
+ context.addSEIContext(serviceImplName, seiContext);
+ }
+ portName = ClassNameInfo.getName(
+ d.getSimpleName().replace(
+ SIGC_INNERCLASS,
+ SIGC_UNDERSCORE));;
+ packageName = d.getPackage().getQualifiedName();
+ portName = webService != null && webService.name() != null && webService.name().length() >0 ?
+ webService.name() : portName;
+ serviceName = ClassNameInfo.getName(d.getQualifiedName())+SERVICE;
+ serviceName = webService != null && webService.serviceName() != null &&
+ webService.serviceName().length() > 0 ?
+ webService.serviceName() : serviceName;
+ wsdlNamespace = seiContext.getNamespaceURI();
+ typeNamespace = wsdlNamespace;
+
+ SOAPBinding soapBinding = d.getAnnotation(SOAPBinding.class);
+ if (soapBinding != null) {
+ pushedSOAPBinding = pushSOAPBinding(soapBinding, d, d);
+ } else if (d.equals(typeDecl)) {
+ pushedSOAPBinding = pushSOAPBinding(new MySOAPBinding(), d, d);
+ }
+ }
+
+ public static boolean sameStyle(SOAPBinding.Style style, SOAPStyle soapStyle) {
+ if (style.equals(SOAPBinding.Style.DOCUMENT) &&
+ soapStyle.equals(SOAPStyle.DOCUMENT))
+ return true;
+ if (style.equals(SOAPBinding.Style.RPC) &&
+ soapStyle.equals(SOAPStyle.RPC))
+ return true;
+ return false;
+ }
+
+ protected boolean pushSOAPBinding(SOAPBinding soapBinding, Declaration bindingDecl,
+ TypeDeclaration classDecl) {
+ boolean changed = false;
+ if (!sameStyle(soapBinding.style(), soapStyle)) {
+ changed = true;
+ if (pushedSOAPBinding)
+ builder.onError(bindingDecl.getPosition(), "webserviceap.mixed.binding.style",
+ new Object[] {classDecl.getQualifiedName()});
+ }
+ if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
+ soapStyle = SOAPStyle.RPC;
+ wrapped = true;
+ if (soapBinding.parameterStyle().equals(ParameterStyle.BARE)) {
+ builder.onError(bindingDecl.getPosition(), "webserviceap.rpc.literal.must.not.be.bare",
+ new Object[] {classDecl.getQualifiedName()});
+ }
+
+ } else {
+ soapStyle = SOAPStyle.DOCUMENT;
+ if (wrapped != soapBinding.parameterStyle().equals(ParameterStyle.WRAPPED)) {
+ wrapped = soapBinding.parameterStyle().equals(ParameterStyle.WRAPPED);
+ changed = true;
+ }
+ }
+ if (soapBinding.use().equals(SOAPBinding.Use.ENCODED)) {
+ builder.onError(bindingDecl.getPosition(), "webserviceap.rpc.encoded.not.supported",
+ new Object[] {classDecl.getQualifiedName()});
+ }
+ if (changed || soapBindingStack.empty()) {
+ soapBindingStack.push(soapBinding);
+ pushedSOAPBinding = true;
+ }
+ return changed;
+ }
+
+
+ protected SOAPBinding popSOAPBinding() {
+ if (pushedSOAPBinding)
+ soapBindingStack.pop();
+ SOAPBinding soapBinding = null;
+ if (!soapBindingStack.empty()) {
+ soapBinding = soapBindingStack.peek();
+ if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
+ soapStyle = SOAPStyle.RPC;
+ wrapped = true;
+ } else {
+ soapStyle = SOAPStyle.DOCUMENT;
+ wrapped = soapBinding.parameterStyle().equals(ParameterStyle.WRAPPED);
+ }
+ }
+ return soapBinding;
+ }
+
+ protected String getNamespace(PackageDeclaration packageDecl) {
+ return RuntimeModeler.getNamespace(packageDecl.getQualifiedName());
+ }
+
+// abstract protected boolean shouldProcessWebService(WebService webService, InterfaceDeclaration intf);
+
+// abstract protected boolean shouldProcessWebService(WebService webService, ClassDeclaration decl);
+ protected boolean shouldProcessWebService(WebService webService, InterfaceDeclaration intf) {
+ hasWebMethods = false;
+ if (webService == null)
+ builder.onError(intf.getPosition(), "webserviceap.endpointinterface.has.no.webservice.annotation",
+ new Object[] {intf.getQualifiedName()});
+ if (isLegalSEI(intf))
+ return true;
+ return false;
+ }
+
+ protected boolean shouldProcessWebService(WebService webService, ClassDeclaration classDecl) {
+ if (webService == null)
+ return false;
+ hasWebMethods = hasWebMethods(classDecl);
+ return isLegalImplementation(webService, classDecl);
+ }
+
+ abstract protected void processWebService(WebService webService, TypeDeclaration d);
+
+ protected void postProcessWebService(WebService webService, InterfaceDeclaration d) {
+ processMethods(d);
+ popSOAPBinding();
+ }
+
+ protected void postProcessWebService(WebService webService, ClassDeclaration d) {
+ processMethods(d);
+ popSOAPBinding();
+ }
+
+
+ protected boolean hasWebMethods(ClassDeclaration d) {
+ if (d.getQualifiedName().equals(JAVA_LANG_OBJECT))
+ return false;
+ WebMethod webMethod;
+ for (MethodDeclaration method : d.getMethods()) {
+ webMethod = method.getAnnotation(WebMethod.class);
+ if (webMethod != null) {
+ if (webMethod.exclude()) {
+ if (webMethod.operationName().length() > 0)
+ builder.onError(method.getPosition(), "webserviceap.invalid.webmethod.element.with.exclude",
+ new Object[] {"operationName", d.getQualifiedName(), method.toString()});
+ if (webMethod.action().length() > 0)
+ builder.onError(method.getPosition(), "webserviceap.invalid.webmethod.element.with.exclude",
+ new Object[] {"action", d.getQualifiedName(), method.toString()});
+ } else {
+ return true;
+ }
+ }
+ }
+ return false;//hasWebMethods(d.getSuperclass().getDeclaration());
+ }
+
+ protected void processMethods(InterfaceDeclaration d) {
+ builder.log("ProcessedMethods Interface: "+d);
+ hasWebMethods = false;
+ for (MethodDeclaration methodDecl : d.getMethods()) {
+ methodDecl.accept((DeclarationVisitor)this);
+ }
+ for (InterfaceType superType : d.getSuperinterfaces())
+ processMethods(superType.getDeclaration());
+ }
+
+ protected void processMethods(ClassDeclaration d) {
+ builder.log("ProcessedMethods Class: "+d);
+ hasWebMethods = hasWebMethods(d);
+ if (d.getQualifiedName().equals(JAVA_LANG_OBJECT))
+ return;
+ if (d.getAnnotation(WebService.class) != null) {
+ // Super classes must have @WebService annotations to pick up their methods
+ for (MethodDeclaration methodDecl : d.getMethods()) {
+ methodDecl.accept((DeclarationVisitor)this);
+ }
+ }
+ if (d.getSuperclass() != null) {
+ processMethods(d.getSuperclass().getDeclaration());
+ }
+ }
+
+ private InterfaceDeclaration getEndpointInterfaceDecl(String endpointInterfaceName,
+ ClassDeclaration d) {
+ InterfaceDeclaration intTypeDecl = null;
+ for (InterfaceType interfaceType : d.getSuperinterfaces()) {
+ if (endpointInterfaceName.equals(interfaceType.toString())) {
+ intTypeDecl = interfaceType.getDeclaration();
+ seiContext = context.getSEIContext(intTypeDecl.getQualifiedName());
+ assert(seiContext != null);
+ seiContext.setImplementsSEI(true);
+ break;
+ }
+ }
+ if (intTypeDecl == null) {
+ intTypeDecl = (InterfaceDeclaration)builder.getTypeDeclaration(endpointInterfaceName);
+ }
+ if (intTypeDecl == null)
+ builder.onError("webserviceap.endpointinterface.class.not.found",
+ new Object[] {endpointInterfaceName});
+ return intTypeDecl;
+ }
+
+
+ private void inspectEndpointInterface(String endpointInterfaceName, ClassDeclaration d) {
+ TypeDeclaration intTypeDecl = getEndpointInterfaceDecl(endpointInterfaceName, d);
+ if (intTypeDecl != null)
+ intTypeDecl.accept((DeclarationVisitor)this);
+ }
+
+ public void visitMethodDeclaration(MethodDeclaration method) {
+ // Methods must be public
+ if (!method.getModifiers().contains(Modifier.PUBLIC))
+ return;
+ if (processedMethod(method))
+ return;
+ WebMethod webMethod = method.getAnnotation(WebMethod.class);
+ if (webMethod != null && webMethod.exclude())
+ return;
+ SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
+ if (soapBinding == null && !method.getDeclaringType().equals(typeDecl)) {
+ if (method.getDeclaringType() instanceof ClassDeclaration) {
+ soapBinding = method.getDeclaringType().getAnnotation(SOAPBinding.class);
+ if (soapBinding != null)
+ builder.log("using "+method.getDeclaringType()+"'s SOAPBinding.");
+ else {
+ soapBinding = new MySOAPBinding();
+ }
+ }
+ }
+ boolean newBinding = false;
+ if (soapBinding != null) {
+ newBinding = pushSOAPBinding(soapBinding, method, typeDecl);
+ }
+ try {
+ if (shouldProcessMethod(method, webMethod)) {
+ processMethod(method, webMethod);
+ }
+ } finally {
+ if (newBinding) {
+ popSOAPBinding();
+ }
+ }
+ }
+
+ protected boolean processedMethod(MethodDeclaration method) {
+ String id = method.toString();
+ if (processedMethods.contains(id))
+ return true;
+ processedMethods.add(id);
+ return false;
+ }
+
+
+ protected boolean shouldProcessMethod(MethodDeclaration method, WebMethod webMethod) {
+ builder.log("should process method: "+method.getSimpleName()+" hasWebMethods: "+ hasWebMethods+" ");
+ if (hasWebMethods && webMethod == null) {
+ builder.log("webMethod == null");
+ return false;
+ }
+ boolean retval = (endpointReferencesInterface ||
+ method.getDeclaringType().equals(typeDecl) ||
+ (method.getDeclaringType().getAnnotation(WebService.class) != null));
+ builder.log("endpointReferencesInterface: "+endpointReferencesInterface);
+ builder.log("declaring class has WebSevice: "+(method.getDeclaringType().getAnnotation(WebService.class) != null));
+ builder.log("returning: "+retval);
+ return retval;
+ }
+
+ abstract protected void processMethod(MethodDeclaration method, WebMethod webMethod);
+
+
+ protected boolean isLegalImplementation(WebService webService, ClassDeclaration classDecl) {
+ Collection<Modifier> modifiers = classDecl.getModifiers();
+ if (!modifiers.contains(Modifier.PUBLIC)){
+ builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.not.public",
+ new Object[] {classDecl.getQualifiedName()});
+ return false;
+ }
+ if (modifiers.contains(Modifier.FINAL)) {
+ builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.is.final",
+ new Object[] {classDecl.getQualifiedName()});
+ return false;
+ }
+ if (modifiers.contains(Modifier.ABSTRACT)) {
+ builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.is.abstract",
+ new Object[] {classDecl.getQualifiedName()});
+ return false;
+ }
+ if (classDecl.getDeclaringType() != null && !modifiers.contains(Modifier.STATIC)) {
+ builder.onError(classDecl.getPosition(), "webserviceap.webservice.class.is.innerclass.not.static",
+ new Object[] {classDecl.getQualifiedName()});
+ return false;
+ }
+ boolean hasDefaultConstructor = false;
+ for (ConstructorDeclaration constructor : classDecl.getConstructors()) {
+ if (constructor.getModifiers().contains(Modifier.PUBLIC) &&
+ constructor.getParameters().size() == 0) {
+ hasDefaultConstructor = true;
+ break;
+ }
+ }
+ if (!hasDefaultConstructor) {
+ builder.onError(classDecl.getPosition(), "webserviceap.webservice.no.default.constructor",
+ new Object[] {classDecl.getQualifiedName()});
+ return false;
+ }
+ if (webService.endpointInterface().length() == 0) {
+ if (!methodsAreLegal(classDecl))
+ return false;
+ } else {
+ InterfaceDeclaration intfDecl = getEndpointInterfaceDecl(webService.endpointInterface(), classDecl);
+ if (!classImplementsSEI(classDecl, intfDecl))
+ return false;
+ }
+
+ return true;
+ }
+
+ protected boolean classImplementsSEI(ClassDeclaration classDecl,
+ InterfaceDeclaration intfDecl) {
+ for (InterfaceType interfaceType : classDecl.getSuperinterfaces()) {
+ if (interfaceType.getDeclaration().equals(intfDecl))
+ return true;
+ }
+ boolean implementsMethod;
+ for (MethodDeclaration method : intfDecl.getMethods()) {
+ implementsMethod = false;
+ for (MethodDeclaration classMethod : classDecl.getMethods()) {
+ if (sameMethod(method, classMethod)) {
+ implementsMethod = true;
+ break;
+ }
+ }
+ if (!implementsMethod) {
+ builder.onError(method.getPosition(), "webserviceap.method.not.implemented",
+ new Object[] {intfDecl.getSimpleName(), classDecl.getSimpleName(),
+ method});
+ return false;
+ }
+ }
+ return true;
+ }
+
+ protected boolean sameMethod(MethodDeclaration method1, MethodDeclaration method2) {
+ if (!method1.getSimpleName().equals(method2.getSimpleName()))
+ return false;
+ if (!method1.getReturnType().equals(method2.getReturnType()))
+ return false;
+ ParameterDeclaration[] params1 = method1.getParameters().toArray(new ParameterDeclaration[0]);
+ ParameterDeclaration[] params2 = method2.getParameters().toArray(new ParameterDeclaration[0]);
+ if (params1.length != params2.length)
+ return false;
+ int pos = 0;
+ for (ParameterDeclaration param1 : method1.getParameters()) {
+ if (!param1.getType().equals(params2[pos++].getType()))
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean isLegalSEI(InterfaceDeclaration intf) {
+ for (FieldDeclaration field : intf.getFields()) {
+ if (field.getConstantValue() != null) {
+ builder.onError("webserviceap.sei.cannot.contain.constant.values",
+ new Object[] {intf.getQualifiedName(), field.getSimpleName()});
+ return false;
+ }
+ }
+ if (!methodsAreLegal(intf))
+ return false;
+ return true;
+ }
+
+ protected boolean methodsAreLegal(InterfaceDeclaration intfDecl) {
+ hasWebMethods = false;
+ for (MethodDeclaration method : intfDecl.getMethods()) {
+ if (!isLegalMethod(method, intfDecl))
+ return false;
+ }
+ for (InterfaceType superIntf : intfDecl.getSuperinterfaces()) {
+ if (!methodsAreLegal(superIntf.getDeclaration()))
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean methodsAreLegal(ClassDeclaration classDecl) {
+ hasWebMethods = hasWebMethods(classDecl);
+ for (MethodDeclaration method : classDecl.getMethods()) {
+ if (!isLegalMethod(method, classDecl))
+ return false;
+ }
+ ClassType superClass = classDecl.getSuperclass();
+ if (superClass != null && !methodsAreLegal(superClass.getDeclaration())) {
+ return false;
+ }
+ return true;
+ }
+
+
+ protected boolean isLegalMethod(MethodDeclaration method, TypeDeclaration typeDecl) {
+ WebMethod webMethod = method.getAnnotation(WebMethod.class);
+ if (hasWebMethods && (webMethod == null))
+ return true;
+ if (!hasWebMethods && (webMethod !=null) && webMethod.exclude()) {
+ return true;
+ }
+ if (typeDecl instanceof ClassDeclaration && method.getModifiers().contains(Modifier.ABSTRACT)) {
+ builder.onError(method.getPosition(), "webserviceap.webservice.method.is.abstract",
+ new Object[] {typeDecl.getQualifiedName(), method.getSimpleName()});
+ return false;
+ }
+
+ if (!isLegalType(method.getReturnType())) {
+ builder.onError(method.getPosition(), "webserviceap.method.return.type.cannot.implement.remote",
+ new Object[] {typeDecl.getQualifiedName(),
+ method.getSimpleName(),
+ method.getReturnType()});
+ }
+ boolean isOneway = method.getAnnotation(Oneway.class) != null;
+ if (isOneway && !isValidOnewayMethod(method, typeDecl))
+ return false;
+
+
+ SOAPBinding soapBinding = method.getAnnotation(SOAPBinding.class);
+ if (soapBinding != null) {
+ if (soapBinding.style().equals(SOAPBinding.Style.RPC)) {
+ builder.onError(method.getPosition(),"webserviceap.rpc.soapbinding.not.allowed.on.method",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+ }
+
+ int paramIndex = 0;
+ for (ParameterDeclaration parameter : method.getParameters()) {
+ if (!isLegalParameter(parameter, method, typeDecl, paramIndex++))
+ return false;
+ }
+
+ if (!isDocLitWrapped() &&
+ soapStyle.equals(SOAPStyle.DOCUMENT)) {
+ ParameterDeclaration outParam = getOutParameter(method);
+ int inParams = getModeParameterCount(method, WebParam.Mode.IN);
+ int outParams = getModeParameterCount(method, WebParam.Mode.OUT);
+ if (inParams != 1) {
+ builder.onError(method.getPosition(),
+ "webserviceap.doc.bare.and.no.one.in",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+ if (method.getReturnType() instanceof VoidType) {
+ if (outParam == null && !isOneway) {
+ builder.onError(method.getPosition(),
+ "webserviceap.doc.bare.no.out",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+ if (outParams != 1) {
+ if (!isOneway && outParams != 0)
+ builder.onError(method.getPosition(),
+ "webserviceap.doc.bare.no.return.and.no.out",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+ } else {
+ if (outParams > 0) {
+ builder.onError(outParam.getPosition(),
+ "webserviceap.doc.bare.return.and.out",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+ }
+ }
+ return true;
+ }
+
+ protected boolean isLegalParameter(ParameterDeclaration param,
+ MethodDeclaration method,
+ TypeDeclaration typeDecl,
+ int paramIndex) {
+ if (!isLegalType(param.getType())) {
+ builder.onError(param.getPosition(), "webserviceap.method.parameter.types.cannot.implement.remote",
+ new Object[] {typeDecl.getQualifiedName(),
+ method.getSimpleName(),
+ param.getSimpleName(),
+ param.getType().toString()});
+ return false;
+ }
+ TypeMirror holderType;
+ holderType = builder.getHolderValueType(param.getType());
+ WebParam webParam = param.getAnnotation(WebParam.class);
+ WebParam.Mode mode = null;
+ if (webParam != null)
+ mode = webParam.mode();
+
+ if (holderType != null) {
+ if (mode != null && mode.equals(WebParam.Mode.IN))
+ builder.onError(param.getPosition(), "webserviceap.holder.parameters.must.not.be.in.only",
+ new Object[] {typeDecl.getQualifiedName(), method.toString(), paramIndex});
+ } else if (mode != null && !mode.equals(WebParam.Mode.IN)) {
+ builder.onError(param.getPosition(), "webserviceap.non.in.parameters.must.be.holder",
+ new Object[] {typeDecl.getQualifiedName(), method.toString(), paramIndex});
+ }
+
+ return true;
+ }
+
+ protected boolean isDocLitWrapped() {
+ return soapStyle.equals(SOAPStyle.DOCUMENT) && wrapped;
+ }
+
+ protected boolean isValidOnewayMethod(MethodDeclaration method, TypeDeclaration typeDecl) {
+ boolean valid = true;
+ if (!(method.getReturnType() instanceof VoidType)) {
+ // this is an error, cannot be Oneway and have a return type
+ builder.onError(method.getPosition(), "webserviceap.oneway.operation.cannot.have.return.type",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ valid = false;
+ }
+ ParameterDeclaration outParam = getOutParameter(method);
+ if (outParam != null) {
+ builder.onError(outParam.getPosition(),
+ "webserviceap.oneway.and.out",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ valid = false;
+ }
+ if (!isDocLitWrapped() && soapStyle.equals(SOAPStyle.DOCUMENT)) {
+ int inCnt = getModeParameterCount(method, WebParam.Mode.IN);
+ if (inCnt != 1) {
+ builder.onError(method.getPosition(),
+ "webserviceap.oneway.and.not.one.in",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ valid = false;
+ }
+ }
+ ClassDeclaration exDecl;
+ for (ReferenceType thrownType : method.getThrownTypes()) {
+ exDecl = ((ClassType)thrownType).getDeclaration();
+ if (!builder.isRemoteException(exDecl)) {
+ builder.onError(method.getPosition(), "webserviceap.oneway.operation.cannot.declare.exceptions",
+ new Object[] {typeDecl.getQualifiedName(), method.toString(), exDecl.getQualifiedName()});
+ valid = false;
+ }
+ }
+ return valid;
+ }
+
+ protected int getModeParameterCount(MethodDeclaration method, WebParam.Mode mode) {
+ WebParam webParam;
+ int cnt = 0;
+ for (ParameterDeclaration param : method.getParameters()) {
+ webParam = param.getAnnotation(WebParam.class);
+ if (webParam != null) {
+ if (webParam.header())
+ continue;
+ if (isEquivalentModes(mode, webParam.mode()))
+ cnt++;
+ } else {
+ if (isEquivalentModes(mode, WebParam.Mode.IN)) {
+ cnt++;
+ }
+ }
+ }
+ return cnt;
+ }
+
+ protected boolean isEquivalentModes(WebParam.Mode mode1, WebParam.Mode mode2) {
+ if (mode1.equals(mode2))
+ return true;
+ assert(mode1.equals(WebParam.Mode.IN) ||
+ mode1.equals(WebParam.Mode.OUT));
+ if (mode1.equals(WebParam.Mode.IN) &&
+ !(mode2.equals(WebParam.Mode.OUT)))
+ return true;
+ if (mode1.equals(WebParam.Mode.OUT) &&
+ !(mode2.equals(WebParam.Mode.IN)))
+ return true;
+ return false;
+ }
+
+ protected boolean isHolder(ParameterDeclaration param) {
+ return builder.getHolderValueType(param.getType()) != null;
+ }
+
+ protected boolean isLegalType(TypeMirror type) {
+ if (!(type instanceof DeclaredType))
+ return true;
+ return !builder.isRemote(((DeclaredType)type).getDeclaration());
+ }
+
+ public void addSchemaElements(MethodDeclaration method, boolean isDocLitWrapped) {
+ addReturnSchemaElement(method, isDocLitWrapped);
+ boolean hasInParam = false;
+ for (ParameterDeclaration param : method.getParameters()) {
+ hasInParam |= addParamSchemaElement(param, method, isDocLitWrapped);
+ }
+ if (!hasInParam && soapStyle.equals(SOAPStyle.DOCUMENT) && !isDocLitWrapped) {
+ QName paramQName = new QName(wsdlNamespace, method.getSimpleName());
+ seiContext.addSchemaElement(paramQName, null);
+ }
+ }
+
+ public void addReturnSchemaElement(MethodDeclaration method, boolean isDocLitWrapped) {
+ TypeMirror returnType = method.getReturnType();
+ WebResult webResult = method.getAnnotation(WebResult.class);
+ String responseName = builder.getResponseName(method.getSimpleName());
+ String responseNamespace = wsdlNamespace;
+ boolean isResultHeader = false;
+ if (webResult != null) {
+ responseName = webResult.name().length() > 0 ? webResult.name() : responseName;
+ responseNamespace = webResult.targetNamespace().length() > 0 ? webResult.targetNamespace() : responseNamespace;
+ isResultHeader = webResult.header();
+ }
+ QName typeName = new QName(responseNamespace, responseName);
+ if (!(returnType instanceof VoidType) &&
+ (!isDocLitWrapped || isResultHeader)) {
+ Reference ref = seiContext.addReference(method);
+ if (!soapStyle.equals(SOAPStyle.RPC))
+ seiContext.addSchemaElement(typeName, ref);
+ }
+ }
+
+ public boolean addParamSchemaElement(ParameterDeclaration param, MethodDeclaration method, boolean isDocLitWrappped) {
+ boolean isInParam = false;
+ WebParam webParam = param.getAnnotation(WebParam.class);
+ String paramName = param.getSimpleName();
+ String paramNamespace = wsdlNamespace;
+ TypeMirror paramType = param.getType();
+ TypeMirror holderType = builder.getHolderValueType(paramType);
+ boolean isHeader = false;
+ if (soapStyle.equals(SOAPStyle.DOCUMENT) && !wrapped) {
+ paramName = method.getSimpleName();
+ }
+ if (webParam != null) {
+ paramName = webParam.name() != null && webParam.name().length() > 0 ? webParam.name() : paramName;
+ isHeader = webParam.header();
+ paramNamespace = webParam.targetNamespace().length() > 0 ? webParam.targetNamespace() : paramNamespace;
+ }
+ if (holderType != null) {
+ paramType = holderType;
+ }
+ if (isHeader || soapStyle.equals(SOAPStyle.DOCUMENT)) {
+ if (isHeader || !isDocLitWrappped) {
+ QName paramQName = new QName(paramNamespace, paramName);
+ Reference ref = seiContext.addReference(paramType, param);
+ seiContext.addSchemaElement(paramQName, ref);
+ }
+ } else
+ seiContext.addReference(paramType, param);
+ if (!isHeader && (holderType == null ||
+ (webParam == null || !webParam.mode().equals(WebParam.Mode.OUT)))) {
+ isInParam = true;
+ }
+ return isInParam;
+ }
+
+ protected ParameterDeclaration getOutParameter(MethodDeclaration method) {
+ WebParam webParam;
+ for (ParameterDeclaration param : method.getParameters()) {
+ webParam = (WebParam)param.getAnnotation(WebParam.class);
+ if (webParam != null &&
+ !webParam.mode().equals(WebParam.Mode.IN)) {
+ return param;
+ }
+ }
+ return null;
+ }
+
+ protected static class MySOAPBinding implements SOAPBinding {
+ public Style style() {return SOAPBinding.Style.DOCUMENT;}
+ public Use use() {return SOAPBinding.Use.LITERAL; }
+ public ParameterStyle parameterStyle() { return SOAPBinding.ParameterStyle.WRAPPED;}
+ public Class<? extends java.lang.annotation.Annotation> annotationType() {
+ return SOAPBinding.class;
+ }
+ }
+}
+
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceVisitor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,589 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import static com.sun.codemodel.ClassType.CLASS;
+import com.sun.codemodel.CodeWriter;
+import com.sun.codemodel.JAnnotationArrayMember;
+import com.sun.codemodel.JAnnotationUse;
+import com.sun.codemodel.JBlock;
+import com.sun.codemodel.JCodeModel;
+import com.sun.codemodel.JCommentPart;
+import com.sun.codemodel.JDefinedClass;
+import com.sun.codemodel.JDocComment;
+import com.sun.codemodel.JExpr;
+import com.sun.codemodel.JFieldVar;
+import com.sun.codemodel.JMethod;
+import com.sun.codemodel.JMod;
+import com.sun.codemodel.JType;
+import com.sun.codemodel.JVar;
+import com.sun.codemodel.writer.ProgressCodeWriter;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.declaration.ClassDeclaration;
+import com.sun.mirror.declaration.FieldDeclaration;
+import com.sun.mirror.declaration.InterfaceDeclaration;
+import com.sun.mirror.declaration.MethodDeclaration;
+import com.sun.mirror.declaration.ParameterDeclaration;
+import com.sun.mirror.declaration.TypeDeclaration;
+
+import com.sun.mirror.type.ClassType;
+import com.sun.mirror.type.ReferenceType;
+import com.sun.mirror.type.TypeMirror;
+import com.sun.mirror.type.VoidType;
+
+
+import javax.jws.Oneway;
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+import javax.xml.namespace.QName;
+import javax.xml.ws.RequestWrapper;
+import javax.xml.ws.ResponseWrapper;
+import javax.xml.ws.WebFault;
+
+import org.jboss.com.sun.tools.ws.ToolVersion;
+import org.jboss.com.sun.tools.ws.processor.generator.GeneratorBase;
+import org.jboss.com.sun.tools.ws.processor.generator.GeneratorConstants;
+import org.jboss.com.sun.tools.ws.processor.generator.Names;
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerException;
+import org.jboss.com.sun.tools.ws.processor.util.DirectoryUtil;
+import org.jboss.com.sun.tools.ws.processor.util.GeneratedFileInfo;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.util.ClassNameInfo;
+import org.jboss.com.sun.tools.ws.wscompile.FilerCodeWriter;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPStyle;
+import org.jboss.com.sun.xml.ws.util.StringUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Array;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeSet;
+
+
+/**
+ * This class generates the request/response and Exception Beans
+ * used by the JAX-WS runtime.
+ *
+ * @author WS Development Team
+ */
+public class WebServiceWrapperGenerator extends WebServiceVisitor {
+ protected Set<String> wrapperNames;
+ protected Set<String> processedExceptions;
+ protected JCodeModel cm;
+ protected MakeSafeTypeVisitor makeSafeVisitor;
+
+
+ public WebServiceWrapperGenerator(ModelBuilder builder, AnnotationProcessorContext context) {
+ super(builder, context);
+ makeSafeVisitor = new MakeSafeTypeVisitor(builder.getAPEnv());
+ }
+
+ protected void processWebService(WebService webService, TypeDeclaration d) {
+ cm = new JCodeModel();
+ wrapperNames = new HashSet<String>();
+ processedExceptions = new HashSet<String>();
+ }
+
+ protected void postProcessWebService(WebService webService, InterfaceDeclaration d) {
+ super.postProcessWebService(webService, d);
+ doPostProcessWebService(webService, d);
+ }
+ protected void postProcessWebService(WebService webService, ClassDeclaration d) {
+ super.postProcessWebService(webService, d);
+ doPostProcessWebService(webService, d);
+ }
+
+ protected void doPostProcessWebService(WebService webService, TypeDeclaration d) {
+ if (cm != null) {
+ File sourceDir = builder.getSourceDir();
+ assert(sourceDir != null);
+ ProcessorEnvironment env = builder.getProcessorEnvironment();
+ try {
+ CodeWriter cw = new FilerCodeWriter(sourceDir, env);
+ if(env.verbose())
+ cw = new ProgressCodeWriter(cw, System.out);
+ cm.build(cw);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ protected void processMethod(MethodDeclaration method, WebMethod webMethod) {
+ builder.log("WrapperGen - method: "+method);
+ builder.log("method.getDeclaringType(): "+method.getDeclaringType());
+ boolean generatedWrapper = false;
+ if (wrapped && soapStyle.equals(SOAPStyle.DOCUMENT)) {
+ generatedWrapper = generateWrappers(method, webMethod);
+ }
+ generatedWrapper = generateExceptionBeans(method) || generatedWrapper;
+ if (generatedWrapper) {
+ // Theres not going to be a second round
+ builder.setWrapperGenerated(generatedWrapper);
+ }
+ }
+
+ private boolean generateExceptionBeans(MethodDeclaration method) {
+ String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
+ if (packageName.length() == 0)
+ beanPackage = JAXWS_PACKAGE_PD;
+ boolean beanGenerated = false;
+ try {
+ for (ReferenceType thrownType : method.getThrownTypes()) {
+ ClassDeclaration typeDecl = ((ClassType)thrownType).getDeclaration();
+ if (typeDecl == null)
+ builder.onError("webserviceap.could.not.find.typedecl",
+ new Object[] {thrownType.toString(), context.getRound()});
+ boolean tmp = generateExceptionBean(typeDecl, beanPackage);
+ beanGenerated = beanGenerated || tmp;
+ }
+ } catch (Exception e) {
+ throw new ModelerException("modeler.nestedGeneratorError",e);
+ }
+ return beanGenerated;
+ }
+
+ private boolean duplicateName(String name) {
+ for (String str : wrapperNames) {
+ if (str.equalsIgnoreCase(name))
+ return true;
+ }
+ wrapperNames.add(name);
+ return false;
+ }
+
+ private boolean generateWrappers(MethodDeclaration method, WebMethod webMethod) {
+ boolean isOneway = method.getAnnotation(Oneway.class) != null;
+ String beanPackage = packageName + PD_JAXWS_PACKAGE_PD;
+ if (packageName.length() == 0)
+ beanPackage = JAXWS_PACKAGE_PD;
+ String methodName = method.getSimpleName();
+ String operationName = builder.getOperationName(methodName);
+ operationName = webMethod != null && webMethod.operationName().length() > 0 ?
+ webMethod.operationName() : operationName;
+ String reqName = operationName;
+ String resName = operationName+RESPONSE;
+ String reqNamespace = typeNamespace;
+ String resNamespace = typeNamespace;
+
+ String requestClassName = beanPackage + StringUtils.capitalize(method.getSimpleName());
+ RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
+ if (reqWrapper != null) {
+ if (reqWrapper.className().length() > 0)
+ requestClassName = reqWrapper.className();
+ if (reqWrapper.localName().length() > 0)
+ reqName = reqWrapper.localName();
+ if (reqWrapper.targetNamespace().length() > 0)
+ reqNamespace = reqWrapper.targetNamespace();
+ }
+ builder.log("requestWrapper: "+requestClassName);
+///// fix for wsgen CR 6442344
+ GeneratedFileInfo gfi=new GeneratedFileInfo();
+ gfi.setFile(new File(DirectoryUtil.getOutputDirectoryFor(requestClassName, builder.getSourceDir(), builder.getProcessorEnvironment()),
+ Names.stripQualifier(requestClassName) + GeneratorConstants.JAVA_SRC_SUFFIX));
+ builder.getProcessorEnvironment().addGeneratedFile(gfi);
+//////////
+ boolean canOverwriteRequest = builder.canOverWriteClass(requestClassName);
+ if (!canOverwriteRequest) {
+ builder.log("Class " + requestClassName + " exists. Not overwriting.");
+ }
+ if (duplicateName(requestClassName) && canOverwriteRequest) {
+ builder.onError("webserviceap.method.request.wrapper.bean.name.not.unique",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+
+ String responseClassName = null;
+ boolean canOverwriteResponse = canOverwriteRequest;
+ if (!isOneway) {
+ responseClassName = beanPackage+StringUtils.capitalize(method.getSimpleName())+RESPONSE;
+ ResponseWrapper resWrapper = method.getAnnotation(ResponseWrapper.class);
+ if(resWrapper != null) {
+ if (resWrapper.className().length() > 0)
+ responseClassName = resWrapper.className();
+ if (resWrapper.localName().length() > 0)
+ resName = resWrapper.localName();
+ if (resWrapper.targetNamespace().length() > 0)
+ resNamespace = resWrapper.targetNamespace();
+ }
+ canOverwriteResponse = builder.canOverWriteClass(requestClassName);
+ if (!canOverwriteResponse) {
+ builder.log("Class " + responseClassName + " exists. Not overwriting.");
+ }
+ if (duplicateName(responseClassName) && canOverwriteResponse) {
+ builder.onError("webserviceap.method.response.wrapper.bean.name.not.unique",
+ new Object[] {typeDecl.getQualifiedName(), method.toString()});
+ }
+ ///// fix for wsgen CR 6442344
+ gfi=new GeneratedFileInfo();
+ gfi.setFile(new File(DirectoryUtil.getOutputDirectoryFor(responseClassName, builder.getSourceDir(), builder.getProcessorEnvironment()),
+ Names.stripQualifier(responseClassName) + GeneratorConstants.JAVA_SRC_SUFFIX));
+ builder.getProcessorEnvironment().addGeneratedFile(gfi);
+////////////
+ }
+ ArrayList<MemberInfo> reqMembers = new ArrayList<MemberInfo>();
+ ArrayList<MemberInfo> resMembers = new ArrayList<MemberInfo>();
+ WrapperInfo reqWrapperInfo = new WrapperInfo(requestClassName);
+ reqWrapperInfo.setMembers(reqMembers);
+ WrapperInfo resWrapperInfo = null;
+ if (!isOneway) {
+ resWrapperInfo = new WrapperInfo(responseClassName);
+ resWrapperInfo.setMembers(resMembers);
+ }
+ seiContext.setReqWrapperOperation(method, reqWrapperInfo);
+ if (!isOneway)
+ seiContext.setResWrapperOperation(method, resWrapperInfo);
+ try {
+ if (!canOverwriteRequest && !canOverwriteResponse) {
+ return false;
+ }
+
+ JDefinedClass reqCls = null;
+ if (canOverwriteRequest) {
+ reqCls = getCMClass(requestClassName, CLASS);
+ }
+
+ JDefinedClass resCls = null;
+ if (!isOneway && canOverwriteResponse) {
+ resCls = getCMClass(responseClassName, CLASS);
+ }
+
+ // XMLElement Declarations
+ writeXmlElementDeclaration(reqCls, reqName,reqNamespace);
+ writeXmlElementDeclaration(resCls, resName, resNamespace);
+
+ collectMembers(method, operationName, typeNamespace, reqMembers, resMembers);
+
+ // XmlType
+ writeXmlTypeDeclaration(reqCls, reqName, reqNamespace, reqMembers);
+ writeXmlTypeDeclaration(resCls, resName, resNamespace, resMembers);
+
+ // class members
+ writeMembers(reqCls, reqMembers);
+ writeMembers(resCls, resMembers);
+
+ } catch (Exception e) {
+ throw new ModelerException("modeler.nestedGeneratorError",e);
+ }
+ return true;
+ }
+
+ private void collectMembers(MethodDeclaration method, String operationName, String namespace,
+ ArrayList<MemberInfo> requestMembers,
+ ArrayList<MemberInfo> responseMembers) {
+
+ AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
+ WebResult webResult = method.getAnnotation(WebResult.class);
+ String responseElementName = RETURN;
+ String responseNamespace = wrapped ? EMTPY_NAMESPACE_ID : typeNamespace;
+ boolean isResultHeader = false;
+ if (webResult != null) {
+ if (webResult.name().length() > 0) {
+ responseElementName = webResult.name();
+ }
+ responseNamespace = webResult.targetNamespace().length() > 1 ?
+ webResult.targetNamespace() :
+ responseNamespace;
+ isResultHeader = webResult.header();
+ }
+
+ // class members
+ WebParam webParam;
+ TypeMirror paramType;
+ String paramName;
+ String paramNamespace;
+ TypeMirror holderType;
+ int paramIndex = -1;
+// System.out.println("method: "+method.toString());
+// System.out.println("returnType: "+ method.getReturnType());
+
+// TypeMirror typeMirror = apEnv.getTypeUtils().getErasure(method.getReturnType());
+ TypeMirror typeMirror = getSafeType(method.getReturnType());
+ String retType = typeMirror.toString();
+ if (!(method.getReturnType() instanceof VoidType) && !isResultHeader) {
+ responseMembers.add(new MemberInfo(-1, typeMirror, RETURN_VALUE,
+ new QName(responseNamespace, responseElementName)));
+ }
+
+ for (ParameterDeclaration param : method.getParameters()) {
+ WebParam.Mode mode = null;
+ paramIndex++;
+// System.out.println("param.getType(): "+param.getType());
+ holderType = builder.getHolderValueType(param.getType());
+ webParam = param.getAnnotation(WebParam.class);
+// typeMirror = apEnv.getTypeUtils().getErasure(param.getType());
+ typeMirror = getSafeType(param.getType());
+ paramType = typeMirror;
+ paramNamespace = wrapped ? EMTPY_NAMESPACE_ID : typeNamespace;
+ if (holderType != null) {
+ paramType = holderType;
+ }
+ paramName = "arg"+paramIndex;
+ if (webParam != null && webParam.header()) {
+ continue;
+ }
+ if (webParam != null) {
+ mode = webParam.mode();
+ if (webParam.name().length() > 0)
+ paramName = webParam.name();
+ if (webParam.targetNamespace().length() > 0)
+ paramNamespace = webParam.targetNamespace();
+ }
+ MemberInfo memInfo = new MemberInfo(paramIndex, paramType, paramName,
+ new QName(paramNamespace, paramName));
+ if (holderType != null) {
+ if (mode == null || mode.equals(WebParam.Mode.INOUT)) {
+ requestMembers.add(memInfo);
+ }
+ responseMembers.add(memInfo);
+ } else {
+ requestMembers.add(memInfo);
+ }
+ }
+ }
+
+ private TypeMirror getSafeType(TypeMirror type) {
+// System.out.println("type: "+type+" type.getClass(): "+type.getClass());
+ TypeMirror retType = makeSafeVisitor.apply(type, builder.getAPEnv().getTypeUtils());
+// System.out.println("retType: "+retType+" retType.getClass(): "+retType.getClass());
+ return retType;
+ }
+
+ private JType getType(TypeMirror typeMirror) throws IOException {
+ String type = typeMirror.toString();
+ JType jType = null;
+ try {
+// System.out.println("typeName: "+typeName);
+ jType = cm.parseType(type);
+// System.out.println("type: "+type);
+ return jType;
+ } catch (ClassNotFoundException e) {
+ jType = cm.ref(type);
+ }
+ return jType;
+ }
+
+ private ArrayList<MemberInfo> sortMembers(ArrayList<MemberInfo> members) {
+ Map<String, MemberInfo> sortedMap = new java.util.TreeMap<String, MemberInfo>();
+ for (MemberInfo member : members) {
+ sortedMap.put(member.getParamName(), member);
+ }
+ ArrayList<MemberInfo> sortedMembers = new ArrayList<MemberInfo>();
+ sortedMembers.addAll(sortedMap.values());
+ return sortedMembers;
+ }
+
+ private void writeMembers(JDefinedClass cls, ArrayList<MemberInfo> members) throws IOException {
+ if (cls == null)
+ return;
+ for (MemberInfo memInfo : members) {
+ JType type = getType(memInfo.getParamType());
+ JFieldVar field = cls.field(JMod.PRIVATE, type, memInfo.getParamName());
+ QName elementName = memInfo.getElementName();
+ if (elementName != null) {
+ if (soapStyle.equals(SOAPStyle.RPC) || wrapped) {
+ JAnnotationUse xmlElementAnn = field.annotate(XmlElement.class);
+ xmlElementAnn.param("name", elementName.getLocalPart());
+ xmlElementAnn.param("namespace", elementName.getNamespaceURI());
+ } else {
+ JAnnotationUse xmlValueAnnn = field.annotate(XmlValue.class);
+ }
+ }
+ }
+ for (MemberInfo memInfo : members) {
+ writeMember(cls, memInfo.getParamIndex(), memInfo.getParamType(),
+ memInfo.getParamName(), memInfo.getElementName());
+ }
+ }
+
+ protected JDefinedClass getCMClass(String className, com.sun.codemodel.ClassType type) {
+ JDefinedClass cls = null;
+ try {
+ cls = cm._class(className, type);
+ } catch (com.sun.codemodel.JClassAlreadyExistsException e){
+ cls = cm._getClass(className);
+ }
+ return cls;
+ }
+
+ private boolean generateExceptionBean(ClassDeclaration thrownDecl, String beanPackage) throws IOException {
+ if (builder.isRemoteException(thrownDecl))
+ return false;
+ AnnotationProcessorEnvironment apEnv = builder.getAPEnv();
+ String exceptionName = ClassNameInfo.getName(thrownDecl.getQualifiedName());
+ if (processedExceptions.contains(exceptionName))
+ return false;
+ processedExceptions.add(exceptionName);
+ WebFault webFault = thrownDecl.getAnnotation(WebFault.class);
+ String className = beanPackage+ exceptionName + BEAN;
+
+ Map<String, TypeMirror> propertyToTypeMap;
+ propertyToTypeMap = TypeModeler.getExceptionProperties(thrownDecl);
+ boolean isWSDLException = isWSDLException(propertyToTypeMap, thrownDecl);
+ String namespace = typeNamespace;
+ String name = exceptionName;
+ FaultInfo faultInfo;
+ if (isWSDLException) {
+ TypeMirror beanType = getSafeType(propertyToTypeMap.get(FAULT_INFO));
+ faultInfo = new FaultInfo(TypeMonikerFactory.getTypeMoniker(beanType), true);
+ namespace = webFault.targetNamespace().length()>0 ?
+ webFault.targetNamespace() : namespace;
+ name = webFault.name().length()>0 ?
+ webFault.name() : name;
+ faultInfo.setElementName(new QName(namespace, name));
+ seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder);
+ return false;
+ }
+ if (webFault != null) {
+ namespace = webFault.targetNamespace().length()>0 ?
+ webFault.targetNamespace() : namespace;
+ name = webFault.name().length()>0 ?
+ webFault.name() : name;
+ className = webFault.faultBean().length()>0 ?
+ webFault.faultBean() : className;
+
+ }
+ JDefinedClass cls = getCMClass(className, CLASS);
+ faultInfo = new FaultInfo(className, false);
+
+ if (duplicateName(className)) {
+ builder.onError("webserviceap.method.exception.bean.name.not.unique",
+ new Object[] {typeDecl.getQualifiedName(), thrownDecl.getQualifiedName()});
+ }
+
+ ArrayList<MemberInfo> members = new ArrayList<MemberInfo>();
+ MemberInfo member;
+ String typeString;
+ TypeMirror erasureType;
+ TreeSet<String> keys = new TreeSet<String>(propertyToTypeMap.keySet());
+ for (String key : keys) {
+ TypeMirror type = propertyToTypeMap.get(key);
+ erasureType = getSafeType(type);
+ member = new MemberInfo(-10, erasureType, key, null);
+ members.add(member);
+ }
+ faultInfo.setMembers(members);
+
+ boolean canOverWriteBean = builder.canOverWriteClass(className);
+ if (!canOverWriteBean) {
+ builder.log("Class " + className + " exists. Not overwriting.");
+ seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder);
+ return false;
+ }
+ if (seiContext.getExceptionBeanName(thrownDecl.getQualifiedName()) != null)
+ return false;
+
+ //write class comment - JAXWS warning
+ JDocComment comment = cls.javadoc();
+ for (String doc : GeneratorBase.getJAXWSClassComment(builder.getSourceVersion())) {
+ comment.add(doc);
+ }
+
+ // XmlElement Declarations
+ writeXmlElementDeclaration(cls, name, namespace);
+
+ // XmlType Declaration
+ members = sortMembers(members);
+ writeXmlTypeDeclaration(cls, exceptionName, typeNamespace, members);
+
+ writeMembers(cls, members);
+
+ seiContext.addExceptionBeanEntry(thrownDecl.getQualifiedName(), faultInfo, builder);
+ return true;
+ }
+
+ protected boolean isWSDLException(Map<String, TypeMirror>map, ClassDeclaration thrownDecl) {
+ WebFault webFault = thrownDecl.getAnnotation(WebFault.class);
+ if (webFault == null)
+ return false;
+ if (map.size() != 2 || map.get(FAULT_INFO) == null)
+ return false;
+ return true;
+ }
+
+ private void writeXmlElementDeclaration(JDefinedClass cls, String elementName, String namespaceUri)
+ throws IOException {
+
+ if (cls == null)
+ return;
+ JAnnotationUse xmlRootElementAnn = cls.annotate(XmlRootElement.class);
+ xmlRootElementAnn.param("name", elementName);
+ if (namespaceUri.length() > 0) {
+ xmlRootElementAnn.param("namespace", namespaceUri);
+ }
+ JAnnotationUse xmlAccessorTypeAnn = cls.annotate(cm.ref(XmlAccessorType.class));
+ xmlAccessorTypeAnn.param("value", XmlAccessType.FIELD);
+ }
+
+ private void writeXmlTypeDeclaration(JDefinedClass cls, String typeName, String namespaceUri,
+ ArrayList<MemberInfo> members) throws IOException {
+ if (cls == null)
+ return;
+ JAnnotationUse xmlTypeAnn = cls.annotate(cm.ref(XmlType.class));
+ xmlTypeAnn.param("name", typeName);
+ xmlTypeAnn.param("namespace", namespaceUri);
+ if (members.size() > 1) {
+ JAnnotationArrayMember paramArray = xmlTypeAnn.paramArray("propOrder");
+ for (MemberInfo memInfo : members) {
+ paramArray.param(memInfo.getParamName());
+ }
+ }
+ }
+
+ private void writeMember(JDefinedClass cls, int paramIndex, TypeMirror paramType,
+ String paramName, QName elementName) throws IOException {
+
+ if (cls == null)
+ return;
+ String capPropName = StringUtils.capitalize(paramName);
+ String getterPrefix = paramType.equals("boolean") || paramType.equals("java.lang.Boolean") ? "is" : "get";
+ JMethod m = null;
+ JDocComment methodDoc = null;
+ JType propType = getType(paramType);
+ m = cls.method(JMod.PUBLIC, propType, getterPrefix+capPropName);
+ methodDoc = m.javadoc();
+ JCommentPart ret = methodDoc.addReturn();
+ ret.add("returns "+propType.name());
+ JBlock body = m.body();
+ body._return( JExpr._this().ref(paramName) );
+
+ m = cls.method(JMod.PUBLIC, cm.VOID, "set"+capPropName);
+ JVar param = m.param(propType, paramName);
+ methodDoc = m.javadoc();
+ JCommentPart part = methodDoc.addParam(paramName);
+ part.add("the value for the "+ paramName+" property");
+ body = m.body();
+ body.assign( JExpr._this().ref(paramName), param );
+ }
+}
+
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WebServiceWrapperGenerator.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WrapperInfo.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WrapperInfo.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WrapperInfo.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,64 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.annotation;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.annotation.*;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ *
+ * @author dkohlert
+ */
+public class WrapperInfo {
+ public String wrapperName;
+ public List<MemberInfo> members;
+
+ /** Creates a new instance of FaultInfo */
+ public WrapperInfo() {
+ }
+ public WrapperInfo(String wrapperName) {
+ this.wrapperName = wrapperName;
+ }
+
+ public void setWrapperName(String wrapperName) {
+ this.wrapperName = wrapperName;
+ }
+
+ public String getWrapperName() {
+ return wrapperName;
+ }
+ public List<MemberInfo> getMembers() {
+ return members;
+ }
+ public void setMembers(List<MemberInfo> members) {
+ this.members = members;
+ }
+ public void addMember(MemberInfo member) {
+ if (members == null)
+ members = new ArrayList<MemberInfo>();
+ members.add(member);
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/annotation/WrapperInfo.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/AccessorElement.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/AccessorElement.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/AccessorElement.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,70 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import javax.xml.namespace.QName;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ * Rpc/Lit AccessorElement to be used to generate pseudo schema
+ */
+class AccessorElement {
+
+ private QName type;
+ private String name;
+
+
+ /**
+ * @param type
+ * @param name
+ */
+ public AccessorElement(String name, QName type) {
+ this.type = type;
+ this.name = name;
+ }
+ /**
+ * @return Returns the type.
+ */
+ public QName getType() {
+ return type;
+ }
+ /**
+ * @param type The type to set.
+ */
+ public void setType(QName type) {
+ this.type = type;
+ }
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return name;
+ }
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/AccessorElement.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,77 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import com.sun.tools.xjc.api.ClassNameAllocator;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
+
+import org.jboss.com.sun.tools.ws.processor.util.ClassNameCollector;
+
+/**
+ * @author Vivek Pandey
+ * <p/>
+ * Implementation of Callback interface that allows the driver of the XJC API to rename JAXB-generated classes/interfaces/enums.
+ */
+public class ClassNameAllocatorImpl implements ClassNameAllocator {
+ public ClassNameAllocatorImpl(ClassNameCollector classNameCollector) {
+ this.classNameCollector = classNameCollector;
+ this.jaxbClasses = new HashSet<String>();
+ }
+
+ public String assignClassName(String packageName, String className) {
+ if(packageName== null || className == null){
+ //TODO: throw Exception
+ return className;
+ }
+
+ //if either of the values are empty string return the default className
+ if(packageName.equals("") || className.equals(""))
+ return className;
+
+ String fullClassName = packageName+"."+className;
+
+ // Check if there is any conflict with jaxws generated classes
+ Set<String> seiClassNames = classNameCollector.getSeiClassNames();
+ if(seiClassNames != null && seiClassNames.contains(fullClassName)){
+ className += TYPE_SUFFIX;
+ }
+
+ jaxbClasses.add(packageName+"."+className);
+ return className;
+ }
+
+ /**
+ *
+ * @return jaxbGenerated classNames
+ */
+ public Set<String> getJaxbGeneratedClasses() {
+ return jaxbClasses;
+ }
+
+ private final static String TYPE_SUFFIX = "_Type";
+ private ClassNameCollector classNameCollector;
+ private Set<String> jaxbClasses;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ClassNameAllocatorImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ConsoleErrorReporter.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ConsoleErrorReporter.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ConsoleErrorReporter.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,121 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import com.sun.tools.xjc.api.ErrorListener;
+
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.xml.ws.util.localization.LocalizableMessageFactory;
+import org.xml.sax.SAXParseException;
+
+import java.util.ResourceBundle;
+import java.text.MessageFormat;
+
+public class ConsoleErrorReporter implements ErrorListener{
+
+ private LocalizableMessageFactory messageFactory;
+ private ProcessorEnvironment env;
+ private boolean printStackTrace;
+ private boolean hasError;
+
+ public ConsoleErrorReporter(ProcessorEnvironment env, boolean printStackTrace) {
+ this.env = env;
+ this.printStackTrace = printStackTrace;
+ messageFactory =
+ new LocalizableMessageFactory("org.jboss.com.sun.tools.ws.resources.model");
+ }
+
+ public boolean hasError() {
+ return hasError;
+ }
+
+ // will be null unless set in #error or #fatalError
+ //TODO: remove it after error handling is straightened
+ private Exception e;
+ Exception getException(){
+ return e;
+ }
+
+ public void error(SAXParseException e) {
+ hasError = true;
+ this.e = e;
+ if(printStackTrace)
+ e.printStackTrace();
+ env.error(messageFactory.getMessage("model.saxparser.exception",
+ new Object[]{e.getMessage(), getLocationString(e)}));
+ }
+
+ public void fatalError(SAXParseException e) {
+ hasError = true;
+ this.e = e;
+ if(printStackTrace)
+ e.printStackTrace();
+
+ env.error(messageFactory.getMessage("model.saxparser.exception",
+ new Object[]{e.getMessage(), getLocationString(e)}));
+ }
+
+ public void warning(SAXParseException e) {
+ env.warn(messageFactory.getMessage("model.saxparser.exception",
+ new Object[]{e.getMessage(), getLocationString(e)}));
+ }
+
+ /**
+ * Used to report possibly verbose information that
+ * can be safely ignored.
+ */
+ public void info(SAXParseException e) {
+ env.info(messageFactory.getMessage("model.saxparser.exception",
+ new Object[]{e.getMessage(), getLocationString(e)}));
+ }
+
+ /**
+ * Returns the human readable string representation of the
+ * {@link org.xml.sax.Locator} part of the specified
+ * {@link SAXParseException}.
+ *
+ * @return non-null valid object.
+ */
+ protected final String getLocationString( SAXParseException e ) {
+ if(e.getLineNumber()!=-1 || e.getSystemId()!=null) {
+ int line = e.getLineNumber();
+ return format("ConsoleErrorReporter.LineXOfY", line==-1?"?":Integer.toString( line ),
+ getShortName( e.getSystemId() ) );
+ } else {
+ return format("ConsoleErrorReporter.UnknownLocation");
+ }
+ }
+
+ /** Computes a short name of a given URL for display. */
+ private String getShortName( String url ) {
+ if(url==null)
+ return format("ConsoleErrorReporter.UnknownLocation");
+ return url;
+ }
+
+ private String format( String property, Object... args ) {
+ String text = ResourceBundle.getBundle("org.jboss.com.sun.tools.ws.resources.model").getString(property);
+ return MessageFormat.format(text,args);
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/ConsoleErrorReporter.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/JAXBModelBuilder.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/JAXBModelBuilder.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/JAXBModelBuilder.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,166 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.config.ModelInfo;
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.model.ModelException;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaSimpleType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBMapping;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBModel;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBType;
+import org.jboss.com.sun.tools.ws.processor.modeler.JavaSimpleTypeCreator;
+import org.jboss.com.sun.tools.ws.processor.util.ClassNameCollector;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.xml.ws.util.JAXWSUtils;
+import org.jboss.com.sun.xml.ws.util.localization.LocalizableMessageFactory;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXParseException;
+
+import com.sun.tools.xjc.api.ErrorListener;
+import com.sun.tools.xjc.api.SchemaCompiler;
+import com.sun.tools.xjc.api.XJC;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+
+/**
+ * @author Kathy Walsh, Vivek Pandey
+ *
+ * Uses JAXB XJC apis to build JAXBModel and resolves xml to java type mapping from JAXBModel
+ */
+public class JAXBModelBuilder {
+ public JAXBModelBuilder(ModelInfo modelInfo,
+ Properties options, ClassNameCollector classNameCollector, List elements) {
+ _messageFactory =
+ new LocalizableMessageFactory("org.jboss.com.sun.tools.ws.resources.model");
+ _modelInfo = modelInfo;
+ _env = (ProcessorEnvironment) modelInfo.getParent().getEnvironment();
+ _classNameAllocator = new ClassNameAllocatorImpl(classNameCollector);
+
+ printstacktrace = Boolean.valueOf(options.getProperty(ProcessorOptions.PRINT_STACK_TRACE_PROPERTY));
+ consoleErrorReporter = new ConsoleErrorReporter(_env, false);
+ internalBuildJAXBModel(elements);
+ }
+
+ /**
+ * Builds model from WSDL document. Model contains abstraction which is used by the
+ * generators to generate the stub/tie/serializers etc. code.
+ *
+ * @see org.jboss.com.sun.tools.ws.processor.modeler.Modeler#buildModel()
+ */
+
+ private void internalBuildJAXBModel(List elements){
+ try {
+ schemaCompiler = XJC.createSchemaCompiler();
+ schemaCompiler.setClassNameAllocator(_classNameAllocator);
+ schemaCompiler.setErrorListener(consoleErrorReporter);
+ schemaCompiler.setEntityResolver(_modelInfo.getEntityResolver());
+ int schemaElementCount = 1;
+ for(Iterator iter = elements.iterator(); iter.hasNext();){
+ Element schemaElement = (Element)iter.next();
+ String location = schemaElement.getOwnerDocument().getDocumentURI();
+ String systemId = new String(location + "#types?schema"+schemaElementCount++);
+ schemaCompiler.parseSchema(systemId,schemaElement);
+ }
+
+ //feed external jaxb:bindings file
+ Set<InputSource> externalBindings = ((WSDLModelInfo)_modelInfo).getJAXBBindings();
+ if(externalBindings != null){
+ for(InputSource jaxbBinding : externalBindings){
+ schemaCompiler.parseSchema(jaxbBinding);
+ }
+ }
+ } catch (Exception e) {
+ throw new ModelException(e);
+ }
+ }
+
+ public JAXBType getJAXBType(QName qname){
+ JAXBMapping mapping = jaxbModel.get(qname);
+ if (mapping == null){
+ fail("model.schema.elementNotFound", new Object[]{qname});
+ }
+
+ JavaType javaType = new JavaSimpleType(mapping.getType());
+ JAXBType type = new JAXBType(qname, javaType, mapping, jaxbModel);
+ return type;
+ }
+
+ public TypeAndAnnotation getElementTypeAndAnn(QName qname){
+ JAXBMapping mapping = jaxbModel.get(qname);
+ if (mapping == null){
+ fail("model.schema.elementNotFound", new Object[]{qname});
+ }
+ return mapping.getType().getTypeAnn();
+ }
+
+ protected void bind(){
+ com.sun.tools.xjc.api.JAXBModel rawJaxbModel = schemaCompiler.bind();
+ if(consoleErrorReporter.hasError()){
+ throw new ModelException(consoleErrorReporter.getException());
+ }
+ jaxbModel = new JAXBModel(rawJaxbModel);
+ jaxbModel.setGeneratedClassNames(_classNameAllocator.getJaxbGeneratedClasses());
+ }
+
+ protected SchemaCompiler getJAXBSchemaCompiler(){
+ return schemaCompiler;
+ }
+
+ protected void fail(String key, Object[] arg) {
+ throw new ModelException(key, arg);
+ }
+
+ protected void error(String key, Object[] args){
+ _env.error(_messageFactory.getMessage(key, args));
+ }
+
+ protected void warn(String key, Object[] args) {
+ _env.warn(_messageFactory.getMessage(key, args));
+ }
+
+ protected void inform(String key, Object[] args) {
+ _env.info(_messageFactory.getMessage(key, args));
+ }
+
+ public JAXBModel getJAXBModel(){
+ return jaxbModel;
+ }
+
+ private JAXBModel jaxbModel;
+ private SchemaCompiler schemaCompiler;
+ private final LocalizableMessageFactory _messageFactory;
+ private final ModelInfo _modelInfo;
+ private final ProcessorEnvironment _env;
+ private final boolean printstacktrace;
+ private final ClassNameAllocatorImpl _classNameAllocator;
+ private final ConsoleErrorReporter consoleErrorReporter;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/JAXBModelBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/MimeHelper.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/MimeHelper.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/MimeHelper.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,104 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.com.sun.tools.ws.processor.modeler.JavaSimpleTypeCreator;
+
+
+/**
+ * @author Vivek Pandey
+ *
+ */
+public class MimeHelper {
+ /**
+ * @param mimePart
+ * @return unique attachment ID
+ */
+ protected static String getAttachmentUniqueID(String mimePart) {
+ //return "uuid@" + mimePart;
+ return mimePart;
+ }
+
+ /**
+ * @param mimeType
+ * @return true if mimeType is a binary type
+ */
+ protected static boolean isMimeTypeBinary(String mimeType) {
+ if (mimeType.equals(JPEG_IMAGE_MIME_TYPE)
+ || mimeType.equals(GIF_IMAGE_MIME_TYPE)
+ ) {
+ return true;
+ } else if (
+ mimeType.equals(TEXT_XML_MIME_TYPE)
+ || mimeType.equals(TEXT_HTML_MIME_TYPE)
+ || mimeType.equals(TEXT_PLAIN_MIME_TYPE)
+ || mimeType.equals(APPLICATION_XML_MIME_TYPE)
+ || mimeType.equals(MULTIPART_MIME_TYPE)) {
+ return false;
+ }
+ //some unknown mime type, will be mapped to DataHandler java type so
+ // return true
+ return true;
+ }
+
+ protected static void initMimeTypeToJavaType() {
+ mimeTypeToJavaType.put(JPEG_IMAGE_MIME_TYPE, javaType.IMAGE_JAVATYPE);
+ //mimeTypeToJavaType.put(PNG_IMAGE_MIME_TYPE, javaType.IMAGE_JAVATYPE);
+ mimeTypeToJavaType.put(GIF_IMAGE_MIME_TYPE,
+ javaType.IMAGE_JAVATYPE);
+ mimeTypeToJavaType.put(TEXT_XML_MIME_TYPE, javaType.SOURCE_JAVATYPE);
+ //mimeTypeToJavaType.put(TEXT_HTML_MIME_TYPE, javaType.SOURCE_JAVATYPE);
+ mimeTypeToJavaType.put(
+ APPLICATION_XML_MIME_TYPE,
+ javaType.SOURCE_JAVATYPE);
+ mimeTypeToJavaType.put(TEXT_PLAIN_MIME_TYPE, javaType.STRING_JAVATYPE);
+ mimeTypeToJavaType.put(
+ MULTIPART_MIME_TYPE,
+ javaType.MIME_MULTIPART_JAVATYPE);
+
+ }
+
+ protected static Map mimeTypeToJavaType;
+ protected static JavaSimpleTypeCreator javaType;
+
+ public static final String JPEG_IMAGE_MIME_TYPE = "image/jpeg";
+ //public static final String PNG_IMAGE_MIME_TYPE = "image/png";
+ public static final String GIF_IMAGE_MIME_TYPE = "image/gif";
+ public static final String TEXT_XML_MIME_TYPE = "text/xml";
+ public static final String TEXT_HTML_MIME_TYPE = "text/html";
+ public static final String TEXT_PLAIN_MIME_TYPE = "text/plain";
+ public static final String APPLICATION_XML_MIME_TYPE = "application/xml";
+ public static final String MULTIPART_MIME_TYPE = "multipart/*";
+
+ /**
+ *
+ */
+ public MimeHelper() {
+ mimeTypeToJavaType = new HashMap();
+ javaType = new JavaSimpleTypeCreator();
+ initMimeTypeToJavaType();
+ }
+
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/MimeHelper.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,277 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import static org.jboss.com.sun.tools.ws.processor.modeler.wsdl.WSDLModelerBase.*;
+
+import org.jboss.com.sun.tools.ws.processor.config.ModelInfo;
+import org.jboss.com.sun.tools.ws.processor.modeler.wsdl.WSDLModelerBase.ProcessSOAPOperationInfo;
+import org.jboss.com.sun.tools.ws.wsdl.document.Binding;
+import org.jboss.com.sun.tools.ws.wsdl.document.BindingOperation;
+import org.jboss.com.sun.tools.ws.wsdl.document.Kinds;
+import org.jboss.com.sun.tools.ws.wsdl.document.Message;
+import org.jboss.com.sun.tools.ws.wsdl.document.MessagePart;
+import org.jboss.com.sun.tools.ws.wsdl.document.Operation;
+import org.jboss.com.sun.tools.ws.wsdl.document.Port;
+import org.jboss.com.sun.tools.ws.wsdl.document.PortType;
+import org.jboss.com.sun.tools.ws.wsdl.document.Service;
+import org.jboss.com.sun.tools.ws.wsdl.document.WSDLDocument;
+import org.jboss.com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding;
+import org.jboss.com.sun.tools.ws.wsdl.document.schema.SchemaKinds;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.*;
+import org.jboss.com.sun.tools.ws.wsdl.framework.Extensible;
+import org.jboss.com.sun.tools.ws.wsdl.framework.NoSuchEntityException;
+import org.xml.sax.InputSource;
+
+import javax.xml.namespace.QName;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+
+
+
+/**
+ * @author Vivek Pandey
+ *
+ * Builds all possible pseudo schemas for async operation ResponseBean to feed to XJC.
+ */
+public class PseudoSchemaBuilder {
+
+ private final StringWriter buf = new StringWriter();
+ private final WSDLDocument wsdlDocument;
+ private final ModelInfo modelInfo;
+ private WSDLModeler wsdlModeler;
+ private final List<InputSource> schemas = new ArrayList<InputSource>();
+ private final HashMap<QName, Port> bindingNameToPortMap = new HashMap<QName, Port>();
+
+ public static List<InputSource> build(WSDLModeler wsdlModeler, ModelInfo modelInfo) {
+ PseudoSchemaBuilder b = new PseudoSchemaBuilder(wsdlModeler.document, modelInfo);
+ b.wsdlModeler = wsdlModeler;
+ JAXBModelBuilder analyzer = wsdlModeler.getJAXBModelBuilder();
+ b.build();
+ for(int i = 0; i < b.schemas.size(); i++){
+ InputSource is = b.schemas.get(i);
+ is.setSystemId("http://dummy.pseudo-schema#schema"+(i+1));
+ }
+ return b.schemas;
+ }
+
+ private PseudoSchemaBuilder(WSDLDocument _wsdl, ModelInfo _modelInfo) {
+ this.wsdlDocument = _wsdl;
+ this.modelInfo = _modelInfo;
+ }
+
+ private void build() {
+ for(Iterator<Service> itr=wsdlDocument.getDefinitions().services(); itr.hasNext(); )
+ build(itr.next());
+ }
+
+ private void build(Service service) {
+ for( Iterator<Port> itr=service.ports(); itr.hasNext(); )
+ build(itr.next() );
+ }
+
+ private void build(Port port) {
+ if(wsdlModeler.isProvider(port))
+ return;
+ Binding binding = port.resolveBinding(wsdlDocument);
+
+ SOAPBinding soapBinding =
+ (SOAPBinding)getExtensionOfType(binding, SOAPBinding.class);
+ //lets try and see if its SOAP 1.2. dont worry about extension flag, its
+ // handled much earlier
+ if (soapBinding == null) {
+ soapBinding =
+ (SOAPBinding)getExtensionOfType(binding, SOAP12Binding.class);
+ }
+ if(soapBinding == null)
+ return;
+ PortType portType = binding.resolvePortType(wsdlDocument);
+
+ QName bindingName = WSDLModelerBase.getQNameOf(binding);
+
+ //we dont want to process the port bound to the binding processed earlier
+ if(bindingNameToPortMap.containsKey(bindingName))
+ return;
+
+ bindingNameToPortMap.put(bindingName, port);
+
+
+ for(Iterator itr=binding.operations(); itr.hasNext();){
+ BindingOperation bindingOperation = (BindingOperation)itr.next();
+ SOAPOperation soapOperation =
+ (SOAPOperation)getExtensionOfType(bindingOperation,
+ SOAPOperation.class);
+
+ // get only the bounded operations
+ Set boundedOps = portType.getOperationsNamed(bindingOperation.getName());
+ if(boundedOps.size() != 1)
+ continue;
+ Operation operation = (Operation)boundedOps.iterator().next();
+
+ // No pseudo schema required for doc/lit
+ SOAPStyle bindingStyle = soapBinding.getStyle();
+ SOAPStyle operationStyle = (soapOperation != null) ? soapOperation.getStyle() : bindingStyle;
+ if(wsdlModeler.isAsync(portType, operation)){
+ buildAsync(portType, operation, bindingOperation);
+ }
+ }
+ }
+
+ /**
+ * @param portType
+ * @param operation
+ * @param bindingOperation
+ */
+ private void buildAsync(PortType portType, Operation operation, BindingOperation bindingOperation) {
+ String operationName = getCustomizedOperationName(operation);//operation.getName();
+ if(operationName == null)
+ return;
+ Message outputMessage = null;
+ if(operation.getOutput() != null)
+ outputMessage = operation.getOutput().resolveMessage(wsdlDocument);
+ if(outputMessage != null){
+ List<MessagePart> allParts = new ArrayList<MessagePart>(outputMessage.getParts());
+ if(allParts.size() > 1)
+ build(getOperationName(portType, operationName, bindingOperation.getOutput()), allParts);
+ }
+
+ }
+
+ private String getCustomizedOperationName(Operation operation) {
+ JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(operation, JAXWSBinding.class);
+ String operationName = (jaxwsCustomization != null)?((jaxwsCustomization.getMethodName() != null)?jaxwsCustomization.getMethodName().getName():null):null;
+ if(operationName != null){
+ if(wsdlModeler.getEnvironment().getNames().isJavaReservedWord(operationName)){
+ return null;
+ }
+
+ return operationName;
+ }
+ return operation.getName();
+ }
+
+ private void writeImports(QName elementName, List<MessagePart> parts){
+ Set<String> uris = new HashSet<String>();
+ for(MessagePart p:parts){
+ String ns = p.getDescriptor().getNamespaceURI();
+ if(!uris.contains(ns) && !ns.equals("http://www.w3.org/2001/XMLSchema") && !ns.equals(elementName.getNamespaceURI())){
+ print("<xs:import namespace=''{0}''/>", ns);
+ uris.add(ns);
+ }
+ }
+ }
+
+ boolean asyncRespBeanBinding = false;
+ private void build(QName elementName, List<MessagePart> allParts){
+
+ print(
+ "<xs:schema xmlns:xs=''http://www.w3.org/2001/XMLSchema''" +
+ " xmlns:jaxb=''http://java.sun.com/xml/ns/jaxb''" +
+ " xmlns:xjc=''http://java.sun.com/xml/ns/jaxb/xjc''" +
+ " jaxb:extensionBindingPrefixes=''xjc''" +
+ " jaxb:version=''1.0''");
+ if((elementName != null) && elementName.getNamespaceURI().length() > 0){
+ print(" targetNamespace=''{0}''>", elementName.getNamespaceURI());
+ }else{
+ print(" >");
+ }
+
+ writeImports(elementName, allParts);
+
+ if(!asyncRespBeanBinding){
+ print(
+ "<xs:annotation><xs:appinfo>" +
+ " <jaxb:schemaBindings>" +
+ " <jaxb:package name=''{0}'' />" +
+ " </jaxb:schemaBindings>" +
+ "</xs:appinfo></xs:annotation>",
+ wsdlModeler.getJavaPackage() );
+ asyncRespBeanBinding = true;
+ }
+
+ print("<xs:element name=''{0}''>", elementName.getLocalPart());
+ print("<xs:complexType>");
+ print("<xs:sequence>");
+
+
+ for(MessagePart p:allParts) {
+ //rpclit wsdl:part must reference schema type not element, also it must exclude headers and mime parts
+ if(p.getDescriptorKind() == SchemaKinds.XSD_ELEMENT){
+ print("<xs:element ref=''types:{0}'' xmlns:types=''{1}''/>",p.getDescriptor().getLocalPart(), p.getDescriptor().getNamespaceURI());
+ }else{
+ print("<xs:element name=''{0}'' type=''{1}'' xmlns=''{2}'' />",
+ p.getName(),
+ p.getDescriptor().getLocalPart(),
+ p.getDescriptor().getNamespaceURI() );
+ }
+ }
+
+ print("</xs:sequence>");
+ print("</xs:complexType>");
+ print("</xs:element>");
+ print("</xs:schema>");
+
+ // reset the StringWriter, so that next operation element could be written
+ if(buf.toString().length() > 0){
+// System.out.println("Response bean Schema for operation========> "+ elementName+"\n\n"+buf);
+ InputSource is = new InputSource(new StringReader(buf.toString()));
+ schemas.add(is);
+ buf.getBuffer().setLength(0);
+ }
+ }
+
+ private QName getOperationName(PortType portType, String operationName, Extensible binding){
+ if(operationName == null)
+ return null;
+// String namespaceURI = wsdlDocument.getDefinitions().getTargetNamespaceURI()+"?"+portType.getName()+"?" + operationName;
+ String namespaceURI = "";
+ return new QName(namespaceURI, operationName+"Response");
+ }
+
+ private void print( String msg ) {
+ print( msg, new Object[0] );
+ }
+ private void print( String msg, Object arg1 ) {
+ print( msg, new Object[]{arg1} );
+ }
+ private void print( String msg, Object arg1, Object arg2 ) {
+ print( msg, new Object[]{arg1, arg2} );
+ }
+ private void print( String msg, Object arg1, Object arg2, Object arg3 ) {
+ print( msg, new Object[]{arg1,arg2,arg3} );
+ }
+ private void print( String msg, Object[] args ) {
+ buf.write(MessageFormat.format(msg,args));
+ buf.write('\n');
+ }
+
+ private static final Set<QName> nspaceToPackageSchema = new HashSet<QName>();
+ private static int schemaCounter;
+}
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/PseudoSchemaBuilder.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModeler.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModeler.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModeler.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,2793 @@
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+import com.sun.codemodel.JCodeModel;
+import com.sun.codemodel.JType;
+import com.sun.tools.xjc.api.S2JJAXBModel;
+import com.sun.tools.xjc.api.TypeAndAnnotation;
+import com.sun.tools.xjc.api.XJC;
+import com.sun.xml.bind.api.JAXBRIContext;
+
+import org.jboss.com.sun.tools.ws.processor.ProcessorOptions;
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.generator.GeneratorConstants;
+import org.jboss.com.sun.tools.ws.processor.model.AsyncOperation;
+import org.jboss.com.sun.tools.ws.processor.model.AsyncOperationType;
+import org.jboss.com.sun.tools.ws.processor.model.Block;
+import org.jboss.com.sun.tools.ws.processor.model.Fault;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.ModelException;
+import org.jboss.com.sun.tools.ws.processor.model.ModelObject;
+import org.jboss.com.sun.tools.ws.processor.model.ModelProperties;
+import org.jboss.com.sun.tools.ws.processor.model.Operation;
+import org.jboss.com.sun.tools.ws.processor.model.Parameter;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.model.Request;
+import org.jboss.com.sun.tools.ws.processor.model.Response;
+import org.jboss.com.sun.tools.ws.processor.model.Service;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaException;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaInterface;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaMethod;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaParameter;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaSimpleType;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaStructureMember;
+import org.jboss.com.sun.tools.ws.processor.model.java.JavaType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBElementMember;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBProperty;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBStructuredType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBType;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.RpcLitMember;
+import org.jboss.com.sun.tools.ws.processor.model.jaxb.RpcLitStructure;
+import org.jboss.com.sun.tools.ws.processor.modeler.JavaSimpleTypeCreator;
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerException;
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerUtils;
+import org.jboss.com.sun.tools.ws.processor.util.ClassNameCollector;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.wsdl.document.Binding;
+import org.jboss.com.sun.tools.ws.wsdl.document.BindingFault;
+import org.jboss.com.sun.tools.ws.wsdl.document.BindingOperation;
+import org.jboss.com.sun.tools.ws.wsdl.document.Documentation;
+import org.jboss.com.sun.tools.ws.wsdl.document.Kinds;
+import org.jboss.com.sun.tools.ws.wsdl.document.Message;
+import org.jboss.com.sun.tools.ws.wsdl.document.MessagePart;
+import org.jboss.com.sun.tools.ws.wsdl.document.OperationStyle;
+import org.jboss.com.sun.tools.ws.wsdl.document.PortType;
+import org.jboss.com.sun.tools.ws.wsdl.document.WSDLConstants;
+import org.jboss.com.sun.tools.ws.wsdl.document.WSDLDocument;
+import org.jboss.com.sun.tools.ws.wsdl.document.jaxws.CustomName;
+import org.jboss.com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding;
+import org.jboss.com.sun.tools.ws.wsdl.document.mime.MIMEContent;
+import org.jboss.com.sun.tools.ws.wsdl.document.schema.SchemaKinds;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAP12Binding;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAP12Constants;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPAddress;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPBinding;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPBody;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPConstants;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPFault;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPHeader;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPOperation;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPStyle;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPUse;
+import org.jboss.com.sun.tools.ws.wsdl.framework.Entity;
+import org.jboss.com.sun.tools.ws.wsdl.framework.Extensible;
+import org.jboss.com.sun.tools.ws.wsdl.framework.NoSuchEntityException;
+import org.jboss.com.sun.tools.ws.wsdl.framework.ParseException;
+import org.jboss.com.sun.tools.ws.wsdl.framework.ParserListener;
+import org.jboss.com.sun.tools.ws.wsdl.framework.ValidationException;
+import org.jboss.com.sun.tools.ws.wsdl.parser.SOAPEntityReferenceValidator;
+import org.jboss.com.sun.tools.ws.wsdl.parser.WSDLParser;
+import org.jboss.com.sun.xml.ws.model.Mode;
+import org.jboss.com.sun.xml.ws.util.xml.XmlUtil;
+import org.xml.sax.InputSource;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+
+/**
+ * The WSDLModeler processes a WSDL to create a Model.
+ *
+ * @author WS Development Team
+ */
+public class WSDLModeler extends WSDLModelerBase {
+
+ //map of wsdl:operation QName to <soapenv:Body> child, as per BP it must be unique in a port
+ private final Map<QName, QName> uniqueBodyBlocks = new HashMap<QName, QName>();
+ private final QName VOID_BODYBLOCK = new QName("");
+ private ClassNameCollector classNameCollector;
+ private boolean extensions = false;
+ protected enum StyleAndUse {RPC_LITERAL, DOC_LITERAL};
+ private ModelerUtils modelerUtils;
+ private JAXBModelBuilder jaxbModelBuilder;
+
+ /**
+ * @param modelInfo
+ * @param options
+ */
+ public WSDLModeler(WSDLModelInfo modelInfo, Properties options) {
+ super(modelInfo, options);
+ classNameCollector = new ClassNameCollector();
+ }
+
+ public Model buildModel() {
+ try {
+
+ parser = new WSDLParser(_modelInfo);
+ parser.addParserListener(new ParserListener() {
+ public void ignoringExtension(QName name, QName parent) {
+ if (parent.equals(WSDLConstants.QNAME_TYPES)) {
+ // check for a schema element with the wrong namespace URI
+ if (name.getLocalPart().equals("schema")
+ && !name.getNamespaceURI().equals("")) {
+ warn(
+ "wsdlmodeler.warning.ignoringUnrecognizedSchemaExtension",
+ name.getNamespaceURI());
+ }
+ }
+ }
+ public void doneParsingEntity(QName element, Entity entity) {
+ }
+ });
+ hSet = parser.getUse();
+
+ extensions = Boolean.valueOf(_options.getProperty(ProcessorOptions.EXTENSION));
+
+ useWSIBasicProfile = !extensions;
+ document =
+ parser.parse();
+ document.validateLocally();
+
+ boolean validateWSDL =
+ Boolean
+ .valueOf(
+ _options.getProperty(
+ ProcessorOptions.VALIDATE_WSDL_PROPERTY))
+ .booleanValue();
+ if (validateWSDL) {
+ document.validate(new SOAPEntityReferenceValidator());
+ }
+
+
+ Model model = internalBuildModel(document);
+ //ClassNameCollector classNameCollector = new ClassNameCollector();
+ classNameCollector.process(model);
+ if (classNameCollector.getConflictingClassNames().isEmpty()) {
+ return model;
+ }
+ // do another pass, this time with conflict resolution enabled
+ model = internalBuildModel(document);
+ classNameCollector.process(model);
+ if (classNameCollector.getConflictingClassNames().isEmpty()) {
+ // we're done
+ return model;
+ }
+ // give up
+ StringBuffer conflictList = new StringBuffer();
+ boolean first = true;
+ for (Iterator iter =
+ classNameCollector.getConflictingClassNames().iterator();
+ iter.hasNext();
+ ) {
+ if (!first) {
+ conflictList.append(", ");
+ } else {
+ first = false;
+ }
+ conflictList.append((String)iter.next());
+ }
+ throw new ModelerException(
+ "wsdlmodeler.unsolvableNamingConflicts",
+ conflictList.toString());
+
+ } catch (ModelException e) {
+ throw new ModelerException((Exception)e);
+ } catch (ParseException e) {
+ throw new ModelerException((Exception)e);
+ } catch (ValidationException e) {
+ throw new ModelerException((Exception)e);
+ }
+ }
+
+ private Model internalBuildModel(WSDLDocument document) {
+
+ //build the jaxbModel to be used latter
+ buildJAXBModel(document, _modelInfo, classNameCollector);
+
+ QName modelName =
+ new QName(
+ document.getDefinitions().getTargetNamespaceURI(),
+ document.getDefinitions().getName() == null
+ ? "model"
+ : document.getDefinitions().getName());
+ Model model = new Model(modelName);
+ model.setJAXBModel(getJAXBModelBuilder().getJAXBModel());
+
+ // This fails with the changed classname (WSDLModeler to WSDLModeler11 etc.)
+ // with this source comaptibility change the WSDL Modeler class name is changed. Right now hardcoding the
+ // modeler class name to the same one being checked in WSDLGenerator.
+
+ model.setProperty(
+ ModelProperties.PROPERTY_MODELER_NAME,
+ ModelProperties.WSDL_MODELER_NAME);
+
+ _javaTypes = new JavaSimpleTypeCreator();
+ _javaExceptions = new HashMap();
+ _bindingNameToPortMap = new HashMap();
+
+ // grab target namespace
+ model.setTargetNamespaceURI(document.getDefinitions().getTargetNamespaceURI());
+
+ setDocumentationIfPresent(model,
+ document.getDefinitions().getDocumentation());
+
+ boolean hasServices = document.getDefinitions().services().hasNext();
+ if (hasServices) {
+ for (Iterator iter = document.getDefinitions().services();
+ iter.hasNext();
+ ) {
+ processService((org.jboss.com.sun.tools.ws.wsdl.document.Service)iter.next(),
+ model, document);
+ hasServices = true;
+ }
+ } else {
+ // emit a warning if there are no service definitions
+ warn("wsdlmodeler.warning.noServiceDefinitionsFound");
+ }
+
+ return model;
+ }
+
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#processService(Service, Model, WSDLDocument)
+ */
+ protected void processService(org.jboss.com.sun.tools.ws.wsdl.document.Service wsdlService, Model model, WSDLDocument document) {
+ String serviceInterface = "";
+ QName serviceQName = getQNameOf(wsdlService);
+ serviceInterface = getServiceInterfaceName(serviceQName, wsdlService);
+ if (isConflictingServiceClassName(serviceInterface)) {
+ serviceInterface += "_Service";
+ }
+ Service service =
+ new Service(
+ serviceQName,
+ new JavaInterface(serviceInterface, serviceInterface + "Impl"));
+
+ setDocumentationIfPresent(service, wsdlService.getDocumentation());
+ boolean hasPorts = false;
+ for (Iterator iter = wsdlService.ports(); iter.hasNext();) {
+ boolean processed =
+ processPort(
+ (org.jboss.com.sun.tools.ws.wsdl.document.Port)iter.next(),
+ service,
+ document);
+ hasPorts = hasPorts || processed;
+ }
+ if (!hasPorts) {
+ // emit a warning if there are no ports
+ warn("wsdlmodeler.warning.noPortsInService", wsdlService.getName());
+ }else{
+ model.addService(service);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#processPort(Port, Service, WSDLDocument)
+ */
+ protected boolean processPort(org.jboss.com.sun.tools.ws.wsdl.document.Port wsdlPort,
+ Service service, WSDLDocument document) {
+ try {
+
+ //clear the unique block map
+ uniqueBodyBlocks.clear();
+
+ QName portQName = getQNameOf(wsdlPort);
+ Port port = new Port(portQName);
+
+ setDocumentationIfPresent(port, wsdlPort.getDocumentation());
+
+ SOAPAddress soapAddress =
+ (SOAPAddress)getExtensionOfType(wsdlPort, SOAPAddress.class);
+ if (soapAddress == null) {
+ // not a SOAP port, ignore it
+ warn("wsdlmodeler.warning.ignoringNonSOAPPort.noAddress", wsdlPort.getName());
+ return false;
+ }
+
+ port.setAddress(soapAddress.getLocation());
+ Binding binding = wsdlPort.resolveBinding(document);
+ QName bindingName = getQNameOf(binding);
+ PortType portType = binding.resolvePortType(document);
+
+ port.setProperty(
+ ModelProperties.PROPERTY_WSDL_PORT_NAME,
+ getQNameOf(wsdlPort));
+ port.setProperty(
+ ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME,
+ getQNameOf(portType));
+ port.setProperty(
+ ModelProperties.PROPERTY_WSDL_BINDING_NAME,
+ bindingName);
+
+ boolean isProvider = isProvider(wsdlPort);
+ if (_bindingNameToPortMap.containsKey(bindingName) && !isProvider) {
+ // this binding has been processed before
+ Port existingPort =
+ _bindingNameToPortMap.get(bindingName);
+ port.setOperations(existingPort.getOperations());
+ port.setJavaInterface(existingPort.getJavaInterface());
+ port.setStyle(existingPort.getStyle());
+ port.setWrapped(existingPort.isWrapped());
+ } else {
+ // find out the SOAP binding extension, if any
+ SOAPBinding soapBinding =
+ (SOAPBinding)getExtensionOfType(binding, SOAPBinding.class);
+
+ if (soapBinding == null) {
+ soapBinding =
+ (SOAPBinding)getExtensionOfType(binding, SOAP12Binding.class);
+ if (soapBinding == null) {
+ // cannot deal with non-SOAP ports
+ warn(
+ "wsdlmodeler.warning.ignoringNonSOAPPort",
+ wsdlPort.getName());
+ return false;
+ }
+ // we can only do soap1.2 if extensions are on
+ if (extensions) {
+ warn("wsdlmodeler.warning.port.SOAPBinding12", wsdlPort.getName());
+ } else {
+ warn("wsdlmodeler.warning.ignoringSOAPBinding12",
+ wsdlPort.getName());
+ return false;
+ }
+ }
+
+ if (soapBinding.getTransport() == null
+ || (!soapBinding.getTransport().equals(
+ SOAPConstants.URI_SOAP_TRANSPORT_HTTP) && !soapBinding.getTransport().equals(
+ SOAP12Constants.URI_SOAP_TRANSPORT_HTTP))) {
+ // cannot deal with non-HTTP ports
+ warn(
+ "wsdlmodeler.warning.ignoringSOAPBinding.nonHTTPTransport",
+ wsdlPort.getName());
+ return false;
+ }
+
+ /**
+ * validate wsdl:binding uniqueness in style, e.g. rpclit or doclit
+ * ref: WSI BP 1.1 R 2705
+ */
+ if(!validateWSDLBindingStyle(binding)){
+ if(extensions){
+ warn("wsdlmodeler.warning.port.SOAPBinding.mixedStyle", wsdlPort.getName());
+ }else{
+ fail("wsdlmodeler.warning.ignoringSOAPBinding.mixedStyle",
+ wsdlPort.getName());
+ return false;
+ }
+ }
+
+ port.setStyle(soapBinding.getStyle());
+ boolean hasOverloadedOperations = false;
+ Set<String> operationNames = new HashSet<String>();
+ for (Iterator iter = portType.operations(); iter.hasNext();) {
+ org.jboss.com.sun.tools.ws.wsdl.document.Operation operation =
+ (org.jboss.com.sun.tools.ws.wsdl.document.Operation)iter.next();
+
+ if (operationNames.contains(operation.getName())) {
+ hasOverloadedOperations = true;
+ break;
+ }
+ operationNames.add(operation.getName());
+
+ for (Iterator itr = binding.operations();
+ iter.hasNext();
+ ) {
+ BindingOperation bindingOperation =
+ (BindingOperation)itr.next();
+ if (operation
+ .getName()
+ .equals(bindingOperation.getName())) {
+ break;
+ } else if (!itr.hasNext()) {
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.notFound",
+ new Object[] {
+ operation.getName(),
+ binding.getName()});
+ }
+ }
+ }
+
+ Map headers = new HashMap();
+ boolean hasOperations = false;
+ for (Iterator iter = binding.operations(); iter.hasNext();) {
+ BindingOperation bindingOperation =
+ (BindingOperation)iter.next();
+
+ org.jboss.com.sun.tools.ws.wsdl.document.Operation portTypeOperation =
+ null;
+ Set operations =
+ portType.getOperationsNamed(bindingOperation.getName());
+ if (operations.size() == 0) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.notInPortType",
+ new Object[] {
+ bindingOperation.getName(),
+ binding.getName()});
+ } else if (operations.size() == 1) {
+ portTypeOperation =
+ (org.jboss.com.sun.tools.ws.wsdl.document.Operation)operations
+ .iterator()
+ .next();
+ } else {
+ boolean found = false;
+ String expectedInputName =
+ bindingOperation.getInput().getName();
+ String expectedOutputName =
+ bindingOperation.getOutput().getName();
+
+ for (Iterator iter2 = operations.iterator();iter2.hasNext();) {
+ org.jboss.com.sun.tools.ws.wsdl.document.Operation candidateOperation =
+ (org.jboss.com.sun.tools.ws.wsdl.document.Operation)iter2
+ .next();
+
+ if (expectedInputName == null) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.missingInputName",
+ new Object[] {
+ bindingOperation.getName(),
+ binding.getName()});
+ }
+ if (expectedOutputName == null) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.missingOutputName",
+ new Object[] {
+ bindingOperation.getName(),
+ binding.getName()});
+ }
+ if (expectedInputName
+ .equals(candidateOperation.getInput().getName())
+ && expectedOutputName.equals(
+ candidateOperation
+ .getOutput()
+ .getName())) {
+ if (found) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.multipleMatchingOperations",
+ new Object[] {
+ bindingOperation.getName(),
+ binding.getName()});
+ }
+ // got it!
+ found = true;
+ portTypeOperation = candidateOperation;
+ }
+ }
+ if (!found) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.notFound",
+ new Object[] {
+ bindingOperation.getName(),
+ binding.getName()});
+ }
+ }
+ if(!isProvider){
+ this.info =
+ new ProcessSOAPOperationInfo(
+ port,
+ wsdlPort,
+ portTypeOperation,
+ bindingOperation,
+ soapBinding,
+ document,
+ hasOverloadedOperations,
+ headers);
+
+ Operation operation = processSOAPOperation();
+ if (operation != null) {
+ port.addOperation(operation);
+ hasOperations = true;
+ }
+ }
+ }
+ if (!isProvider && !hasOperations) {
+ // emit a warning if there are no operations, except when its a provider port
+ warn("wsdlmodeler.warning.noOperationsInPort",
+ wsdlPort.getName());
+ return false;
+ }
+ createJavaInterfaceForPort(port, isProvider);
+ PortType pt = binding.resolvePortType(document);
+ String jd = (pt.getDocumentation() != null)?pt.getDocumentation().getContent():null;
+ port.getJavaInterface().setJavaDoc(jd);
+ _bindingNameToPortMap.put(bindingName, port);
+ }
+
+ // now deal with the configured handlers
+ port.setClientHandlerChainInfo(
+ _modelInfo.getClientHandlerChainInfo());
+ port.setServerHandlerChainInfo(
+ _modelInfo.getServerHandlerChainInfo());
+
+ service.addPort(port);
+ applyPortMethodCustomization(port, wsdlPort);
+ applyWrapperStyleCustomization(port, binding.resolvePortType(document));
+
+ return true;
+
+ } catch (NoSuchEntityException e) {
+ warn(e);
+ // should not happen
+ return false;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#processSOAPOperation()
+ */
+ protected Operation processSOAPOperation() {
+ Operation operation =
+ new Operation(new QName(null, info.bindingOperation.getName()));
+
+ setDocumentationIfPresent(
+ operation,
+ info.portTypeOperation.getDocumentation());
+
+ if (info.portTypeOperation.getStyle()
+ != OperationStyle.REQUEST_RESPONSE
+ && info.portTypeOperation.getStyle() != OperationStyle.ONE_WAY) {
+ if(extensions){
+ warn(
+ "wsdlmodeler.warning.ignoringOperation.notSupportedStyle",
+ info.portTypeOperation.getName());
+ return null;
+ }
+ fail("wsdlmodeler.invalid.operation.notSupportedStyle",
+ new Object[]{info.portTypeOperation.getName(),
+ info.port.resolveBinding(document).resolvePortType(document).getName()});
+ }
+
+ SOAPStyle soapStyle = info.soapBinding.getStyle();
+
+ // find out the SOAP operation extension, if any
+ SOAPOperation soapOperation =
+ (SOAPOperation)getExtensionOfType(info.bindingOperation,
+ SOAPOperation.class);
+
+ if (soapOperation != null) {
+ if (soapOperation.getStyle() != null) {
+ soapStyle = soapOperation.getStyle();
+ }
+ if (soapOperation.getSOAPAction() != null) {
+ operation.setSOAPAction(soapOperation.getSOAPAction());
+ }
+ }
+
+ operation.setStyle(soapStyle);
+
+ String uniqueOperationName =
+ getUniqueName(info.portTypeOperation, info.hasOverloadedOperations);
+ if (info.hasOverloadedOperations) {
+ operation.setUniqueName(uniqueOperationName);
+ }
+
+ info.operation = operation;
+ info.uniqueOperationName = uniqueOperationName;
+
+ //attachment
+ SOAPBody soapRequestBody = getSOAPRequestBody();
+ if (soapRequestBody == null) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.inputMissingSoapBody",
+ new Object[] { info.bindingOperation.getName()});
+ }
+
+ if (soapStyle == SOAPStyle.RPC) {
+ if (soapRequestBody.isEncoded()) {
+ throw new ModelerException("wsdlmodeler20.rpcenc.not.supported");
+ }
+ return processLiteralSOAPOperation(StyleAndUse.RPC_LITERAL);
+ }
+ // document style
+ return processLiteralSOAPOperation(StyleAndUse.DOC_LITERAL);
+ }
+
+ protected Operation processLiteralSOAPOperation(StyleAndUse styleAndUse){
+ //returns false if the operation name is not acceptable
+ if(!applyOperationNameCustomization())
+ return null;
+
+ boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
+ Request request = new Request();
+ Response response = new Response();
+ info.operation.setUse(SOAPUse.LITERAL);
+ SOAPBody soapRequestBody = getSOAPRequestBody();
+ if((StyleAndUse.DOC_LITERAL == styleAndUse) && (soapRequestBody.getNamespace() != null)){
+ warn("wsdlmodeler.warning.r2716", new Object[]{"soapbind:body", info.bindingOperation.getName()});
+ }
+
+ Message inputMessage = getInputMessage();
+
+ SOAPBody soapResponseBody = null;
+ Message outputMessage = null;
+ if (isRequestResponse) {
+ soapResponseBody = getSOAPResponseBody();
+ if (isOperationDocumentLiteral(styleAndUse) && (soapResponseBody.getNamespace() != null)) {
+ warn("wsdlmodeler.warning.r2716", new Object[]{"soapbind:body", info.bindingOperation.getName()});
+ }
+ outputMessage = getOutputMessage();
+ }
+
+ //ignore operation if there are more than one root part
+ if(!validateMimeParts(getMimeParts(info.bindingOperation.getInput())) ||
+ !validateMimeParts(getMimeParts(info.bindingOperation.getOutput())))
+ return null;
+
+
+ if(!validateBodyParts(info.bindingOperation)){
+ // BP 1.1
+ // R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s),
+ // only to wsdl:part element(s) that have been defined using the element attribute.
+
+ // R2203 An rpc-literal binding in a DESCRIPTION MUST refer, in its soapbind:body element(s),
+ // only to wsdNl:part element(s) that have been defined using the type attribute.
+ if(isOperationDocumentLiteral(styleAndUse))
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.cannotHandleTypeMessagePart", info.portTypeOperation.getName());
+ else
+ fail("wsdlmodeler.invalid.doclitoperation", info.portTypeOperation.getName());
+ else if(isOperationRpcLiteral(styleAndUse)) {
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.cannotHandleElementMessagePart", info.portTypeOperation.getName());
+ else
+ fail("wsdlmodeler.invalid.rpclitoperation", info.portTypeOperation.getName());
+ }
+ return null;
+ }
+
+ // Process parameterOrder and get the parameterList
+ List<MessagePart> parameterList = getParameterOrder();
+
+ //binding is invalid in the wsdl, ignore the operation.
+ if(!setMessagePartsBinding(styleAndUse))
+ return null;
+
+ List<Parameter> params = null;
+ boolean unwrappable = isUnwrappable();
+ info.operation.setWrapped(unwrappable);
+ if(isOperationDocumentLiteral(styleAndUse)){
+ params = getDoclitParameters(request, response, parameterList);
+ }else if(isOperationRpcLiteral(styleAndUse)){
+ String operationName = info.bindingOperation.getName();
+ Block reqBlock = null;
+ if (inputMessage != null) {
+ QName name = new QName(getRequestNamespaceURI(soapRequestBody), operationName);
+ RpcLitStructure rpcStruct = new RpcLitStructure(name, getJAXBModelBuilder().getJAXBModel());
+ rpcStruct.setJavaType(new JavaSimpleType("org.jboss.com.sun.xml.ws.encoding.jaxb.RpcLitPayload", null));
+ reqBlock = new Block(name, rpcStruct);
+ request.addBodyBlock(reqBlock);
+ }
+
+ Block resBlock = null;
+ if (isRequestResponse && outputMessage != null) {
+ QName name = new QName(getResponseNamespaceURI(soapResponseBody), operationName + "Response");
+ RpcLitStructure rpcStruct = new RpcLitStructure(name, getJAXBModelBuilder().getJAXBModel());
+ rpcStruct.setJavaType(new JavaSimpleType("org.jboss.com.sun.xml.ws.encoding.jaxb.RpcLitPayload", null));
+ resBlock = new Block(name, rpcStruct);
+ response.addBodyBlock(resBlock);
+ }
+ params = getRpcLitParameters(request, response, reqBlock, resBlock, parameterList);
+ }
+
+
+ if(!validateParameterName(params)) {
+ return null;
+ }
+
+ // create a definitive list of parameters to match what we'd like to get
+ // in the java interface (which is generated much later), parameterOrder
+ List<Parameter> definitiveParameterList = new ArrayList<Parameter>();
+ for (Parameter param: params) {
+ if(param.isReturn()){
+ info.operation.setProperty(WSDL_RESULT_PARAMETER, param);
+ response.addParameter(param);
+ continue;
+ }
+ if(param.isIN()){
+ request.addParameter(param);
+ }else if(param.isOUT()){
+ response.addParameter(param);
+ }else if(param.isINOUT()){
+ request.addParameter(param);
+ response.addParameter(param);
+ }
+ definitiveParameterList.add(param);
+ }
+
+ info.operation.setRequest(request);
+
+ if (isRequestResponse) {
+ info.operation.setResponse(response);
+ }
+
+ Iterator<Block> bb = request.getBodyBlocks();
+ QName body = VOID_BODYBLOCK;
+ QName opName = null;
+
+ if(bb.hasNext()){
+ body = bb.next().getName();
+ opName = uniqueBodyBlocks.get(body);
+ }else{
+ //there is no body block
+ body = VOID_BODYBLOCK;
+ opName = uniqueBodyBlocks.get(VOID_BODYBLOCK);
+ }
+ if(opName != null){
+ fail("wsdlmodeler.nonUnique.body", new Object[]{info.port.getName(), info.operation.getName(), opName, body});
+ }else{
+ uniqueBodyBlocks.put(body, info.operation.getName());
+ }
+
+ // faults with duplicate names
+ Set duplicateNames = getDuplicateFaultNames();
+
+ // handle soap:fault
+ handleLiteralSOAPFault(response, duplicateNames);
+ info.operation.setProperty(
+ WSDL_PARAMETER_ORDER,
+ definitiveParameterList);
+
+ //set Async property
+ Binding binding = info.port.resolveBinding(document);
+ PortType portType = binding.resolvePortType(document);
+ if(isAsync(portType, info.portTypeOperation)){
+ addAsyncOperations(info.operation, styleAndUse);
+ }
+
+ return info.operation;
+ }
+
+ /**
+ *
+ * @param params
+ * @return
+ */
+ private boolean validateParameterName(List<Parameter> params) {
+ Message msg = getInputMessage();
+ for(Parameter param : params){
+ if(param.isOUT())
+ continue;
+ if(param.getCustomName() != null){
+ if(getEnvironment().getNames().isJavaReservedWord(param.getCustomName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customName",
+ new Object[]{info.operation.getName(), param.getCustomName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customName",
+ new Object[]{info.operation.getName(), param.getCustomName()});
+ return false;
+ }
+ return true;
+ }
+ //process doclit wrapper style
+ if(param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)){
+ if(getEnvironment().getNames().isJavaReservedWord(param.getName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.wrapperStyle", new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.wrapperStyle", new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
+ return false;
+ }
+ }else{
+ //non-wrapper style and rpclit
+ if(getEnvironment().getNames().isJavaReservedWord(param.getName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.nonWrapperStyle", new Object[]{info.operation.getName(), msg.getName(), param.getName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.nonWrapperStyle", new Object[]{info.operation.getName(), msg.getName(), param.getName()});
+ return false;
+ }
+ }
+ }
+
+ boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
+ if(isRequestResponse){
+ msg = getOutputMessage();
+ for(Parameter param : params){
+ if(param.isIN())
+ continue;
+ if(param.getCustomName() != null){
+ if(getEnvironment().getNames().isJavaReservedWord(param.getCustomName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customName",
+ new Object[]{info.operation.getName(), param.getCustomName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customName",
+ new Object[]{info.operation.getName(), param.getCustomName()});
+ return false;
+ }
+ return true;
+ }
+ //process doclit wrapper style
+ if(param.isEmbedded() && !(param.getBlock().getType() instanceof RpcLitStructure)){
+ if(param.isReturn())
+ continue;
+ if(!param.getName().equals("return") && getEnvironment().getNames().isJavaReservedWord(param.getName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.wrapperStyle",
+ new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.wrapperStyle",
+ new Object[]{info.operation.getName(), param.getName(), param.getBlock().getName()});
+ return false;
+ }
+ }else{
+ if(param.isReturn())
+ continue;
+
+ //non-wrapper style and rpclit
+ if(getEnvironment().getNames().isJavaReservedWord(param.getName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.nonWrapperStyle", new Object[]{info.operation.getName(), msg.getName(), param.getName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.nonWrapperStyle",
+ new Object[]{info.operation.getName(), msg.getName(), param.getName()});
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * @return
+ */
+ private boolean enableMimeContent() {
+ //first we look at binding operation
+ JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(info.bindingOperation, JAXWSBinding.class);
+ Boolean mimeContentMapping = (jaxwsCustomization != null)?jaxwsCustomization.isEnableMimeContentMapping():null;
+ if(mimeContentMapping != null)
+ return mimeContentMapping;
+
+ //then in wsdl:binding
+ Binding binding = info.port.resolveBinding(info.document);
+ jaxwsCustomization = (JAXWSBinding)getExtensionOfType(binding, JAXWSBinding.class);
+ mimeContentMapping = (jaxwsCustomization != null)?jaxwsCustomization.isEnableMimeContentMapping():null;
+ if(mimeContentMapping != null)
+ return mimeContentMapping;
+
+ //at last look in wsdl:definitions
+ jaxwsCustomization = (JAXWSBinding)getExtensionOfType(info.document.getDefinitions(), JAXWSBinding.class);
+ mimeContentMapping = (jaxwsCustomization != null)?jaxwsCustomization.isEnableMimeContentMapping():null;
+ if(mimeContentMapping != null)
+ return mimeContentMapping;
+ return false;
+ }
+
+ /**
+ *
+ */
+ private boolean applyOperationNameCustomization() {
+ JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(info.portTypeOperation, JAXWSBinding.class);
+ String operationName = (jaxwsCustomization != null)?((jaxwsCustomization.getMethodName() != null)?jaxwsCustomization.getMethodName().getName():null):null;
+ if(operationName != null){
+ if(getEnvironment().getNames().isJavaReservedWord(operationName)){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.customizedOperationName", new Object[]{info.operation.getName(), operationName});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.customizedOperationName", new Object[]{info.operation.getName(), operationName});
+ return false;
+ }
+
+ info.operation.setCustomizedName(operationName);
+ }
+
+ if(getEnvironment().getNames().isJavaReservedWord(info.operation.getJavaMethodName())){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.javaReservedWordNotAllowed.operationName", new Object[]{info.operation.getName()});
+ else
+ fail("wsdlmodeler.invalid.operation.javaReservedWordNotAllowed.operationName", new Object[]{info.operation.getName()});
+ return false;
+ }
+ return true;
+ }
+
+ protected String getAsyncOperationName(Operation operation){
+ String name = operation.getCustomizedName();
+ if(name == null)
+ name = operation.getUniqueName();
+ return name;
+ }
+
+ /**
+ * @param styleAndUse
+ */
+ private void addAsyncOperations(Operation syncOperation, StyleAndUse styleAndUse) {
+ Operation operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.POLLING);
+ if(operation != null)
+ info.modelPort.addOperation(operation);
+
+ operation = createAsyncOperation(syncOperation, styleAndUse, AsyncOperationType.CALLBACK);
+ if(operation != null)
+ info.modelPort.addOperation(operation);
+ }
+
+ /**
+ *
+ * @param syncOperation
+ * @param styleAndUse
+ * @param asyncType
+ * @return
+ */
+ private Operation createAsyncOperation(Operation syncOperation, StyleAndUse styleAndUse, AsyncOperationType asyncType) {
+ boolean isRequestResponse = info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
+ if(!isRequestResponse)
+ return null;
+ Request request = new Request();
+ Response response = new Response();
+
+ //create async operations
+ AsyncOperation operation = new AsyncOperation(info.operation);
+
+ //creation the async operation name: operationName+Async or customized name
+ //operation.setName(new QName(operation.getName().getNamespaceURI(), getAsyncOperationName(info.portTypeOperation, operation)));
+ if(asyncType.equals(AsyncOperationType.CALLBACK))
+ operation.setUniqueName(info.operation.getUniqueName()+"_async_callback");
+ else if(asyncType.equals(AsyncOperationType.POLLING))
+ operation.setUniqueName(info.operation.getUniqueName()+"_async_polling");
+
+ setDocumentationIfPresent(
+ operation,
+ info.portTypeOperation.getDocumentation());
+
+ operation.setAsyncType(asyncType);
+ operation.setSOAPAction(info.operation.getSOAPAction());
+ boolean unwrappable = info.operation.isWrapped();
+ operation.setWrapped(unwrappable);
+ SOAPBody soapRequestBody = getSOAPRequestBody();
+
+ Message inputMessage = getInputMessage();
+
+ SOAPBody soapResponseBody = null;
+ Message outputMessage = null;
+ if (isRequestResponse) {
+ soapResponseBody = getSOAPResponseBody();
+ outputMessage = getOutputMessage();
+ }
+
+ // Process parameterOrder and get the parameterList
+ java.util.List<String> parameterList = getAsynParameterOrder();
+
+ List<Parameter> inParameters = null;
+ if(isOperationDocumentLiteral(styleAndUse)){
+ inParameters = getRequestParameters(request, parameterList);
+ // outParameters = getResponseParameters(response);
+ // re-create parameterList with unwrapped parameters
+ if(unwrappable){
+ List<String> unwrappedParameterList = new ArrayList<String>();
+ if(inputMessage != null){
+ Iterator<MessagePart> parts = inputMessage.parts();
+ if(parts.hasNext()){
+ MessagePart part = parts.next();
+ JAXBType jaxbType = getJAXBType(part.getDescriptor());
+ List<JAXBProperty> memberList = jaxbType.getWrapperChildren();
+ Iterator<JAXBProperty> props = memberList.iterator();
+ while(props.hasNext()){
+ JAXBProperty prop = props.next();
+ unwrappedParameterList.add(prop.getElementName().getLocalPart());
+ }
+ }
+ }
+
+ parameterList.clear();
+ parameterList.addAll(unwrappedParameterList);
+ }
+ }else if(isOperationRpcLiteral(styleAndUse)){
+ String operationName = info.bindingOperation.getName();
+ Block reqBlock = null;
+ if (inputMessage != null) {
+ QName name = new QName(getRequestNamespaceURI(soapRequestBody), operationName);
+ RpcLitStructure rpcStruct = new RpcLitStructure(name, getJAXBModelBuilder().getJAXBModel());
+ rpcStruct.setJavaType(new JavaSimpleType("org.jboss.com.sun.xml.ws.encoding.jaxb.RpcLitPayload", null));
+ reqBlock = new Block(name, rpcStruct);
+ request.addBodyBlock(reqBlock);
+ }
+ inParameters = createRpcLitRequestParameters(request, parameterList, reqBlock);
+ }
+
+ // add response blocks, we dont need to create respnse parameters, just blocks will be fine, lets
+ // copy them from sync optraions
+ //copy the response blocks from the sync operation
+ Iterator<Block> blocks = info.operation.getResponse().getBodyBlocks();
+
+ while(blocks.hasNext()){
+ response.addBodyBlock(blocks.next());
+ }
+
+ blocks = info.operation.getResponse().getHeaderBlocks();
+ while(blocks.hasNext()){
+ response.addHeaderBlock(blocks.next());
+ }
+
+ blocks = info.operation.getResponse().getAttachmentBlocks();
+ while(blocks.hasNext()){
+ response.addAttachmentBlock(blocks.next());
+ }
+
+ List<MessagePart> outputParts = outputMessage.getParts();
+
+ // handle headers
+ int numOfOutMsgParts = outputParts.size();
+
+ if(isRequestResponse){
+ if(numOfOutMsgParts == 1){
+ MessagePart part = outputParts.get(0);
+ if(isOperationDocumentLiteral(styleAndUse)){
+ JAXBType type = getJAXBType(part.getDescriptor());
+ operation.setResponseBean(type);
+ }else if(isOperationRpcLiteral(styleAndUse)){
+ String operationName = info.bindingOperation.getName();
+ Block resBlock = null;
+ if (isRequestResponse && outputMessage != null) {
+ resBlock = info.operation.getResponse().getBodyBlocksMap().get(new QName(getResponseNamespaceURI(soapResponseBody),
+ operationName + "Response"));
+ }
+ RpcLitStructure resBean = (resBlock == null) ? null : (RpcLitStructure)resBlock.getType();
+ List<RpcLitMember> members = resBean.getRpcLitMembers();
+
+ operation.setResponseBean(members.get(0));
+ }
+ }else{
+ //create response bean
+ String nspace = "";
+ QName responseBeanName = new QName(nspace,getAsyncOperationName(info.operation) +"Response");
+ JAXBType responseBeanType = getJAXBType(responseBeanName);
+ operation.setResponseBean(responseBeanType);
+ }
+ }
+ QName respBeanName = new QName(soapResponseBody.getNamespace(),getAsyncOperationName(info.operation)+"Response");
+ Block block = new Block(respBeanName, operation.getResponseBeanType());
+ JavaType respJavaType = operation.getResponseBeanJavaType();
+ JAXBType respType = new JAXBType(respBeanName, respJavaType);
+ Parameter respParam = ModelerUtils.createParameter(info.operation.getName()+"Response", respType, block);
+ respParam.setParameterIndex(-1);
+ response.addParameter(respParam);
+ operation.setProperty(WSDL_RESULT_PARAMETER, respParam.getName());
+
+
+ List<String> definitiveParameterList = new ArrayList<String>();
+ int parameterOrderPosition = 0;
+ for (String name: parameterList) {
+ Parameter inParameter = null;
+
+ inParameter = ModelerUtils.getParameter(name, inParameters);
+ if(inParameter == null){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringOperation.partNotFound", new Object[]{info.operation.getName().getLocalPart(), name});
+ else
+ fail("wsdlmodeler.error.partNotFound", new Object[]{info.operation.getName().getLocalPart(), name});
+ return null;
+ }
+ request.addParameter(inParameter);
+ inParameter.setParameterIndex(parameterOrderPosition);
+ definitiveParameterList.add(name);
+ parameterOrderPosition++;
+ }
+
+ if (isRequestResponse) {
+ operation.setResponse(response);
+ }
+
+ // add callback handlerb Parameter to request
+ if(operation.getAsyncType().equals(AsyncOperationType.CALLBACK)){
+ JavaType cbJavaType = operation.getCallBackType();
+ JAXBType callbackType = new JAXBType(respBeanName, cbJavaType);
+ Parameter cbParam = ModelerUtils.createParameter("asyncHandler", callbackType, block);
+ request.addParameter(cbParam);
+ }
+
+ operation.setRequest(request);
+
+ return operation;
+ }
+
+ protected boolean isAsync(org.jboss.com.sun.tools.ws.wsdl.document.PortType portType, org.jboss.com.sun.tools.ws.wsdl.document.Operation wsdlOperation){
+ //First look into wsdl:operation
+ JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(wsdlOperation, JAXWSBinding.class);
+ Boolean isAsync = (jaxwsCustomization != null)?jaxwsCustomization.isEnableAsyncMapping():null;
+
+ if(isAsync != null)
+ return isAsync;
+
+ // then into wsdl:portType
+ QName portTypeName = new QName(portType.getDefining().getTargetNamespaceURI(), portType.getName());
+ if(portTypeName != null){
+ jaxwsCustomization = (JAXWSBinding)getExtensionOfType(portType, JAXWSBinding.class);
+ isAsync = (jaxwsCustomization != null)?jaxwsCustomization.isEnableAsyncMapping():null;
+ if(isAsync != null)
+ return isAsync;
+ }
+
+ //then wsdl:definitions
+ jaxwsCustomization = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+ isAsync = (jaxwsCustomization != null)?jaxwsCustomization.isEnableAsyncMapping():null;
+ if(isAsync != null)
+ return isAsync;
+ return false;
+ }
+
+ protected void handleLiteralSOAPHeaders(Request request, Response response, Iterator headerParts, Set duplicateNames, List definitiveParameterList, boolean processRequest) {
+ QName headerName = null;
+ Block headerBlock = null;
+ JAXBType jaxbType = null;
+ int parameterOrderPosition = definitiveParameterList.size();
+ while(headerParts.hasNext()){
+ MessagePart part = (MessagePart)headerParts.next();
+ headerName = part.getDescriptor();
+ jaxbType = getJAXBType(headerName);
+ headerBlock = new Block(headerName, jaxbType);
+ Extensible ext;
+ if(processRequest){
+ ext = info.bindingOperation.getInput();
+ }else{
+ ext = info.bindingOperation.getOutput();
+ }
+ Message headerMessage = getHeaderMessage(part, ext);
+
+ if(processRequest){
+ request.addHeaderBlock(headerBlock);
+ }else{
+ response.addHeaderBlock(headerBlock);
+ }
+
+ Parameter parameter = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock);
+ parameter.setParameterIndex(parameterOrderPosition);
+ setCustomizedParameterName(info.bindingOperation, headerMessage, part, parameter, false);
+ if (processRequest && definitiveParameterList != null) {
+ request.addParameter(parameter);
+ definitiveParameterList.add(parameter.getName());
+ } else {
+ if (definitiveParameterList != null) {
+ for (Iterator iterInParams = definitiveParameterList.iterator(); iterInParams.hasNext();) {
+ String inParamName =
+ (String)iterInParams.next();
+ if (inParamName.equals(parameter.getName())) {
+ Parameter inParam = request.getParameterByName(inParamName);
+ parameter.setLinkedParameter(inParam);
+ inParam.setLinkedParameter(parameter);
+ //its in/out parameter, input and output parameter have the same order position.
+ parameter.setParameterIndex(inParam.getParameterIndex());
+ }
+ }
+ if (!definitiveParameterList.contains(parameter.getName())) {
+ definitiveParameterList.add(parameter.getName());
+ }
+ }
+ response.addParameter(parameter);
+ }
+ parameterOrderPosition++;
+ }
+
+ }
+
+ protected void handleLiteralSOAPFault(Response response, Set duplicateNames){
+ for (Iterator iter = info.bindingOperation.faults(); iter.hasNext();){
+ BindingFault bindingFault = (BindingFault)iter.next();
+ org.jboss.com.sun.tools.ws.wsdl.document.Fault portTypeFault = null;
+ for(Iterator iter2 = info.portTypeOperation.faults(); iter2.hasNext();){
+ org.jboss.com.sun.tools.ws.wsdl.document.Fault aFault =
+ (org.jboss.com.sun.tools.ws.wsdl.document.Fault)iter2.next();
+ if(aFault.getName().equals(bindingFault.getName())){
+ if(portTypeFault != null){
+ // the WSDL document is invalid, a wsld:fault in a wsdl:operation of a portType can be bound only once
+ throw new ModelerException("wsdlmodeler.invalid.bindingFault.notUnique",
+ new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+ }
+ portTypeFault = aFault;
+ }
+ }
+
+ // The WSDL document is invalid, the wsdl:fault in abstract operation is does not have any binding
+ if(portTypeFault == null){
+ throw new ModelerException("wsdlmodeler.invalid.bindingFault.notFound",
+ new Object[] {bindingFault.getName(), info.bindingOperation.getName()});
+
+ }
+
+ // wsdl:fault message name is used to create the java exception name later on
+ String faultName = getFaultClassName(portTypeFault);
+ Fault fault = new Fault(faultName);
+ setDocumentationIfPresent(fault, portTypeFault.getDocumentation());
+
+ //get the soapbind:fault from wsdl:fault in the binding
+ SOAPFault soapFault = (SOAPFault)getExtensionOfType(bindingFault, SOAPFault.class);
+
+ // The WSDL document is invalid, can't have wsdl:fault without soapbind:fault
+ if(soapFault == null){
+ throw new ModelerException("wsdlmodeler.invalid.bindingFault.outputMissingSoapFault",
+ new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+ }
+
+ //the soapbind:fault must have use="literal" or no use attribute, in that case its assumed "literal"
+ if(!soapFault.isLiteral()){
+ if(extensions)
+ warn("wsdlmodeler.warning.ignoringFault.notLiteral",
+ new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+ else
+ fail("wsdlmodeler.invalid.operation.fault.notLiteral",
+ new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+ continue;
+ }
+
+ // the soapFault name must be present
+ if(soapFault.getName() == null){
+ warn("wsdlmodeler.invalid.bindingFault.noSoapFaultName",
+ new Object[]{bindingFault.getName(), info.bindingOperation.getName()});
+ }else if (!soapFault.getName().equals(bindingFault.getName())) {
+ // the soapFault name must match bindingFault name
+ warn("wsdlmodeler.invalid.bindingFault.wrongSoapFaultName",
+ new Object[]{soapFault.getName(), bindingFault.getName(), info.bindingOperation.getName()});
+ }else if(soapFault.getNamespace() != null){
+ // bug fix: 4852729
+ warn("wsdlmodeler.warning.r2716r2726",
+ new Object[] { "soapbind:fault", soapFault.getName()});
+ }
+
+ String faultNamespaceURI = soapFault.getNamespace();
+ if(faultNamespaceURI == null){
+ faultNamespaceURI = portTypeFault.getMessage().getNamespaceURI();
+ }
+
+ org.jboss.com.sun.tools.ws.wsdl.document.Message faultMessage = portTypeFault.resolveMessage(info.document);
+ Iterator iter2 = faultMessage.parts();
+ if(!iter2.hasNext()){
+ // the WSDL document is invalid
+ throw new ModelerException("wsdlmodeler.invalid.bindingFault.emptyMessage",
+ new Object[]{bindingFault.getName(), faultMessage.getName()});
+ }
+ MessagePart faultPart = (MessagePart)iter2.next();
+ QName faultQName = faultPart.getDescriptor();
+
+ // Don't include fault messages with non-unique soap:fault names
+ if (duplicateNames.contains(faultQName)) {
+ warn("wsdlmodeler.duplicate.fault.soap.name",
+ new Object[] {bindingFault.getName(), info.portTypeOperation.getName(), faultPart.getName()});
+ continue;
+ }
+
+ if (iter2.hasNext()) {
+ // the WSDL document is invalid
+ throw new ModelerException("wsdlmodeler.invalid.bindingFault.messageHasMoreThanOnePart",
+ new Object[]{bindingFault.getName(), faultMessage.getName()});
+ }
+
+ if (faultPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
+ throw new ModelerException("wsdlmodeler.invalid.message.partMustHaveElementDescriptor",
+ new Object[]{faultMessage.getName(), faultPart.getName()});
+ }
+
+ JAXBType jaxbType = getJAXBType(faultPart.getDescriptor());
+
+ fault.setElementName(faultPart.getDescriptor());
+ fault.setJavaMemberName(getEnvironment().getNames().getExceptionClassMemberName());
+
+ Block faultBlock = new Block(faultQName, jaxbType);
+ fault.setBlock(faultBlock);
+ createParentFault(fault);
+ createSubfaults(fault);
+ if(!response.getFaultBlocksMap().containsKey(faultBlock.getName()))
+ response.addFaultBlock(faultBlock);
+ info.operation.addFault(fault);
+ }
+ }
+
+ /**
+ * @param portTypeFault
+ * @return
+ */
+ private String getFaultClassName(org.jboss.com.sun.tools.ws.wsdl.document.Fault portTypeFault) {
+ JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(portTypeFault, JAXWSBinding.class);
+ if(jaxwsBinding != null){
+ CustomName className = jaxwsBinding.getClassName();
+ if(className != null){
+ return className.getName();
+ }
+ }
+ return portTypeFault.getMessage().getLocalPart();
+ }
+
+ protected boolean setMessagePartsBinding(StyleAndUse styleAndUse){
+ SOAPBody inBody = getSOAPRequestBody();
+ Message inMessage = getInputMessage();
+ if(!setMessagePartsBinding(inBody, inMessage, styleAndUse, true))
+ return false;
+
+ if(isRequestResponse()){
+ SOAPBody outBody = getSOAPResponseBody();
+ Message outMessage = getOutputMessage();
+ if(!setMessagePartsBinding(outBody, outMessage, styleAndUse, false))
+ return false;
+ }
+ return true;
+ }
+
+ //returns false if the wsdl is invalid and operation should be ignored
+ protected boolean setMessagePartsBinding(SOAPBody body, Message message, StyleAndUse styleAndUse, boolean isInput) {
+ List<MessagePart> parts = new ArrayList<MessagePart>();
+
+ //get Mime parts
+ List<MessagePart> mimeParts = null;
+ List<MessagePart> headerParts = null;
+ List<MessagePart> bodyParts = getBodyParts(body, message);
+
+ if(isInput){
+ headerParts = getHeaderPartsFromMessage(message, isInput);
+ mimeParts = getMimeContentParts(message, info.bindingOperation.getInput());
+ }else{
+ headerParts = getHeaderPartsFromMessage(message, isInput);
+ mimeParts = getMimeContentParts(message, info.bindingOperation.getOutput());
+ }
+
+ //As of now WSDL MIME binding is not supported, so throw the exception when such binding is encounterd
+// if(mimeParts.size() > 0){
+// fail("wsdlmodeler.unsupportedBinding.mime", new Object[]{});
+// }
+
+ //if soap:body parts attribute not there, then all unbounded message parts will
+ // belong to the soap body
+ if(bodyParts == null){
+ bodyParts = new ArrayList<MessagePart>();
+ for(Iterator<MessagePart> iter = message.parts();iter.hasNext();) {
+ MessagePart mPart = iter.next();
+ //Its a safe assumption that the parts in the message not belonging to header or mime will
+ // belong to the body?
+ if(mimeParts.contains(mPart) || headerParts.contains(mPart) || boundToFault(mPart.getName())){
+ //throw error that a part cant be bound multiple times, not ignoring operation, if there
+ //is conflict it will fail latter
+ if(extensions)
+ warn("wsdlmodeler.warning.bindingOperation.multiplePartBinding",
+ new Object[]{info.bindingOperation.getName(), mPart.getName()});
+ else
+ fail("wsdlmodeler.invalid.bindingOperation.multiplePartBinding",
+ new Object[]{info.bindingOperation.getName(), mPart.getName()});
+ }
+ bodyParts.add(mPart);
+ }
+ }
+
+ //now build the final parts list with header, mime parts and body parts
+ for(Iterator iter = message.parts();iter.hasNext();) {
+ MessagePart mPart = (MessagePart)iter.next();
+ if(mimeParts.contains(mPart)) {
+ mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING);
+ parts.add(mPart);
+ }else if(headerParts.contains(mPart)) {
+ mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
+ parts.add(mPart);
+ }else if(bodyParts.contains(mPart)) {
+ mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
+ parts.add(mPart);
+ }else{
+ mPart.setBindingExtensibilityElementKind(MessagePart.PART_NOT_BOUNDED);
+ }
+ }
+
+ if(isOperationDocumentLiteral(styleAndUse) && bodyParts.size() > 1){
+ if(extensions)
+ warn("wsdlmodeler.warning.operation.MoreThanOnePartInMessage",
+ info.portTypeOperation.getName());
+ else
+ fail("wsdlmodeler.invalid.operation.MoreThanOnePartInMessage", info.portTypeOperation.getName());
+ return false;
+ }
+ return true;
+ }
+
+ private boolean boundToFault(String partName){
+ for (Iterator iter = info.bindingOperation.faults(); iter.hasNext();){
+ BindingFault bindingFault = (BindingFault)iter.next();
+ if(partName.equals(bindingFault.getName()))
+ return true;
+ }
+ return false;
+ }
+
+ //get MessagePart(s) referenced by parts attribute of soap:body element
+ private List<MessagePart> getBodyParts(SOAPBody body, Message message){
+ String bodyParts = body.getParts();
+ if (bodyParts != null) {
+ List<MessagePart> partsList = new ArrayList<MessagePart>();
+ StringTokenizer in = new StringTokenizer(bodyParts.trim(), " ");
+ while (in.hasMoreTokens()) {
+ String part = in.nextToken();
+ MessagePart mPart = message.getPart(part);
+ if (null == mPart) {
+ throw new ModelerException(
+ "wsdlmodeler.error.partsNotFound",
+ new Object[] { part, message.getName()});
+ }
+ mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
+ partsList.add(mPart);
+ }
+ return partsList;
+ }
+ return null;
+ }
+
+ private List<MessagePart> getHeaderPartsFromMessage(Message message, boolean isInput){
+ List<MessagePart> headerParts = new ArrayList<MessagePart>();
+ Iterator<MessagePart> parts = message.parts();
+ List<MessagePart> headers = getHeaderParts(isInput);
+ while(parts.hasNext()){
+ MessagePart part = parts.next();
+ if(headers.contains(part)){
+ headerParts.add(part);
+ }
+ }
+ return headerParts;
+ }
+
+ private Message getHeaderMessage(MessagePart part, Extensible ext) {
+ Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
+ while(headers.hasNext()){
+ SOAPHeader header = headers.next();
+ if (!header.isLiteral())
+ continue;
+ org.jboss.com.sun.tools.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(), info);
+ if (headerMessage == null)
+ continue;
+
+ MessagePart headerPart = headerMessage.getPart(header.getPart());
+ if(headerPart == part)
+ return headerMessage;
+ }
+ return null;
+ }
+
+ private List<MessagePart> getHeaderPartsNotFromMessage(Message message, boolean isInput){
+ List<MessagePart> headerParts = new ArrayList<MessagePart>();
+ List<MessagePart> parts = message.getParts();
+ Iterator<MessagePart> headers = getHeaderParts(isInput).iterator();
+ while(headers.hasNext()){
+ MessagePart part = headers.next();
+ if(!parts.contains(part)){
+ headerParts.add(part);
+ }
+ }
+ return headerParts;
+ }
+
+ private List<MessagePart> getHeaderParts(boolean isInput) {
+ Extensible ext;
+ if(isInput){
+ ext = info.bindingOperation.getInput();
+ }else{
+ ext = info.bindingOperation.getOutput();
+ }
+
+ List<MessagePart> parts = new ArrayList<MessagePart>();
+ Iterator<SOAPHeader> headers = getHeaderExtensions(ext).iterator();
+ while(headers.hasNext()){
+ SOAPHeader header = headers.next();
+ if (!header.isLiteral()){
+ fail("wsdlmodeler.invalid.header.notLiteral",
+ new Object[] {header.getPart(), info.bindingOperation.getName()});
+ }
+
+ if (header.getNamespace() != null){
+ warn("wsdlmodeler.warning.r2716r2726",
+ new Object[]{"soapbind:header", info.bindingOperation.getName()});
+ }
+ org.jboss.com.sun.tools.ws.wsdl.document.Message headerMessage = findMessage(header.getMessage(), info);
+ if (headerMessage == null){
+ fail("wsdlmodeler.invalid.header.cant.resolve.message",
+ new Object[]{header.getMessage(), info.bindingOperation.getName()});
+ }
+
+ MessagePart part = headerMessage.getPart(header.getPart());
+ if (part == null){
+ fail("wsdlmodeler.invalid.header.notFound",
+ new Object[]{header.getPart(), info.bindingOperation.getName()});
+ }
+ if (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT) {
+ fail("wsdlmodeler.invalid.header.message.partMustHaveElementDescriptor",
+ new Object[]{part.getName(), info.bindingOperation.getName()});
+ }
+ part.setBindingExtensibilityElementKind(MessagePart.SOAP_HEADER_BINDING);
+ parts.add(part);
+ }
+ return parts;
+ }
+
+ private boolean isOperationDocumentLiteral(StyleAndUse styleAndUse){
+ return StyleAndUse.DOC_LITERAL == styleAndUse;
+ }
+
+ private boolean isOperationRpcLiteral(StyleAndUse styleAndUse){
+ return StyleAndUse.RPC_LITERAL == styleAndUse;
+ }
+
+ /**
+ * @param part
+ * @return Returns a JAXBType object
+ */
+ private JAXBType getJAXBType(MessagePart part){
+ JAXBType type=null;
+ QName name = part.getDescriptor();
+ if(part.getDescriptorKind().equals(SchemaKinds.XSD_ELEMENT)){
+ type = getJAXBType(name);
+ }else {
+ S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
+ TypeAndAnnotation typeAnno = jaxbModel.getJavaType(name);
+ if(typeAnno == null){
+ fail("wsdlmodeler.jaxb.javatype.notfound", new Object[]{name, part.getName()});
+ }
+ JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno));
+ type = new JAXBType(new QName("", part.getName()), javaType);
+ }
+ return type;
+ }
+
+ private List<Parameter> getDoclitParameters(Request req, Response res, List<MessagePart> parameterList){
+ if(parameterList.size() == 0)
+ return new ArrayList<Parameter>();
+ List<Parameter> params = null;
+ Message inMsg = getInputMessage();
+ Message outMsg = getOutputMessage();
+ boolean unwrappable = isUnwrappable();
+ List<Parameter> outParams = null;
+ int pIndex = 0;
+ for(MessagePart part:parameterList){
+ QName reqBodyName = part.getDescriptor();
+ JAXBType jaxbType = getJAXBType(part);
+ Block block = new Block(reqBodyName, jaxbType);
+ if(unwrappable){
+ //So build body and header blocks and set to request and response
+ JAXBStructuredType jaxbStructType = ModelerUtils.createJAXBStructureType(jaxbType);
+ block = new Block(reqBodyName, jaxbStructType);
+ if(ModelerUtils.isBoundToSOAPBody(part)){
+ if(part.isIN()){
+ req.addBodyBlock(block);
+ }else if(part.isOUT()){
+ res.addBodyBlock(block);
+ }else if(part.isINOUT()){
+ req.addBodyBlock(block);
+ res.addBodyBlock(block);
+ }
+ }else if(ModelerUtils.isUnbound(part)){
+ if(part.isIN())
+ req.addUnboundBlock(block);
+ else if(part.isOUT())
+ res.addUnboundBlock(block);
+ else if(part.isINOUT()){
+ req.addUnboundBlock(block);
+ res.addUnboundBlock(block);
+ }
+
+ }
+ if(part.isIN() || part.isINOUT()){
+ params = ModelerUtils.createUnwrappedParameters(jaxbStructType, block);
+ int index = 0;
+ Mode mode = (part.isINOUT())?Mode.INOUT:Mode.IN;
+ for(Parameter param: params){
+ param.setParameterIndex(index++);
+ param.setMode(mode);
+ setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, unwrappable);
+ }
+ }else if(part.isOUT()){
+ outParams = ModelerUtils.createUnwrappedParameters(jaxbStructType, block);
+ for(Parameter param: outParams){
+ param.setMode(Mode.OUT);
+ setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, unwrappable);
+ }
+ }
+ }else{
+ if(ModelerUtils.isBoundToSOAPBody(part)){
+ if(part.isIN()){
+ req.addBodyBlock(block);
+ }else if(part.isOUT()){
+ res.addBodyBlock(block);
+ }else if(part.isINOUT()){
+ req.addBodyBlock(block);
+ res.addBodyBlock(block);
+ }
+ }else if(ModelerUtils.isBoundToSOAPHeader(part)){
+ if(part.isIN()){
+ req.addHeaderBlock(block);
+ }else if(part.isOUT()){
+ res.addHeaderBlock(block);
+ }else if(part.isINOUT()){
+ req.addHeaderBlock(block);
+ res.addHeaderBlock(block);
+ }
+ }else if(ModelerUtils.isBoundToMimeContent(part)){
+ List<MIMEContent> mimeContents = null;
+
+ if(part.isIN()){
+ mimeContents = getMimeContents(info.bindingOperation.getInput(),
+ getInputMessage(), part.getName());
+ jaxbType = getAttachmentType(mimeContents, part);
+ block = new Block(jaxbType.getName(), jaxbType);
+ req.addAttachmentBlock(block);
+ }else if(part.isOUT()){
+ mimeContents = getMimeContents(info.bindingOperation.getOutput(),
+ getOutputMessage(), part.getName());
+ jaxbType = getAttachmentType(mimeContents, part);
+ block = new Block(jaxbType.getName(), jaxbType);
+ res.addAttachmentBlock(block);
+ }else if(part.isINOUT()){
+ mimeContents = getMimeContents(info.bindingOperation.getInput(),
+ getInputMessage(), part.getName());
+ jaxbType = getAttachmentType(mimeContents, part);
+ block = new Block(jaxbType.getName(), jaxbType);
+ req.addAttachmentBlock(block);
+ res.addAttachmentBlock(block);
+
+ mimeContents = getMimeContents(info.bindingOperation.getOutput(),
+ getOutputMessage(), part.getName());
+ JAXBType outJaxbType = getAttachmentType(mimeContents, part);
+
+ String inType = jaxbType.getJavaType().getType().getName();
+ String outType = outJaxbType.getJavaType().getType().getName();
+
+ TypeAndAnnotation inTa = jaxbType.getJavaType().getType().getTypeAnn();
+ TypeAndAnnotation outTa = outJaxbType.getJavaType().getType().getTypeAnn();
+ if((((inTa != null) && (outTa != null) && inTa.equals(outTa))) && !inType.equals(outType)){
+ String javaType = "javax.activation.DataHandler";
+
+ S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
+ JCodeModel cm = jaxbModel.generateCode(null,
+ new ConsoleErrorReporter(getEnvironment(), false));
+ JType jt= null;
+ jt = cm.ref(javaType);
+ JAXBTypeAndAnnotation jaxbTa = jaxbType.getJavaType().getType();
+ jaxbTa.setType(jt);
+ }
+ }
+ }else if(ModelerUtils.isUnbound(part)){
+ if(part.isIN()){
+ req.addUnboundBlock(block);
+ }else if(part.isOUT()){
+ res.addUnboundBlock(block);
+ }else if(part.isINOUT()){
+ req.addUnboundBlock(block);
+ res.addUnboundBlock(block);
+ }
+ }
+ if(params == null)
+ params = new ArrayList<Parameter>();
+ Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, block);
+ param.setMode(part.getMode());
+ if(part.isReturn()){
+ param.setParameterIndex(-1);
+ }else{
+ param.setParameterIndex(pIndex++);
+ }
+
+ if(part.isIN())
+ setCustomizedParameterName(info.portTypeOperation, inMsg, part, param, false);
+ else if(outMsg != null)
+ setCustomizedParameterName(info.portTypeOperation, outMsg, part, param, false);
+
+ params.add(param);
+ }
+ }
+ if(unwrappable && (outParams != null)){
+ int index = params.size();
+ for(Parameter param:outParams){
+ if(param.getName().equals("return")){
+ param.setParameterIndex(-1);
+ }else{
+ Parameter inParam = ModelerUtils.getParameter(param.getName(), params);
+ if((inParam != null) && inParam.isIN()){
+ QName inElementName = ((JAXBType)inParam.getType()).getName();
+ QName outElementName = ((JAXBType)param.getType()).getName();
+ String inJavaType = inParam.getTypeName();
+ String outJavaType = param.getTypeName();
+ TypeAndAnnotation inTa = inParam.getType().getJavaType().getType().getTypeAnn();
+ TypeAndAnnotation outTa = param.getType().getJavaType().getType().getTypeAnn();
+ if(inElementName.getLocalPart().equals(outElementName.getLocalPart()) &&
+ inJavaType.equals(outJavaType) &&
+ ((inTa == null || outTa == null)||
+ ((inTa != null) && (outTa != null) && inTa.equals(outTa)))) {
+ inParam.setMode(Mode.INOUT);
+ continue;
+ }
+ }else if(outParams.size() == 1){
+ param.setParameterIndex(-1);
+ }else{
+ param.setParameterIndex(index++);
+ }
+ }
+ params.add(param);
+ }
+ }
+ return params;
+ }
+
+ private List<Parameter> getRpcLitParameters(Request req, Response res, Block reqBlock, Block resBlock, List<MessagePart> paramList){
+ List<Parameter> params = new ArrayList<Parameter>();
+ Message inMsg = getInputMessage();
+ Message outMsg = getOutputMessage();
+ S2JJAXBModel jaxbModel = ((RpcLitStructure)reqBlock.getType()).getJaxbModel().getS2JJAXBModel();
+ List<Parameter> inParams = ModelerUtils.createRpcLitParameters(inMsg, reqBlock, jaxbModel);
+ List<Parameter> outParams = null;
+ if(outMsg != null)
+ outParams = ModelerUtils.createRpcLitParameters(outMsg, resBlock, jaxbModel);
+
+ //create parameters for header and mime parts
+ int index = 0;
+ for(MessagePart part: paramList){
+ Parameter param = null;
+ if(ModelerUtils.isBoundToSOAPBody(part)){
+ if(part.isIN()){
+ param = ModelerUtils.getParameter(part.getName(), inParams);
+ }else if(outParams != null){
+ param = ModelerUtils.getParameter(part.getName(), outParams);
+ }
+ }else if(ModelerUtils.isBoundToSOAPHeader(part)){
+ QName headerName = part.getDescriptor();
+ JAXBType jaxbType = getJAXBType(headerName);
+ Block headerBlock = new Block(headerName, jaxbType);
+ param = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock);
+ if(part.isIN()){
+ req.addHeaderBlock(headerBlock);
+ }else if(part.isOUT()){
+ res.addHeaderBlock(headerBlock);
+ }else if(part.isINOUT()){
+ req.addHeaderBlock(headerBlock);
+ res.addHeaderBlock(headerBlock);
+ }
+ }else if(ModelerUtils.isBoundToMimeContent(part)){
+ List<MIMEContent> mimeContents = null;
+ if(part.isIN() || part.isINOUT())
+ mimeContents = getMimeContents(info.bindingOperation.getInput(),
+ getInputMessage(), part.getName());
+ else
+ mimeContents = getMimeContents(info.bindingOperation.getOutput(),
+ getOutputMessage(), part.getName());
+
+ JAXBType type = getAttachmentType(mimeContents, part);
+ //create Parameters in request or response
+ //Block mimeBlock = new Block(new QName(part.getName()), type);
+ Block mimeBlock = new Block(type.getName(), type);
+ param = ModelerUtils.createParameter(part.getName(), type, mimeBlock);
+ if(part.isIN()){
+ req.addAttachmentBlock(mimeBlock);
+ }else if(part.isOUT()){
+ res.addAttachmentBlock(mimeBlock);
+ }else if(part.isINOUT()){
+ mimeContents = getMimeContents(info.bindingOperation.getOutput(),
+ getOutputMessage(), part.getName());
+ JAXBType outJaxbType = getAttachmentType(mimeContents, part);
+
+ String inType = type.getJavaType().getType().getName();
+ String outType = outJaxbType.getJavaType().getType().getName();
+ if(!inType.equals(outType)){
+ String javaType = "javax.activation.DataHandler";
+ JCodeModel cm = jaxbModel.generateCode(null,
+ new ConsoleErrorReporter(getEnvironment(), false));
+ JType jt= null;
+ jt = cm.ref(javaType);
+ JAXBTypeAndAnnotation jaxbTa = type.getJavaType().getType();
+ jaxbTa.setType(jt);
+ }
+ req.addAttachmentBlock(mimeBlock);
+ res.addAttachmentBlock(mimeBlock);
+ }
+ }else if(ModelerUtils.isUnbound(part)){
+ QName name = part.getDescriptor();
+ JAXBType type = getJAXBType(part);
+ Block unboundBlock = new Block(name, type);
+ if(part.isIN()){
+ req.addUnboundBlock(unboundBlock);
+ }else if(part.isOUT()){
+ res.addUnboundBlock(unboundBlock);
+ }else if(part.isINOUT()){
+ req.addUnboundBlock(unboundBlock);
+ res.addUnboundBlock(unboundBlock);
+ }
+ param = ModelerUtils.createParameter(part.getName(), type, unboundBlock);
+ }
+ if(param != null){
+ if(part.isReturn()){
+ param.setParameterIndex(-1);
+ }else{
+ param.setParameterIndex(index++);
+ }
+ param.setMode(part.getMode());
+ params.add(param);
+ }
+ }
+ for(Parameter param : params){
+ if(param.isIN())
+ setCustomizedParameterName(info.portTypeOperation, inMsg, inMsg.getPart(param.getName()), param, false);
+ else if(outMsg != null)
+ setCustomizedParameterName(info.portTypeOperation, outMsg, outMsg.getPart(param.getName()), param, false);
+ }
+ return params;
+ }
+
+ private List<Parameter> getRequestParameters(Request request, List<String> parameterList) {
+ Message inputMessage = getInputMessage();
+ //there is no input message, return zero parameters
+ if(inputMessage != null && !inputMessage.parts().hasNext())
+ return new ArrayList<Parameter>();
+
+ List<Parameter> inParameters = null;
+ QName reqBodyName = null;
+ Block reqBlock = null;
+ JAXBType jaxbReqType = null;
+ boolean unwrappable = isUnwrappable();
+ boolean doneSOAPBody = false;
+ //setup request parameters
+ for(String inParamName: parameterList){
+ MessagePart part = inputMessage.getPart(inParamName);
+ if(part == null)
+ continue;
+ reqBodyName = part.getDescriptor();
+ jaxbReqType = getJAXBType(part);
+ if(unwrappable){
+ //So build body and header blocks and set to request and response
+ JAXBStructuredType jaxbRequestType = ModelerUtils.createJAXBStructureType(jaxbReqType);
+ reqBlock = new Block(reqBodyName, jaxbRequestType);
+ if(ModelerUtils.isBoundToSOAPBody(part)){
+ request.addBodyBlock(reqBlock);
+ }else if(ModelerUtils.isUnbound(part)){
+ request.addUnboundBlock(reqBlock);
+ }
+ inParameters = ModelerUtils.createUnwrappedParameters(jaxbRequestType, reqBlock);
+ for(Parameter param: inParameters){
+ setCustomizedParameterName(info.portTypeOperation, inputMessage, part, param, unwrappable);
+ }
+ }else{
+ reqBlock = new Block(reqBodyName, jaxbReqType);
+ if(ModelerUtils.isBoundToSOAPBody(part) && !doneSOAPBody){
+ doneSOAPBody = true;
+ request.addBodyBlock(reqBlock);
+ }else if(ModelerUtils.isBoundToSOAPHeader(part)){
+ request.addHeaderBlock(reqBlock);
+ }else if(ModelerUtils.isBoundToMimeContent(part)){
+ List<MIMEContent> mimeContents = getMimeContents(info.bindingOperation.getInput(),
+ getInputMessage(), part.getName());
+ jaxbReqType = getAttachmentType(mimeContents, part);
+ //reqBlock = new Block(new QName(part.getName()), jaxbReqType);
+ reqBlock = new Block(jaxbReqType.getName(), jaxbReqType);
+ request.addAttachmentBlock(reqBlock);
+ }else if(ModelerUtils.isUnbound(part)){
+ request.addUnboundBlock(reqBlock);
+ }
+ if(inParameters == null)
+ inParameters = new ArrayList<Parameter>();
+ Parameter param = ModelerUtils.createParameter(part.getName(), jaxbReqType, reqBlock);
+ setCustomizedParameterName(info.portTypeOperation, inputMessage, part, param, false);
+ inParameters.add(param);
+ }
+ }
+ return inParameters;
+ }
+
+ /**
+ * @param part
+ * @param param
+ * @param wrapperStyle TODO
+ */
+ private void setCustomizedParameterName(Extensible extension, Message msg, MessagePart part, Parameter param, boolean wrapperStyle) {
+ JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(extension, JAXWSBinding.class);
+ if(jaxwsBinding == null)
+ return;
+ String paramName = part.getName();
+ QName elementName = part.getDescriptor();
+ if(wrapperStyle)
+ elementName = param.getType().getName();
+ String customName = jaxwsBinding.getParameterName(msg.getName(), paramName, elementName, wrapperStyle);
+ if(customName != null && !customName.equals("")){
+ param.setCustomName(customName);
+ }
+ }
+
+ /**
+ * @param name
+ * @return
+ */
+ private JAXBType getJAXBType(QName name) {
+ return jaxbModelBuilder.getJAXBType(name);
+ }
+
+ protected boolean isConflictingPortClassName(String name) {
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#getJAXBSchemaAnalyzerInstnace(WSDLModelInfo, Properties, org.w3c.dom.Element)
+ */
+ protected JAXBModelBuilder getJAXBSchemaAnalyzerInstnace(WSDLModelInfo info,
+ Properties options,
+ ClassNameCollector classNameCollector, List elements) {
+ return new JAXBModelBuilder(info, options, classNameCollector, elements);
+ }
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#isUnwrappable()
+ */
+ protected boolean isUnwrappable() {
+ if(!getWrapperStyleCustomization())
+ return false;
+
+ org.jboss.com.sun.tools.ws.wsdl.document.Message inputMessage = getInputMessage();
+ org.jboss.com.sun.tools.ws.wsdl.document.Message outputMessage = getOutputMessage();
+
+ // Wrapper style if the operation's input and output messages each contain
+ // only a single part
+ if ((inputMessage != null && inputMessage.numParts() != 1)
+ || (outputMessage != null && outputMessage.numParts() != 1)) {
+ return false;
+ }
+
+ MessagePart inputPart = inputMessage != null
+ ? (MessagePart)inputMessage.parts().next() : null;
+ MessagePart outputPart = outputMessage != null
+ ? (MessagePart)outputMessage.parts().next() : null;
+ String operationName = info.portTypeOperation.getName();
+
+ // Wrapper style if the input message part refers to a global element declaration whose localname
+ // is equal to the operation name
+ // Wrapper style if the output message part refers to a global element declaration
+ if ((inputPart != null && !inputPart.getDescriptor().getLocalPart().equals(operationName)) ||
+ (outputPart != null && outputPart.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
+ return false;
+
+ //check to see if either input or output message part not bound to soapbing:body
+ //in that case the operation is not wrapper style
+ if(((inputPart != null) && (inputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)) ||
+ ((outputPart != null) &&(outputPart.getBindingExtensibilityElementKind() != MessagePart.SOAP_BODY_BINDING)))
+ return false;
+
+ // Wrapper style if the elements referred to by the input and output message parts
+ // (henceforth referred to as wrapper elements) are both complex types defined
+ // using the xsd:sequence compositor
+ // Wrapper style if the wrapper elements only contain child elements, they must not
+ // contain other structures such as xsd:choice, substitution groups1 or attributes
+ //These checkins are done by jaxb, we just check if jaxb has wrapper children. If there
+ // are then its wrapper style
+ //if(inputPart != null && outputPart != null){
+ if(inputPart != null){
+ boolean inputWrappable = false;
+ JAXBType inputType = getJAXBType(inputPart.getDescriptor());
+ if(inputType != null){
+ inputWrappable = inputType.isUnwrappable();
+ }
+ //if there are no output part (oneway), the operation can still be wrapper style
+ if(outputPart == null){
+ return inputWrappable;
+ }
+ JAXBType outputType = getJAXBType(outputPart.getDescriptor());
+ if((inputType != null) && (outputType != null))
+ return inputType.isUnwrappable() && outputType.isUnwrappable();
+ }
+
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ private boolean getWrapperStyleCustomization() {
+ //first we look into wsdl:portType/wsdl:operation
+ org.jboss.com.sun.tools.ws.wsdl.document.Operation portTypeOperation = info.portTypeOperation;
+ JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(portTypeOperation, JAXWSBinding.class);
+ if(jaxwsBinding != null){
+ Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
+ if(isWrappable != null)
+ return isWrappable;
+ }
+
+ //then into wsdl:portType
+ PortType portType = info.port.resolveBinding(document).resolvePortType(document);
+ jaxwsBinding = (JAXWSBinding)getExtensionOfType(portType, JAXWSBinding.class);
+ if(jaxwsBinding != null){
+ Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
+ if(isWrappable != null)
+ return isWrappable;
+ }
+
+ //then wsdl:definitions
+ jaxwsBinding = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+ if(jaxwsBinding != null){
+ Boolean isWrappable = jaxwsBinding.isEnableWrapperStyle();
+ if(isWrappable != null)
+ return isWrappable;
+ }
+ return true;
+ }
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#isSingleInOutPart(Set, MessagePart)
+ */
+ protected boolean isSingleInOutPart(Set inputParameterNames,
+ MessagePart outputPart) {
+ // As of now, we dont have support for in/out in doc-lit. So return false.
+ SOAPOperation soapOperation =
+ (SOAPOperation) getExtensionOfType(info.bindingOperation,
+ SOAPOperation.class);
+ if((soapOperation != null) && (soapOperation.isDocument() || info.soapBinding.isDocument())) {
+ Iterator iter = getInputMessage().parts();
+ while(iter.hasNext()){
+ MessagePart part = (MessagePart)iter.next();
+ if(outputPart.getName().equals(part.getName()) && outputPart.getDescriptor().equals(part.getDescriptor()))
+ return true;
+ }
+ }else if(soapOperation != null && soapOperation.isRPC()|| info.soapBinding.isRPC()){
+ org.jboss.com.sun.tools.ws.wsdl.document.Message inputMessage = getInputMessage();
+ if(inputParameterNames.contains(outputPart.getName())) {
+ if (inputMessage.getPart(outputPart.getName()).getDescriptor().equals(outputPart.getDescriptor())) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private List<Parameter> createRpcLitRequestParameters(Request request, List<String> parameterList, Block block) {
+ Message message = getInputMessage();
+ S2JJAXBModel jaxbModel = ((RpcLitStructure)block.getType()).getJaxbModel().getS2JJAXBModel();
+ List<Parameter> parameters = ModelerUtils.createRpcLitParameters(message, block, jaxbModel);
+
+ //create parameters for header and mime parts
+ for(String paramName: parameterList){
+ MessagePart part = message.getPart(paramName);
+ if(part == null)
+ continue;
+ if(ModelerUtils.isBoundToSOAPHeader(part)){
+ if(parameters == null)
+ parameters = new ArrayList<Parameter>();
+ QName headerName = part.getDescriptor();
+ JAXBType jaxbType = getJAXBType(headerName);
+ Block headerBlock = new Block(headerName, jaxbType);
+ request.addHeaderBlock(headerBlock);
+ Parameter param = ModelerUtils.createParameter(part.getName(), jaxbType, headerBlock);
+ if(param != null){
+ parameters.add(param);
+ }
+ }else if(ModelerUtils.isBoundToMimeContent(part)){
+ if(parameters == null)
+ parameters = new ArrayList<Parameter>();
+ List<MIMEContent> mimeContents = getMimeContents(info.bindingOperation.getInput(),
+ getInputMessage(), paramName);
+
+ JAXBType type = getAttachmentType(mimeContents, part);
+ //create Parameters in request or response
+ //Block mimeBlock = new Block(new QName(part.getName()), type);
+ Block mimeBlock = new Block(type.getName(), type);
+ request.addAttachmentBlock(mimeBlock);
+ Parameter param = ModelerUtils.createParameter(part.getName(), type, mimeBlock);
+ if(param != null){
+ parameters.add(param);
+ }
+ }else if(ModelerUtils.isUnbound(part)){
+ if(parameters == null)
+ parameters = new ArrayList<Parameter>();
+ QName name = part.getDescriptor();
+ JAXBType type = getJAXBType(part);
+ Block unboundBlock = new Block(name, type);
+ request.addUnboundBlock(unboundBlock);
+ Parameter param = ModelerUtils.createParameter(part.getName(), type, unboundBlock);
+ if(param != null){
+ parameters.add(param);
+ }
+ }
+ }
+ for(Parameter param : parameters){
+ setCustomizedParameterName(info.portTypeOperation, message, message.getPart(param.getName()), param, false);
+ }
+ return parameters;
+ }
+
+ private String getJavaTypeForMimeType(String mimeType){
+ if(mimeType.equals("image/jpeg") || mimeType.equals("image/gif")){
+ return "java.awt.Image";
+ }else if(mimeType.equals("text/xml") || mimeType.equals("application/xml")){
+ return "javax.xml.transform.Source";
+ }
+ return "javax.activation.DataHandler";
+ }
+
+ /**
+ * @param mimeContents
+ * @return
+ */
+ private JAXBType getAttachmentType(List<MIMEContent> mimeContents, MessagePart part) {
+ if(!enableMimeContent()){
+ return getJAXBType(part);
+ }
+ String javaType = null;
+ List<String> mimeTypes = getAlternateMimeTypes(mimeContents);
+ if(mimeTypes.size() > 1) {
+ javaType = "javax.activation.DataHandler";
+ }else{
+ javaType = getJavaTypeForMimeType(mimeTypes.get(0));
+ }
+
+ S2JJAXBModel jaxbModel = getJAXBModelBuilder().getJAXBModel().getS2JJAXBModel();
+ JCodeModel cm = jaxbModel.generateCode(null,
+ new ConsoleErrorReporter(getEnvironment(), false));
+ JType jt= null;
+ jt = cm.ref(javaType);
+ QName desc = part.getDescriptor();
+ TypeAndAnnotation typeAnno = null;
+
+ if (part.getDescriptorKind() == SchemaKinds.XSD_TYPE) {
+ typeAnno = jaxbModel.getJavaType(desc);
+ desc = new QName("", part.getName());
+ } else if (part.getDescriptorKind()== SchemaKinds.XSD_ELEMENT) {
+ typeAnno = getJAXBModelBuilder().getElementTypeAndAnn(desc);
+ for(Iterator mimeTypeIter = mimeTypes.iterator(); mimeTypeIter.hasNext();) {
+ String mimeType = (String)mimeTypeIter.next();
+ if((!mimeType.equals("text/xml") &&
+ !mimeType.equals("application/xml"))){
+ //According to AP 1.0,
+ //RZZZZ: In a DESCRIPTION, if a wsdl:part element refers to a
+ //global element declaration (via the element attribute of the wsdl:part
+ //element) then the value of the type attribute of a mime:content element
+ //that binds that part MUST be a content type suitable for carrying an
+ //XML serialization.
+ //should we throw warning?
+ //type = MimeHelper.javaType.DATA_HANDLER_JAVATYPE;
+ warn("mimemodeler.elementPart.invalidElementMimeType",
+ new Object[] {
+ part.getName(), mimeType});
+ }
+ }
+ }
+ if(typeAnno == null){
+ fail("wsdlmodeler.jaxb.javatype.notfound", new Object[]{desc, part.getName()});
+ }
+ return new JAXBType(desc, new JavaSimpleType(new JAXBTypeAndAnnotation(typeAnno, jt)),
+ null, getJAXBModelBuilder().getJAXBModel());
+ }
+
+ protected void buildJAXBModel(WSDLDocument wsdlDocument, WSDLModelInfo modelInfo, ClassNameCollector classNameCollector) {
+ JAXBModelBuilder jaxbModelBuilder = new JAXBModelBuilder(getWSDLModelInfo(), _options, classNameCollector, parser.getSchemaElements());
+ //set the java package where wsdl artifacts will be generated
+ //if user provided package name using -p switch (or package property on wsimport ant task)
+ //ignore the package customization in the wsdl and schema bidnings
+ if(getWSDLModelInfo().getDefaultJavaPackage() != null){
+ getWSDLModelInfo().setJavaPackageName(getWSDLModelInfo().getDefaultJavaPackage());
+ jaxbModelBuilder.getJAXBSchemaCompiler().forcePackageName(getWSDLModelInfo().getJavaPackageName());
+ }else{
+ String jaxwsPackage = getJavaPackage();
+ getWSDLModelInfo().setJavaPackageName(jaxwsPackage);
+ }
+
+ //create pseudo schema for async operations(if any) response bean
+ List<InputSource> schemas = PseudoSchemaBuilder.build(this, _modelInfo);
+ for(InputSource schema : schemas){
+ jaxbModelBuilder.getJAXBSchemaCompiler().parseSchema(schema);
+ }
+ jaxbModelBuilder.bind();
+ this.jaxbModelBuilder = jaxbModelBuilder;
+ }
+
+ protected String getJavaPackage(){
+ String jaxwsPackage = null;
+ JAXWSBinding jaxwsCustomization = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+ if(jaxwsCustomization != null && jaxwsCustomization.getJaxwsPackage() != null){
+ jaxwsPackage = jaxwsCustomization.getJaxwsPackage().getName();
+ }
+ if(jaxwsPackage != null){
+ return jaxwsPackage;
+ }
+ String wsdlUri = document.getDefinitions().getTargetNamespaceURI();
+ return XJC.getDefaultPackageName(wsdlUri);
+
+ }
+
+ protected void createJavaInterfaceForProviderPort(Port port) {
+ String interfaceName = "javax.xml.ws.Provider";
+ JavaInterface intf = new JavaInterface(interfaceName);
+ port.setJavaInterface(intf);
+ }
+
+ protected void createJavaInterfaceForPort(Port port, boolean isProvider) {
+ if(isProvider){
+ createJavaInterfaceForProviderPort(port);
+ return;
+ }
+ String interfaceName = getJavaNameOfSEI(port);
+
+ if (isConflictingPortClassName(interfaceName)) {
+ interfaceName += "_PortType";
+ }
+
+ JavaInterface intf = new JavaInterface(interfaceName);
+ for (Operation operation : port.getOperations()) {
+ createJavaMethodForOperation(
+ port,
+ operation,
+ intf);
+
+ for(JavaParameter jParam : operation.getJavaMethod().getParametersList()){
+ Parameter param = jParam.getParameter();
+ if(param.getCustomName() != null)
+ jParam.setName(param.getCustomName());
+ }
+ }
+
+ port.setJavaInterface(intf);
+ }
+
+ protected String getServiceInterfaceName(QName serviceQName, org.jboss.com.sun.tools.ws.wsdl.document.Service wsdlService) {
+ String serviceName = wsdlService.getName();
+ JAXWSBinding jaxwsCust = (JAXWSBinding)getExtensionOfType(wsdlService, JAXWSBinding.class);
+ if(jaxwsCust != null && jaxwsCust.getClassName() != null){
+ CustomName name = jaxwsCust.getClassName();
+ if(name != null && !name.equals(""))
+ serviceName = name.getName();
+ }
+ String serviceInterface = "";
+ String javaPackageName = null;
+ if (_modelInfo.getJavaPackageName() != null
+ && !_modelInfo.getJavaPackageName().equals("")) {
+ javaPackageName = _modelInfo.getJavaPackageName();
+ }
+ if (javaPackageName != null) {
+ serviceInterface = javaPackageName + ".";
+ }
+ serviceInterface
+ += getEnvironment().getNames().validJavaClassName(serviceName);
+ return serviceInterface;
+ }
+
+ protected String getJavaNameOfSEI(Port port) {
+ QName portTypeName =
+ (QName)port.getProperty(
+ ModelProperties.PROPERTY_WSDL_PORT_TYPE_NAME);
+ PortType pt = (PortType)document.find(Kinds.PORT_TYPE, portTypeName);
+ JAXWSBinding jaxwsCust = (JAXWSBinding)getExtensionOfType(pt, JAXWSBinding.class);
+ if(jaxwsCust != null && jaxwsCust.getClassName() != null){
+ CustomName name = jaxwsCust.getClassName();
+ if(name != null && !name.equals("")){
+ return makePackageQualified(
+ name.getName(),
+ portTypeName,
+ false);
+ }
+ }
+
+ String interfaceName = null;
+ if (portTypeName != null) {
+ // got portType information from WSDL, use it to name the interface
+ interfaceName =
+ makePackageQualified(JAXBRIContext.mangleNameToClassName(portTypeName.getLocalPart()),
+ portTypeName,
+ false);
+ } else {
+ // somehow we only got the port name, so we use that
+ interfaceName =
+ makePackageQualified(
+ JAXBRIContext.mangleNameToClassName(port.getName().getLocalPart()),
+ port.getName(),
+ false);
+ }
+ return interfaceName;
+ }
+
+ private void createJavaMethodForAsyncOperation(Port port, Operation operation,
+ JavaInterface intf){
+ String candidateName = getJavaNameForOperation(operation);
+ JavaMethod method = new JavaMethod(candidateName);
+ method.setThrowsRemoteException(false);
+ Request request = operation.getRequest();
+ Iterator requestBodyBlocks = request.getBodyBlocks();
+ Block requestBlock =
+ (requestBodyBlocks.hasNext()
+ ? (Block)request.getBodyBlocks().next()
+ : null);
+
+ Response response = operation.getResponse();
+ Iterator responseBodyBlocks = null;
+ Block responseBlock = null;
+ if (response != null) {
+ responseBodyBlocks = response.getBodyBlocks();
+ responseBlock =
+ responseBodyBlocks.hasNext()
+ ? (Block)response.getBodyBlocks().next()
+ : null;
+ }
+
+ // build a signature of the form "opName%arg1type%arg2type%...%argntype so that we
+ // detect overloading conflicts in the generated java interface/classes
+ String signature = candidateName;
+ for (Iterator iter = request.getParameters(); iter.hasNext();) {
+ Parameter parameter = (Parameter)iter.next();
+
+ if (parameter.getJavaParameter() != null) {
+ throw new ModelerException(
+ "wsdlmodeler.invalidOperation",
+ operation.getName().getLocalPart());
+ }
+
+ JavaType parameterType = parameter.getType().getJavaType();
+ JavaParameter javaParameter =
+ new JavaParameter(
+ JAXBRIContext.mangleNameToVariableName(parameter.getName()),
+ parameterType,
+ parameter,
+ parameter.getLinkedParameter() != null);
+ if (javaParameter.isHolder()) {
+ javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
+ }
+ method.addParameter(javaParameter);
+ parameter.setJavaParameter(javaParameter);
+
+ signature += "%" + parameterType.getName();
+ }
+
+ if (response != null) {
+ String resultParameterName =
+ (String)operation.getProperty(WSDL_RESULT_PARAMETER);
+ Parameter resultParameter =
+ response.getParameterByName(resultParameterName);
+ JavaType returnType = resultParameter.getType().getJavaType();
+ method.setReturnType(returnType);
+
+ }
+ operation.setJavaMethod(method);
+ intf.addMethod(method);
+ }
+
+ /* (non-Javadoc)
+ * @see WSDLModelerBase#createJavaMethodForOperation(Port, Operation, JavaInterface, Set, Set)
+ */
+ protected void createJavaMethodForOperation(Port port, Operation operation, JavaInterface intf) {
+ if((operation instanceof AsyncOperation)){
+ createJavaMethodForAsyncOperation(port, operation, intf);
+ return;
+ }
+ String candidateName = getJavaNameForOperation(operation);
+ JavaMethod method = new JavaMethod(candidateName);
+ Request request = operation.getRequest();
+ Parameter returnParam = (Parameter)operation.getProperty(WSDL_RESULT_PARAMETER);
+ if(returnParam != null){
+ JavaType parameterType = returnParam.getType().getJavaType();
+ method.setReturnType(parameterType);
+ }else{
+ JavaType ret = new JavaSimpleTypeCreator().VOID_JAVATYPE;
+ method.setReturnType(ret);
+ }
+ List<Parameter> parameterOrder = (List<Parameter>)operation.getProperty(WSDL_PARAMETER_ORDER);
+ for(Parameter param:parameterOrder){
+ JavaType parameterType = param.getType().getJavaType();
+ String name = (param.getCustomName() != null)?param.getCustomName():param.getName();
+ JavaParameter javaParameter =
+ new JavaParameter(
+ JAXBRIContext.mangleNameToVariableName(name),
+ parameterType,
+ param,
+ param.isINOUT()||param.isOUT());
+ if (javaParameter.isHolder()) {
+ javaParameter.setHolderName(javax.xml.ws.Holder.class.getName());
+ }
+ method.addParameter(javaParameter);
+ param.setJavaParameter(javaParameter);
+ }
+ operation.setJavaMethod(method);
+ intf.addMethod(method);
+
+ String opName = JAXBRIContext.mangleNameToVariableName(operation.getName().getLocalPart());
+ for (Iterator iter = operation.getFaults();
+ iter != null && iter.hasNext();
+ ) {
+ Fault fault = (Fault)iter.next();
+ createJavaExceptionFromLiteralType(fault, port, opName);
+ }
+ JavaException javaException;
+ Fault fault;
+ for (Iterator iter = operation.getFaults(); iter.hasNext();) {
+ fault = (Fault)iter.next();
+ javaException = fault.getJavaException();
+ method.addException(javaException.getName());
+ }
+
+ }
+
+ protected boolean createJavaExceptionFromLiteralType(Fault fault, org.jboss.com.sun.tools.ws.processor.model.Port port, String operationName) {
+ ProcessorEnvironment _env = getProcessorEnvironment();
+
+ JAXBType faultType = (JAXBType)fault.getBlock().getType();
+
+ String exceptionName =
+ makePackageQualified(
+ _env.getNames().validJavaClassName(fault.getName()),
+ port.getName());
+
+ // use fault namespace attribute
+ JAXBStructuredType jaxbStruct = new JAXBStructuredType(new QName(
+ fault.getBlock().getName().getNamespaceURI(),
+ fault.getName()));
+
+ QName memberName = fault.getElementName();
+ JAXBElementMember jaxbMember =
+ new JAXBElementMember(memberName, faultType);
+ //jaxbMember.setNillable(faultType.isNillable());
+
+ String javaMemberName = getLiteralJavaMemberName(fault);
+ JavaStructureMember javaMember = new JavaStructureMember(
+ javaMemberName,
+ faultType.getJavaType(),
+ jaxbMember);
+ jaxbMember.setJavaStructureMember(javaMember);
+ javaMember.setReadMethod(_env.getNames().getJavaMemberReadMethod(javaMember));
+ javaMember.setInherited(false);
+ jaxbMember.setJavaStructureMember(javaMember);
+ jaxbStruct.add(jaxbMember);
+
+ if (isConflictingExceptionClassName(exceptionName)) {
+ exceptionName += "_Exception";
+ }
+
+ JavaException existingJavaException = (JavaException)_javaExceptions.get(exceptionName);
+ if (existingJavaException != null) {
+ if (existingJavaException.getName().equals(exceptionName)) {
+ if (((JAXBType)existingJavaException.getOwner()).getName().equals(jaxbStruct.getName())
+ || ModelerUtils.isEquivalentLiteralStructures(jaxbStruct, (JAXBStructuredType) existingJavaException.getOwner())) {
+ // we have mapped this fault already
+ if (faultType instanceof JAXBStructuredType) {
+ fault.getBlock().setType((JAXBType) existingJavaException.getOwner());
+ }
+ fault.setJavaException(existingJavaException);
+ return false;
+ }
+ }
+ }
+
+ JavaException javaException = new JavaException(exceptionName, false, jaxbStruct);
+ javaException.add(javaMember);
+ jaxbStruct.setJavaType(javaException);
+
+ _javaExceptions.put(javaException.getName(), javaException);
+
+ fault.setJavaException(javaException);
+ return true;
+ }
+
+ protected boolean isRequestResponse(){
+ return info.portTypeOperation.getStyle() == OperationStyle.REQUEST_RESPONSE;
+ }
+
+ protected java.util.List<String> getAsynParameterOrder(){
+ //for async operation ignore the parameterOrder
+ java.util.List<String> parameterList = new ArrayList<String>();
+ Message inputMessage = getInputMessage();
+ List<MessagePart> inputParts = inputMessage.getParts();
+ for(MessagePart part: inputParts){
+ parameterList.add(part.getName());
+ }
+ return parameterList;
+ }
+
+
+ protected List<MessagePart> getParameterOrder(){
+ List<MessagePart> params = new ArrayList<MessagePart>();
+ String parameterOrder = info.portTypeOperation.getParameterOrder();
+ java.util.List<String> parameterList = new ArrayList<String>();
+ boolean parameterOrderPresent = false;
+ if ((parameterOrder != null) && !(parameterOrder.trim().equals(""))) {
+ parameterList = XmlUtil.parseTokenList(parameterOrder);
+ parameterOrderPresent = true;
+ } else {
+ parameterList = new ArrayList<String>();
+ }
+ Message inputMessage = getInputMessage();
+ Message outputMessage = getOutputMessage();
+ List<MessagePart> outputParts = null;
+ List<MessagePart> inputParts = inputMessage.getParts();
+ //reset the mode and ret flag, as MEssagePArts aer shared across ports
+ for(MessagePart part:inputParts){
+ part.setMode(Mode.IN);
+ part.setReturn(false);
+ }
+ if(isRequestResponse()){
+ outputParts = outputMessage.getParts();
+ for(MessagePart part:outputParts){
+ part.setMode(Mode.OUT);
+ part.setReturn(false);
+ }
+ }
+
+ if(parameterOrderPresent){
+ boolean validParameterOrder = true;
+ Iterator<String> paramOrders = parameterList.iterator();
+ // If any part in the parameterOrder is not present in the request or
+ // response message, we completely ignore the parameterOrder hint
+ while(paramOrders.hasNext()){
+ String param = paramOrders.next();
+ boolean partFound = false;
+ for(MessagePart part : inputParts){
+ if(param.equals(part.getName())){
+ partFound = true;
+ break;
+ }
+ }
+ // if not found, check in output parts
+ if(!partFound){
+ for(MessagePart part : outputParts){
+ if(param.equals(part.getName())){
+ partFound = true;
+ break;
+ }
+ }
+ }
+ if(!partFound){
+ warn("wsdlmodeler.invalid.parameterorder.parameter",
+ new Object[] {param, info.operation.getName().getLocalPart()});
+ validParameterOrder = false;
+ }
+ }
+
+ List<MessagePart> inputUnlistedParts = new ArrayList<MessagePart>();
+ List<MessagePart> outputUnlistedParts = new ArrayList<MessagePart>();
+
+ //gather input Parts
+ if(validParameterOrder){
+ for(String param:parameterList){
+ MessagePart part = inputMessage.getPart(param);
+ if(part != null){
+ params.add(part);
+ continue;
+ }
+ if(isRequestResponse()){
+ MessagePart outPart = outputMessage.getPart(param);
+ if(outPart != null){
+ params.add(outPart);
+ continue;
+ }
+ }
+ }
+
+ for(MessagePart part: inputParts){
+ if(!parameterList.contains(part.getName())) {
+ inputUnlistedParts.add(part);
+ }
+ }
+
+ if(isRequestResponse()){
+ // at most one output part should be unlisted
+ for(MessagePart part: outputParts){
+ if(!parameterList.contains(part.getName())) {
+ MessagePart inPart = inputMessage.getPart(part.getName());
+ //dont add inout as unlisted part
+ if((inPart != null) && inPart.getDescriptor().equals(part.getDescriptor())){
+ inPart.setMode(Mode.INOUT);
+ }else{
+ outputUnlistedParts.add(part);
+ }
+ }else{
+ //param list may contain it, check if its INOUT
+ MessagePart inPart = inputMessage.getPart(part.getName());
+ //dont add inout as unlisted part
+ if((inPart != null) && inPart.getDescriptor().equals(part.getDescriptor())){
+ inPart.setMode(Mode.INOUT);
+ }else if(!params.contains(part)){
+ params.add(part);
+ }
+ }
+ }
+ if(outputUnlistedParts.size() == 1){
+ MessagePart resultPart = outputUnlistedParts.get(0);
+ resultPart.setReturn(true);
+ params.add(resultPart);
+ outputUnlistedParts.clear();
+ }
+ }
+
+ //add the input and output unlisted parts
+ for(MessagePart part : inputUnlistedParts){
+ params.add(part);
+ }
+
+ for(MessagePart part : outputUnlistedParts){
+ params.add(part);
+ }
+ return params;
+
+ }
+ //parameterOrder attribute is not valid, we ignore it
+ warn("wsdlmodeler.invalid.parameterOrder.invalidParameterOrder",
+ new Object[] {info.operation.getName().getLocalPart()});
+ parameterOrderPresent = false;
+ parameterList.clear();
+ }
+
+ List<MessagePart> outParts = new ArrayList<MessagePart>();
+
+ //construct input parameter list with the same order as in input message
+ for(MessagePart part: inputParts){
+ params.add(part);
+ }
+
+ if(isRequestResponse()){
+ for(MessagePart part:outputParts){
+ MessagePart inPart = inputMessage.getPart(part.getName());
+ if(inPart != null && part.getDescriptorKind() == inPart.getDescriptorKind() &&
+ part.getDescriptor().equals(inPart.getDescriptor())){
+ inPart.setMode(Mode.INOUT);
+ continue;
+ }
+ outParts.add(part);
+ }
+
+ //append the out parts to the parameterList
+ for(MessagePart part : outParts){
+ if(outParts.size() == 1)
+ part.setReturn(true);
+ params.add(part);
+ }
+ }
+ return params;
+ }
+
+ /**
+ *
+ * @param port
+ * @param suffix
+ * @return the Java ClassName for a port
+ */
+ protected String getClassName(Port port, String suffix) {
+ String name = "";
+ String javaPackageName = "";
+ if (_modelInfo.getJavaPackageName() != null
+ && !_modelInfo.getJavaPackageName().equals("")) {
+ javaPackageName = _modelInfo.getJavaPackageName();
+ }
+ String prefix = getEnvironment().getNames().validJavaClassName(port.getName().getLocalPart());
+ name = javaPackageName+"."+prefix+suffix;
+ return name;
+ }
+
+ protected boolean isConflictingServiceClassName(String name) {
+ if(conflictsWithSEIClass(name) || conflictsWithJAXBClass(name) ||conflictsWithExceptionClass(name)){
+ return true;
+ }
+ return false;
+ }
+
+ private boolean conflictsWithSEIClass(String name){
+ Set<String> seiNames = classNameCollector.getSeiClassNames();
+ if(seiNames != null && seiNames.contains(name))
+ return true;
+ return false;
+ }
+
+ private boolean conflictsWithJAXBClass(String name){
+ Set<String> jaxbNames = classNameCollector.getJaxbGeneratedClassNames();
+ if(jaxbNames != null && jaxbNames.contains(name))
+ return true;
+ return false;
+ }
+
+ private boolean conflictsWithExceptionClass(String name){
+ Set<String> exceptionNames = classNameCollector.getExceptionClassNames();
+ if(exceptionNames != null && exceptionNames.contains(name))
+ return true;
+ return false;
+ }
+
+ protected boolean isConflictingExceptionClassName(String name) {
+ if(conflictsWithSEIClass(name) || conflictsWithJAXBClass(name)){
+ return true;
+ }
+ return false;
+ }
+
+ protected JAXBModelBuilder getJAXBModelBuilder() {
+ return jaxbModelBuilder;
+ }
+
+ protected boolean validateWSDLBindingStyle(Binding binding) {
+ boolean mixedStyle = false;
+ SOAPBinding soapBinding =
+ (SOAPBinding)getExtensionOfType(binding, SOAPBinding.class);
+
+ //dont process the binding
+ if(soapBinding == null)
+ soapBinding =
+ (SOAPBinding)getExtensionOfType(binding, SOAP12Binding.class);
+ if(soapBinding == null)
+ return false;
+
+ //if soapbind:binding has no style attribute, the default is DOCUMENT
+ if(soapBinding.getStyle() == null)
+ soapBinding.setStyle(SOAPStyle.DOCUMENT);
+
+ SOAPStyle opStyle = soapBinding.getStyle();
+ for (Iterator iter = binding.operations(); iter.hasNext();) {
+ BindingOperation bindingOperation =
+ (BindingOperation)iter.next();
+ SOAPOperation soapOperation =
+ (SOAPOperation) getExtensionOfType(bindingOperation,
+ SOAPOperation.class);
+ if(soapOperation != null){
+ SOAPStyle currOpStyle = (soapOperation.getStyle() != null)?soapOperation.getStyle():soapBinding.getStyle();
+ //dont check for the first operation
+ if(!currOpStyle.equals(opStyle))
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @param port
+ */
+ private void applyWrapperStyleCustomization(Port port, PortType portType) {
+ JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(portType, JAXWSBinding.class);
+ Boolean wrapperStyle = (jaxwsBinding != null)?jaxwsBinding.isEnableWrapperStyle():null;
+ if(wrapperStyle != null){
+ port.setWrapped(wrapperStyle);
+ }
+ }
+
+ protected static void setDocumentationIfPresent(
+ ModelObject obj,
+ Documentation documentation) {
+ if (documentation != null && documentation.getContent() != null) {
+ obj.setJavaDoc(documentation.getContent());
+ }
+ }
+
+ protected String getJavaNameForOperation(Operation operation) {
+ String name = operation.getJavaMethodName();
+ if(getEnvironment().getNames().isJavaReservedWord(name)){
+ name = "_"+name;
+ }
+ return name;
+ }
+
+ protected void fail(String key, String arg){
+ throw new ModelerException(key, arg);
+ }
+ protected void fail(String key, Object[] args){
+ throw new ModelerException(key, args);
+ }
+}
\ No newline at end of file
Property changes on: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModeler.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModelerBase.java
===================================================================
--- subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModelerBase.java (rev 0)
+++ subprojects/jbossws-sun-wsimport/sun/src/main/org/jboss/com/sun/tools/ws/processor/modeler/wsdl/WSDLModelerBase.java 2007-01-31 02:44:54 UTC (rev 2202)
@@ -0,0 +1,1084 @@
+
+/*
+ * The contents of this file are subject to the terms
+ * of the Common Development and Distribution License
+ * (the License). You may not use this file except in
+ * compliance with the License.
+ *
+ * You can obtain a copy of the license at
+ * https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * See the License for the specific language governing
+ * permissions and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL
+ * Header Notice in each file and include the License file
+ * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
+ * If applicable, add the following below the CDDL Header,
+ * with the fields enclosed by brackets [] replaced by
+ * you own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
+ */
+
+package org.jboss.com.sun.tools.ws.processor.modeler.wsdl;
+
+
+import org.jboss.com.sun.tools.ws.processor.config.WSDLModelInfo;
+import org.jboss.com.sun.tools.ws.processor.generator.Names;
+import org.jboss.com.sun.tools.ws.processor.model.AbstractType;
+import org.jboss.com.sun.tools.ws.processor.model.Block;
+import org.jboss.com.sun.tools.ws.processor.model.Fault;
+import org.jboss.com.sun.tools.ws.processor.model.Model;
+import org.jboss.com.sun.tools.ws.processor.model.ModelObject;
+import org.jboss.com.sun.tools.ws.processor.model.ModelProperties;
+import org.jboss.com.sun.tools.ws.processor.model.Operation;
+import org.jboss.com.sun.tools.ws.processor.model.Parameter;
+import org.jboss.com.sun.tools.ws.processor.model.Port;
+import org.jboss.com.sun.tools.ws.processor.modeler.JavaSimpleTypeCreator;
+import org.jboss.com.sun.tools.ws.processor.modeler.Modeler;
+import org.jboss.com.sun.tools.ws.processor.modeler.ModelerException;
+import org.jboss.com.sun.tools.ws.processor.util.ProcessorEnvironment;
+import org.jboss.com.sun.tools.ws.wsdl.document.Binding;
+import org.jboss.com.sun.tools.ws.wsdl.document.BindingFault;
+import org.jboss.com.sun.tools.ws.wsdl.document.BindingOperation;
+import org.jboss.com.sun.tools.ws.wsdl.document.Documentation;
+import org.jboss.com.sun.tools.ws.wsdl.document.Kinds;
+import org.jboss.com.sun.tools.ws.wsdl.document.Message;
+import org.jboss.com.sun.tools.ws.wsdl.document.MessagePart;
+import org.jboss.com.sun.tools.ws.wsdl.document.OperationStyle;
+import org.jboss.com.sun.tools.ws.wsdl.document.WSDLDocument;
+import org.jboss.com.sun.tools.ws.wsdl.document.jaxws.JAXWSBinding;
+import org.jboss.com.sun.tools.ws.wsdl.document.mime.MIMEContent;
+import org.jboss.com.sun.tools.ws.wsdl.document.mime.MIMEMultipartRelated;
+import org.jboss.com.sun.tools.ws.wsdl.document.mime.MIMEPart;
+import org.jboss.com.sun.tools.ws.wsdl.document.schema.SchemaKinds;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPBinding;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPBody;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPFault;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPHeader;
+import org.jboss.com.sun.tools.ws.wsdl.document.soap.SOAPOperation;
+import org.jboss.com.sun.tools.ws.wsdl.framework.Extensible;
+import org.jboss.com.sun.tools.ws.wsdl.framework.Extension;
+import org.jboss.com.sun.tools.ws.wsdl.framework.GloballyKnown;
+import org.jboss.com.sun.tools.ws.wsdl.framework.NoSuchEntityException;
+import org.jboss.com.sun.tools.ws.wsdl.parser.Constants;
+import org.jboss.com.sun.tools.ws.wsdl.parser.Util;
+import org.jboss.com.sun.tools.ws.wsdl.parser.WSDLParser;
+import org.jboss.com.sun.xml.ws.util.localization.Localizable;
+import org.jboss.com.sun.xml.ws.util.localization.LocalizableMessageFactory;
+import org.jboss.com.sun.xml.ws.util.xml.XmlUtil;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.StringTokenizer;
+
+/**
+ *
+ * @author WS Development Team
+ *
+ * Base class for WSDL->Model classes.
+ */
+public abstract class WSDLModelerBase implements Modeler {
+ public WSDLModelerBase(WSDLModelInfo modelInfo, Properties options) {
+ //init();
+ _modelInfo = modelInfo;
+ _options = options;
+ _messageFactory =
+ new LocalizableMessageFactory("org.jboss.com.sun.tools.ws.resources.modeler");
+ _conflictingClassNames = null;
+ _env = (ProcessorEnvironment)modelInfo.getParent().getEnvironment();
+ hSet = null;
+ reqResNames = new HashSet();
+ }
+
+
+ protected WSDLParser createWSDLParser(){
+ return new WSDLParser(_modelInfo);
+ }
+
+ /**
+ * Builds model from WSDL document. Model contains abstraction which is used by the
+ * generators to generate the stub/tie/serializers etc. code.
+ *
+ * @see Modeler#buildModel()
+ */
+ public Model buildModel() {
+ return null;
+ }
+
+ protected WSDLModelInfo getWSDLModelInfo(){
+ return _modelInfo;
+ }
+
+ protected Documentation getDocumentationFor(Element e) {
+ String s = XmlUtil.getTextForNode(e);
+ if (s == null) {
+ return null;
+ } else {
+ return new Documentation(s);
+ }
+ }
+
+ protected void checkNotWsdlElement(Element e) {
+ // possible extensibility element -- must live outside the WSDL namespace
+ if (e.getNamespaceURI().equals(Constants.NS_WSDL))
+ Util.fail("parsing.invalidWsdlElement", e.getTagName());
+ }
+
+ /**
+ * @param port
+ * @param wsdlPort
+ */
+ protected void applyPortMethodCustomization(Port port, org.jboss.com.sun.tools.ws.wsdl.document.Port wsdlPort) {
+ if(isProvider(wsdlPort))
+ return;
+ JAXWSBinding jaxwsBinding = (JAXWSBinding)getExtensionOfType(wsdlPort, JAXWSBinding.class);
+
+ String portMethodName = (jaxwsBinding != null)?((jaxwsBinding.getMethodName() != null)?jaxwsBinding.getMethodName().getName():null):null;
+ if(portMethodName != null){
+ port.setPortGetter(portMethodName);
+ }else{
+ portMethodName = Names.getPortName(port);
+ portMethodName = getEnvironment().getNames().validJavaClassName(portMethodName);
+ port.setPortGetter("get"+portMethodName);
+ }
+
+ }
+
+ protected boolean isProvider(org.jboss.com.sun.tools.ws.wsdl.document.Port wsdlPort){
+ JAXWSBinding portCustomization = (JAXWSBinding)getExtensionOfType(wsdlPort, JAXWSBinding.class);
+ Boolean isProvider = (portCustomization != null)?portCustomization.isProvider():null;
+ if(isProvider != null){
+ return isProvider;
+ }
+
+ JAXWSBinding jaxwsGlobalCustomization = (JAXWSBinding)getExtensionOfType(document.getDefinitions(), JAXWSBinding.class);
+ isProvider = (jaxwsGlobalCustomization != null)?jaxwsGlobalCustomization.isProvider():null;
+ if(isProvider != null)
+ return isProvider;
+ return false;
+ }
+
+ protected void createParentFault(Fault fault) {
+ AbstractType faultType = fault.getBlock().getType();
+ AbstractType parentType = null;
+
+
+ if (parentType == null) {
+ return;
+ }
+
+ if (fault.getParentFault() != null) {
+ return;
+ }
+ Fault parentFault =
+ new Fault(((AbstractType)parentType).getName().getLocalPart());
+ /* this is what it really should be but for interop with JAXRPC 1.0.1 we are not doing
+ * this at this time.
+ *
+ * TODO - we should double-check this; the above statement might not be true anymore.
+ */
+ QName faultQName =
+ new QName(
+ fault.getBlock().getName().getNamespaceURI(),
+ parentFault.getName());
+ Block block = new Block(faultQName);
+ block.setType((AbstractType)parentType);
+ parentFault.setBlock(block);
+ parentFault.addSubfault(fault);
+ createParentFault(parentFault);
+ }
+
+ protected void createSubfaults(Fault fault) {
+ AbstractType faultType = fault.getBlock().getType();
+ Iterator subtypes = null;
+ if (subtypes != null) {
+ AbstractType subtype;
+ while (subtypes.hasNext()) {
+ subtype = (AbstractType)subtypes.next();
+ Fault subFault = new Fault(subtype.getName().getLocalPart());
+ /* this is what it really is but for interop with JAXRPC 1.0.1 we are not doing
+ * this at this time
+ *
+ * TODO - we should double-check this; the above statement might not be true anymore.
+ */
+ QName faultQName =
+ new QName(
+ fault.getBlock().getName().getNamespaceURI(),
+ subFault.getName());
+ Block block = new Block(faultQName);
+ block.setType(subtype);
+ subFault.setBlock(block);
+ fault.addSubfault(subFault);
+ createSubfaults(subFault);
+ }
+ }
+ }
+
+ protected SOAPBody getSOAPRequestBody() {
+ SOAPBody requestBody =
+ (SOAPBody)getAnyExtensionOfType(info.bindingOperation.getInput(),
+ SOAPBody.class);
+ if (requestBody == null) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.inputMissingSoapBody",
+ new Object[] { info.bindingOperation.getName()});
+ }
+ return requestBody;
+ }
+
+ protected boolean isRequestMimeMultipart() {
+ for (Iterator iter = info.bindingOperation.getInput().extensions(); iter.hasNext();) {
+ Extension extension = (Extension)iter.next();
+ if (extension.getClass().equals(MIMEMultipartRelated.class)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ protected boolean isResponseMimeMultipart() {
+ for (Iterator iter = info.bindingOperation.getOutput().extensions(); iter.hasNext();) {
+ Extension extension = (Extension)iter.next();
+ if (extension.getClass().equals(MIMEMultipartRelated.class)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+
+
+ protected SOAPBody getSOAPResponseBody() {
+ SOAPBody responseBody =
+ (SOAPBody)getAnyExtensionOfType(info.bindingOperation.getOutput(),
+ SOAPBody.class);
+ if (responseBody == null) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.outputMissingSoapBody",
+ new Object[] { info.bindingOperation.getName()});
+ }
+ return responseBody;
+ }
+
+ protected org.jboss.com.sun.tools.ws.wsdl.document.Message getOutputMessage() {
+ if (info.portTypeOperation.getOutput() == null)
+ return null;
+ return info.portTypeOperation.getOutput().resolveMessage(info.document);
+ }
+
+ protected org.jboss.com.sun.tools.ws.wsdl.document.Message getInputMessage() {
+ return info.portTypeOperation.getInput().resolveMessage(info.document);
+ }
+
+ /**
+ * @param body request or response body, represents soap:body
+ * @param message Input or output message, equivalent to wsdl:message
+ * @return iterator over MessagePart
+ */
+ protected List getMessageParts(
+ SOAPBody body,
+ org.jboss.com.sun.tools.ws.wsdl.document.Message message, boolean isInput) {
+ String bodyParts = body.getParts();
+ ArrayList partsList = new ArrayList();
+ List parts = new ArrayList();
+
+ //get Mime parts
+ List mimeParts = null;
+ if(isInput)
+ mimeParts = getMimeContentParts(message, info.bindingOperation.getInput());
+ else
+ mimeParts = getMimeContentParts(message, info.bindingOperation.getOutput());
+
+ if (bodyParts != null) {
+ StringTokenizer in = new StringTokenizer(bodyParts.trim(), " ");
+ while (in.hasMoreTokens()) {
+ String part = in.nextToken();
+ MessagePart mPart = (MessagePart)message.getPart(part);
+ if (null == mPart) {
+ throw new ModelerException(
+ "wsdlmodeler.error.partsNotFound",
+ new Object[] { part, message.getName()});
+ }
+ mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
+ partsList.add(mPart);
+ }
+ } else {
+ for(Iterator iter = message.parts();iter.hasNext();) {
+ MessagePart mPart = (MessagePart)iter.next();
+ if(!mimeParts.contains(mPart))
+ mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
+ partsList.add(mPart);
+ }
+ }
+
+ for(Iterator iter = message.parts();iter.hasNext();) {
+ MessagePart mPart = (MessagePart)iter.next();
+ if(mimeParts.contains(mPart)) {
+ mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING);
+ parts.add(mPart);
+ }else if(partsList.contains(mPart)) {
+ mPart.setBindingExtensibilityElementKind(MessagePart.SOAP_BODY_BINDING);
+ parts.add(mPart);
+ }
+ }
+
+ return parts;
+ }
+
+ /**
+ * @param message
+ * @return MessageParts referenced by the mime:content
+ */
+ protected List getMimeContentParts(Message message, Extensible ext) {
+ ArrayList mimeContentParts = new ArrayList();
+ String mimeContentPartName = null;
+ Iterator mimeParts = getMimeParts(ext);
+
+ while(mimeParts.hasNext()) {
+ MessagePart part = getMimeContentPart(message, (MIMEPart)mimeParts.next());
+ if(part != null)
+ mimeContentParts.add(part);
+ }
+ return mimeContentParts;
+ }
+
+ /**
+ * @param mimeParts
+ */
+ protected boolean validateMimeParts(Iterator mimeParts) {
+ boolean gotRootPart = false;
+ List mimeContents = new ArrayList();
+ while(mimeParts.hasNext()) {
+ MIMEPart mPart = (MIMEPart)mimeParts.next();
+ Iterator extns = mPart.extensions();
+ while(extns.hasNext()){
+ Object obj = extns.next();
+ if(obj instanceof SOAPBody){
+ if(gotRootPart) {
+ //bug fix: 5024020
+ warn("mimemodeler.invalidMimePart.moreThanOneSOAPBody",
+ new Object[] {info.operation.getName().getLocalPart()});
+ return false;
+ }
+ gotRootPart = true;
+ }else if (obj instanceof MIMEContent) {
+ mimeContents.add((MIMEContent)obj);
+ }
+ }
+ if(!validateMimeContentPartNames(mimeContents.iterator()))
+ return false;
+ if(mPart.getName() != null) {
+ //bug fix: 5024018
+ warn("mimemodeler.invalidMimePart.nameNotAllowed",
+ info.portTypeOperation.getName());
+ }
+ }
+ return true;
+
+ }
+
+ private MessagePart getMimeContentPart(Message message, MIMEPart part) {
+ String mimeContentPartName = null;
+ Iterator mimeContents = getMimeContents(part).iterator();
+ if(mimeContents.hasNext()) {
+ mimeContentPartName = ((MIMEContent)mimeContents.next()).getPart();
+ MessagePart mPart = (MessagePart)message.getPart(mimeContentPartName);
+ //RXXXX mime:content MUST have part attribute
+ if(null == mPart) {
+ throw new ModelerException("wsdlmodeler.error.partsNotFound",
+ new Object[] {mimeContentPartName, message.getName()});
+ }
+ mPart.setBindingExtensibilityElementKind(MessagePart.WSDL_MIME_BINDING);
+ return mPart;
+ }
+ return null;
+ }
+
+ //List of mimeTypes
+ protected List<String> getAlternateMimeTypes(List<MIMEContent> mimeContents) {
+ List<String> mimeTypes = new ArrayList<String>();
+ //validateMimeContentPartNames(mimeContents.iterator());
+// String mimeType = null;
+ for(MIMEContent mimeContent:mimeContents){
+ String mimeType = getMimeContentType(mimeContent);
+ if(!mimeTypes.contains(mimeType))
+ mimeTypes.add(mimeType);
+ }
+ return mimeTypes;
+ }
+
+ /**
+ * @param iterator
+ */
+ private boolean validateMimeContentPartNames(Iterator mimeContents) {
+ //validate mime:content(s) in the mime:part as per R2909
+ while(mimeContents.hasNext()){
+ String mimeContnetPart = null;
+ if(mimeContnetPart == null) {
+ mimeContnetPart = getMimeContentPartName((MIMEContent)mimeContents.next());
+ if(mimeContnetPart == null) {
+ warn("mimemodeler.invalidMimeContent.missingPartAttribute",
+ new Object[] {info.operation.getName().getLocalPart()});
+ return false;
+ }
+ }else {
+ String newMimeContnetPart = getMimeContentPartName((MIMEContent)mimeContents.next());
+ if(newMimeContnetPart == null) {
+ warn("mimemodeler.invalidMimeContent.missingPartAttribute",
+ new Object[] {info.operation.getName().getLocalPart()});
+ return false;
+ }else if(!newMimeContnetPart.equals(mimeContnetPart)) {
+ //throw new ModelerException("mimemodeler.invalidMimeContent.differentPart");
+ warn("mimemodeler.invalidMimeContent.differentPart");
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ protected Iterator<MIMEPart> getMimeParts(Extensible ext) {
+ MIMEMultipartRelated multiPartRelated =
+ (MIMEMultipartRelated) getAnyExtensionOfType(ext,
+ MIMEMultipartRelated.class);
+ if(multiPartRelated == null) {
+ List<MIMEPart> parts = new ArrayList<MIMEPart>();
+ return parts.iterator();
+ }
+ return multiPartRelated.getParts();
+ }
+
+ //returns MIMEContents
+ protected List<MIMEContent> getMimeContents(MIMEPart part) {
+ List<MIMEContent> mimeContents = new ArrayList<MIMEContent>();
+ Iterator parts = part.extensions();
+ while(parts.hasNext()) {
+ Extension mimeContent = (Extension) parts.next();
+ if (mimeContent instanceof MIMEContent) {
+ mimeContents.add((MIMEContent)mimeContent);
+ }
+ }
+ //validateMimeContentPartNames(mimeContents.iterator());
+ return mimeContents;
+ }
+
+ private String getMimeContentPartName(MIMEContent mimeContent){
+ /*String partName = mimeContent.getPart();
+ if(partName == null){
+ throw new ModelerException("mimemodeler.invalidMimeContent.missingPartAttribute",
+ new Object[] {info.operation.getName().getLocalPart()});
+ }
+ return partName;*/
+ return mimeContent.getPart();
+ }
+
+ private String getMimeContentType(MIMEContent mimeContent){
+ String mimeType = mimeContent.getType();
+ if(mimeType == null){
+ throw new ModelerException("mimemodeler.invalidMimeContent.missingTypeAttribute",
+ new Object[] {info.operation.getName().getLocalPart()});
+ }
+ return mimeType;
+ }
+
+ /**
+ * For Document/Lit the wsdl:part should only have element attribute and
+ * for RPC/Lit or RPC/Encoded the wsdl:part should only have type attribute
+ * inside wsdl:message.
+ */
+ protected boolean isStyleAndPartMatch(
+ SOAPOperation soapOperation,
+ MessagePart part) {
+
+ // style attribute on soap:operation takes precedence over the
+ // style attribute on soap:binding
+
+ if ((soapOperation != null) && (soapOperation.getStyle() != null)) {
+ if ((soapOperation.isDocument()
+ && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
+ || (soapOperation.isRPC()
+ && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
+ return false;
+ }
+ } else {
+ if ((info.soapBinding.isDocument()
+ && (part.getDescriptorKind() != SchemaKinds.XSD_ELEMENT))
+ || (info.soapBinding.isRPC()
+ && (part.getDescriptorKind() != SchemaKinds.XSD_TYPE))) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+
+
+ protected String getRequestNamespaceURI(SOAPBody body) {
+ String namespaceURI = body.getNamespace();
+ if (namespaceURI == null) {
+ // the WSDL document is invalid
+ // at least, that's my interpretation of section 3.5 of the WSDL 1.1 spec!
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.inputSoapBody.missingNamespace",
+ new Object[] { info.bindingOperation.getName()});
+ }
+ return namespaceURI;
+ }
+
+ protected String getResponseNamespaceURI(SOAPBody body) {
+ String namespaceURI = body.getNamespace();
+ if (namespaceURI == null) {
+ // the WSDL document is invalid
+ // at least, that's my interpretation of section 3.5 of the WSDL 1.1 spec!
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingOperation.outputSoapBody.missingNamespace",
+ new Object[] { info.bindingOperation.getName()});
+ }
+ return namespaceURI;
+ }
+
+ /**
+ * @return List of SOAPHeader extensions
+ */
+ protected List<SOAPHeader> getHeaderExtensions(Extensible extensible) {
+ List<SOAPHeader> headerList = new ArrayList<SOAPHeader>();
+ Iterator bindingIter = extensible.extensions();
+ while (bindingIter.hasNext()) {
+ Extension extension = (Extension) bindingIter.next();
+ if (extension.getClass().equals(MIMEMultipartRelated.class)) {
+ for (Iterator parts = ((MIMEMultipartRelated) extension).getParts();
+ parts.hasNext();) {
+ Extension part = (Extension) parts.next();
+ if (part.getClass().equals(MIMEPart.class)) {
+ boolean isRootPart = isRootPart((MIMEPart)part);
+ Iterator iter = ((MIMEPart)part).extensions();
+ while(iter.hasNext()) {
+ Object obj = iter.next();
+ if(obj instanceof SOAPHeader){
+ //bug fix: 5024015
+ if(!isRootPart) {
+ warn(
+ "mimemodeler.warning.IgnoringinvalidHeaderPart.notDeclaredInRootPart",
+ new Object[] {
+ info.bindingOperation.getName()});
+ return new ArrayList<SOAPHeader>();
+ }
+ headerList.add((SOAPHeader)obj);
+ }
+ }
+ }
+
+ }
+ }else if(extension instanceof SOAPHeader) {
+ headerList.add((SOAPHeader)extension);
+ }
+ }
+ return headerList;
+ }
+
+ /**
+ * @param part
+ * @return true if part is the Root part
+ */
+ private boolean isRootPart(MIMEPart part) {
+ Iterator iter = part.extensions();
+ while(iter.hasNext()){
+ if(iter.next() instanceof SOAPBody)
+ return true;
+ }
+ return false;
+ }
+
+ protected Set getDuplicateFaultNames() {
+ // look for fault messages with the same soap:fault name
+ Set faultNames = new HashSet();
+ Set duplicateNames = new HashSet();
+ for (Iterator iter = info.bindingOperation.faults(); iter.hasNext();) {
+ BindingFault bindingFault = (BindingFault)iter.next();
+ org.jboss.com.sun.tools.ws.wsdl.document.Fault portTypeFault = null;
+ for (Iterator iter2 = info.portTypeOperation.faults();
+ iter2.hasNext();
+ ) {
+ org.jboss.com.sun.tools.ws.wsdl.document.Fault aFault =
+ (org.jboss.com.sun.tools.ws.wsdl.document.Fault)iter2.next();
+
+ if (aFault.getName().equals(bindingFault.getName())) {
+ if (portTypeFault != null) {
+ // the WSDL document is invalid
+ throw new ModelerException(
+ "wsdlmodeler.invalid.bindingFault.notUnique",
+ new Object[] {
+ bindingFa