feat(jdk8): move files to new folder to avoid resources compiled.

This commit is contained in:
2025-09-07 15:25:52 +08:00
parent 3f0047bf6f
commit 8c35cfb1c0
17415 changed files with 217 additions and 213 deletions

View File

@@ -0,0 +1,170 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.resources.WsdlMessages;
import com.sun.tools.internal.ws.wscompile.AbortException;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Entity corresponding to the "binding" WSDL element.
*
* @author WS Development Team
*/
public class Binding extends GlobalEntity implements TWSDLExtensible {
public Binding(Defining defining, Locator locator, ErrorReceiver receiver) {
super(defining, locator, receiver);
_operations = new ArrayList();
_helper = new ExtensibilityHelper();
}
public void add(BindingOperation operation) {
_operations.add(operation);
}
public Iterator operations() {
return _operations.iterator();
}
public QName getPortType() {
return _portType;
}
public void setPortType(QName n) {
_portType = n;
}
public PortType resolvePortType(AbstractDocument document) {
try {
return (PortType) document.find(Kinds.PORT_TYPE, _portType);
} catch (NoSuchEntityException e) {
errorReceiver.error(getLocator(), WsdlMessages.ENTITY_NOT_FOUND_PORT_TYPE(_portType, new QName(getNamespaceURI(), getName())));
throw new AbortException();
}
}
public Kind getKind() {
return Kinds.BINDING;
}
public QName getElementName() {
return WSDLConstants.QNAME_BINDING;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllSubEntitiesDo(EntityAction action) {
for (Iterator iter = _operations.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
_helper.withAllSubEntitiesDo(action);
}
public void withAllQNamesDo(QNameAction action) {
super.withAllQNamesDo(action);
if (_portType != null) {
action.perform(_portType);
}
}
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_portType != null) {
action.perform(Kinds.PORT_TYPE, _portType);
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
//bug fix: 4947340, extensions should be the first element
_helper.accept(visitor);
for (Iterator iter = _operations.iterator(); iter.hasNext();) {
((BindingOperation) iter.next()).accept(visitor);
}
visitor.postVisit(this);
}
public void validateThis() {
if (getName() == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
if (_portType == null) {
failValidation("validation.missingRequiredAttribute", "type");
}
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getDefining().getTargetNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
private ExtensibilityHelper _helper;
private Documentation _documentation;
private QName _portType;
private List _operations;
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
}

View File

@@ -0,0 +1,118 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "fault" child element of a binding operation.
*
* @author WS Development Team
*/
public class BindingFault extends Entity implements TWSDLExtensible {
public BindingFault(Locator locator) {
super(locator);
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getElementName() {
return WSDLConstants.QNAME_FAULT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getParent().getNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
_helper.accept(visitor);
visitor.postVisit(this);
}
public void validateThis() {
if (_name == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
}
private ExtensibilityHelper _helper;
private Documentation _documentation;
private String _name;
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
}

View File

@@ -0,0 +1,115 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "input" child element of a binding operation.
*
* @author WS Development Team
*/
public class BindingInput extends Entity implements TWSDLExtensible {
public BindingInput(Locator locator) {
super(locator);
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getElementName() {
return WSDLConstants.QNAME_INPUT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getParent().getNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
_helper.accept(visitor);
visitor.postVisit(this);
}
public void validateThis() {
}
private ExtensibilityHelper _helper;
private Documentation _documentation;
private String _name;
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
}

View File

@@ -0,0 +1,234 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.List;
/**
* Entity corresponding to the "operation" child element of a WSDL "binding" element.
*
* @author WS Development Team
*/
public class BindingOperation extends Entity implements TWSDLExtensible {
public BindingOperation(Locator locator) {
super(locator);
_faults = new ArrayList<BindingFault>();
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public String getUniqueKey() {
if (_uniqueKey == null) {
StringBuilder sb = new StringBuilder();
sb.append(_name);
sb.append(' ');
if (_input != null) {
sb.append(_input.getName());
} else {
sb.append(_name);
if (_style == OperationStyle.REQUEST_RESPONSE) {
sb.append("Request");
} else if (_style == OperationStyle.SOLICIT_RESPONSE) {
sb.append("Response");
}
}
sb.append(' ');
if (_output != null) {
sb.append(_output.getName());
} else {
sb.append(_name);
if (_style == OperationStyle.SOLICIT_RESPONSE) {
sb.append("Solicit");
} else if (_style == OperationStyle.REQUEST_RESPONSE) {
sb.append("Response");
}
}
_uniqueKey = sb.toString();
}
return _uniqueKey;
}
public OperationStyle getStyle() {
return _style;
}
public void setStyle(OperationStyle s) {
_style = s;
}
public BindingInput getInput() {
return _input;
}
public void setInput(BindingInput i) {
_input = i;
}
public BindingOutput getOutput() {
return _output;
}
public void setOutput(BindingOutput o) {
_output = o;
}
public void addFault(BindingFault f) {
_faults.add(f);
}
public Iterable<BindingFault> faults() {
return _faults;
}
@Override
public QName getElementName() {
return WSDLConstants.QNAME_OPERATION;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
@Override
public String getNameValue() {
return getName();
}
@Override
public String getNamespaceURI() {
return (parent == null) ? null : parent.getNamespaceURI();
}
@Override
public QName getWSDLElementName() {
return getElementName();
}
@Override
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
@Override
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
@Override
public TWSDLExtensible getParent() {
return parent;
}
@Override
public void withAllSubEntitiesDo(EntityAction action) {
if (_input != null) {
action.perform(_input);
}
if (_output != null) {
action.perform(_output);
}
for (BindingFault _fault : _faults) {
action.perform(_fault);
}
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
//bug fix: 4947340, extensions should be the first element
_helper.accept(visitor);
if (_input != null) {
_input.accept(visitor);
}
if (_output != null) {
_output.accept(visitor);
}
for (BindingFault _fault : _faults) {
_fault.accept(visitor);
}
visitor.postVisit(this);
}
@Override
public void validateThis() {
if (_name == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
if (_style == null) {
failValidation("validation.missingRequiredProperty", "style");
}
// verify operation style
if (_style == OperationStyle.ONE_WAY) {
if (_input == null) {
failValidation("validation.missingRequiredSubEntity", "input");
}
if (_output != null) {
failValidation("validation.invalidSubEntity", "output");
}
if (_faults != null && !_faults.isEmpty()) {
failValidation("validation.invalidSubEntity", "fault");
}
}
}
private ExtensibilityHelper _helper;
private Documentation _documentation;
private String _name;
private BindingInput _input;
private BindingOutput _output;
private List<BindingFault> _faults;
private OperationStyle _style;
private String _uniqueKey;
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
}

View File

@@ -0,0 +1,115 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "output" child element of a binding operation.
*
* @author WS Development Team
*/
public class BindingOutput extends Entity implements TWSDLExtensible {
public BindingOutput(Locator locator) {
super(locator);
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getElementName() {
return WSDLConstants.QNAME_OUTPUT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
public QName getWSDLElementName() {
return getElementName();
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
_helper.accept(visitor);
visitor.postVisit(this);
}
public void validateThis() {
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
private ExtensibilityHelper _helper;
private Documentation _documentation;
private String _name;
}

View File

@@ -0,0 +1,237 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.*;
/**
* Entity corresponding to the "definitions" WSDL element.
*
* @author WS Development Team
*/
public class Definitions extends Entity implements Defining, TWSDLExtensible {
public Definitions(AbstractDocument document, Locator locator) {
super(locator);
_document = document;
_bindings = new ArrayList();
_imports = new ArrayList();
_messages = new ArrayList();
_portTypes = new ArrayList();
_services = new ArrayList();
_importedNamespaces = new HashSet();
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String s) {
_name = s;
}
public String getTargetNamespaceURI() {
return _targetNsURI;
}
public void setTargetNamespaceURI(String s) {
_targetNsURI = s;
}
public void setTypes(Types t) {
_types = t;
}
public Types getTypes() {
return _types;
}
public void add(Message m) {
_document.define(m);
_messages.add(m);
}
public void add(PortType p) {
_document.define(p);
_portTypes.add(p);
}
public void add(Binding b) {
_document.define(b);
_bindings.add(b);
}
public void add(Service s) {
_document.define(s);
_services.add(s);
}
public void addServiceOveride(Service s) {
_services.add(s);
}
public void add(Import i) {
_imports.add(i);
_importedNamespaces.add(i.getNamespace());
}
public Iterator imports() {
return _imports.iterator();
}
public Iterator messages() {
return _messages.iterator();
}
public Iterator portTypes() {
return _portTypes.iterator();
}
public Iterator bindings() {
return _bindings.iterator();
}
public Iterator<Service> services() {
return _services.iterator();
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getTargetNamespaceURI();
}
public QName getWSDLElementName() {
return WSDLConstants.QNAME_DEFINITIONS;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
/**
* wsdl:definition is the root hence no parent so return null.
*/
public TWSDLExtensible getParent() {
return null;
}
public void withAllSubEntitiesDo(EntityAction action) {
if (_types != null) {
action.perform(_types);
}
for (Iterator iter = _messages.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
for (Iterator iter = _portTypes.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
for (Iterator iter = _bindings.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
for (Iterator iter = _services.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
for (Iterator iter = _imports.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
for (Iterator iter = _imports.iterator(); iter.hasNext();) {
((Import) iter.next()).accept(visitor);
}
if (_types != null) {
_types.accept(visitor);
}
for (Iterator iter = _messages.iterator(); iter.hasNext();) {
((Message) iter.next()).accept(visitor);
}
for (Iterator iter = _portTypes.iterator(); iter.hasNext();) {
((PortType) iter.next()).accept(visitor);
}
for (Iterator iter = _bindings.iterator(); iter.hasNext();) {
((Binding) iter.next()).accept(visitor);
}
for (Iterator iter = _services.iterator(); iter.hasNext();) {
((Service) iter.next()).accept(visitor);
}
_helper.accept(visitor);
visitor.postVisit(this);
}
public void validateThis() {
}
public Map resolveBindings() {
return _document.getMap(Kinds.BINDING);
}
private AbstractDocument _document;
private ExtensibilityHelper _helper;
private Documentation _documentation;
private String _name;
private String _targetNsURI;
private Types _types;
private List _messages;
private List _portTypes;
private List _bindings;
private List<Service> _services;
private List _imports;
private Set _importedNamespaces;
public QName getElementName() {
return getWSDLElementName();
}
}

View File

@@ -0,0 +1,52 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
/**
* Entity corresponding to the "documentation" WSDL element.
*
* @author WS Development Team
*/
public class Documentation {
public Documentation(String s) {
content = s;
}
public String getContent() {
return content;
}
public void setContent(String s) {
content = s;
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.visit(this);
}
private String content;
}

View File

@@ -0,0 +1,167 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "fault" child element of a port type operation.
*
* @author WS Development Team
*/
public class Fault extends Entity implements TWSDLExtensible {
public Fault(Locator locator) {
super(locator);
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getMessage() {
return _message;
}
public void setMessage(QName n) {
_message = n;
}
public Message resolveMessage(AbstractDocument document) {
return (Message) document.find(Kinds.MESSAGE, _message);
}
@Override
public QName getElementName() {
return WSDLConstants.QNAME_FAULT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
@Override
public void withAllQNamesDo(QNameAction action) {
if (_message != null) {
action.perform(_message);
}
}
@Override
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_message != null) {
action.perform(Kinds.MESSAGE, _message);
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
visitor.postVisit(this);
}
@Override
public void validateThis() {
if (_name == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
if (_message == null) {
failValidation("validation.missingRequiredAttribute", "message");
}
}
private Documentation _documentation;
private String _name;
private QName _message;
private String _action;
private ExtensibilityHelper _helper;
@Override
public String getNameValue() {
return getName();
}
@Override
public String getNamespaceURI() {
return (parent == null) ? null : parent.getNamespaceURI();
}
@Override
public QName getWSDLElementName() {
return getElementName();
}
/* (non-Javadoc)
* @see TWSDLExtensible#addExtension(ExtensionImpl)
*/
@Override
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
/* (non-Javadoc)
* @see TWSDLExtensible#extensions()
*/
@Override
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
@Override
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
public String getAction() {
return _action;
}
public void setAction(String _action) {
this._action = _action;
}
}

View File

@@ -0,0 +1,88 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "import" WSDL element.
*
* @author WS Development Team
*/
public class Import extends Entity{
public Import(Locator locator) {
super(locator);
}
public String getNamespace() {
return _namespace;
}
public void setNamespace(String s) {
_namespace = s;
}
public String getLocation() {
return _location;
}
public void setLocation(String s) {
_location = s;
}
public QName getElementName() {
return WSDLConstants.QNAME_IMPORT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.visit(this);
}
public void validateThis() {
if (_location == null) {
failValidation("validation.missingRequiredAttribute", "location");
}
if (_namespace == null) {
failValidation("validation.missingRequiredAttribute", "namespace");
}
}
private Documentation _documentation;
private String _location;
private String _namespace;
}

View File

@@ -0,0 +1,150 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import com.sun.tools.internal.ws.wscompile.AbortException;
import com.sun.tools.internal.ws.resources.WsdlMessages;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "input" child element of a port type operation.
*
* @author WS Development Team
*/
public class Input extends Entity implements TWSDLExtensible {
public Input(Locator locator, ErrorReceiver errReceiver) {
super(locator);
this.errorReceiver = errReceiver;
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getMessage() {
return _message;
}
public void setMessage(QName n) {
_message = n;
}
public Message resolveMessage(AbstractDocument document) {
return (Message) document.find(Kinds.MESSAGE, _message);
}
public QName getElementName() {
return WSDLConstants.QNAME_INPUT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllQNamesDo(QNameAction action) {
if (_message != null) {
action.perform(_message);
}
}
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_message != null) {
action.perform(Kinds.MESSAGE, _message);
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
visitor.postVisit(this);
}
public void validateThis() {
if (_message == null) {
errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
throw new AbortException();
}
}
private Documentation _documentation;
private String _name;
private QName _message;
private String _action;
private ExtensibilityHelper _helper;
private TWSDLExtensible parent;
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public QName getWSDLElementName() {
return getElementName();
}
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
public String getNamespaceURI() {
return getElementName().getNamespaceURI();
}
public String getNameValue() {
return null;
}
public Iterable<? extends TWSDLExtension> extensions() {
return _helper.extensions();
}
public String getAction() {
return _action;
}
public void setAction(String _action) {
this._action = _action;
}
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.Kind;
/**
* Enumeration of the kind of entities that can be defined in a WSDL "definitions" element.
*
* @author WS Development Team
*/
public class Kinds {
public static final Kind BINDING = new Kind("wsdl:binding");
public static final Kind MESSAGE = new Kind("wsdl:message");
public static final Kind PORT = new Kind("wsdl:port");
public static final Kind PORT_TYPE = new Kind("wsdl:portType");
public static final Kind SERVICE = new Kind("wsdl:service");
private Kinds() {
}
}

View File

@@ -0,0 +1,121 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import com.sun.tools.internal.ws.wscompile.AbortException;
import com.sun.tools.internal.ws.resources.WsdlMessages;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.*;
/**
* Entity corresponding to the "message" WSDL element.
*
* @author WS Development Team
*/
public class Message extends GlobalEntity {
public Message(Defining defining, Locator locator, ErrorReceiver errReceiver) {
super(defining, locator, errReceiver);
_parts = new ArrayList<MessagePart>();
_partsByName = new HashMap<String, MessagePart>();
}
public void add(MessagePart part) {
if (_partsByName.get(part.getName()) != null){
errorReceiver.error(part.getLocator(), WsdlMessages.VALIDATION_DUPLICATE_PART_NAME(getName(), part.getName()));
throw new AbortException();
}
if(part.getDescriptor() != null && part.getDescriptorKind() != null) {
_partsByName.put(part.getName(), part);
_parts.add(part);
} else
errorReceiver.warning(part.getLocator(), WsdlMessages.PARSING_ELEMENT_OR_TYPE_REQUIRED(part.getName()));
}
public Iterator<MessagePart> parts() {
return _parts.iterator();
}
public List<MessagePart> getParts(){
return _parts;
}
public MessagePart getPart(String name) {
return _partsByName.get(name);
}
public int numParts() {
return _parts.size();
}
public Kind getKind() {
return Kinds.MESSAGE;
}
public QName getElementName() {
return WSDLConstants.QNAME_MESSAGE;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllSubEntitiesDo(EntityAction action) {
super.withAllSubEntitiesDo(action);
for (Iterator iter = _parts.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
for (Iterator<MessagePart> iter = _parts.iterator(); iter.hasNext();) {
iter.next().accept(visitor);
}
visitor.postVisit(this);
}
public void validateThis() {
if (getName() == null) {
errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
throw new AbortException();
}
}
private Documentation _documentation;
private List<MessagePart> _parts;
private Map<String, MessagePart> _partsByName;
}

View File

@@ -0,0 +1,156 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityReferenceAction;
import com.sun.tools.internal.ws.wsdl.framework.Kind;
import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
import org.xml.sax.Locator;
import javax.jws.WebParam.Mode;
import javax.xml.namespace.QName;
/**
* Entity corresponding to a WSDL message part.
*
* @author WS Development Team
*/
public class MessagePart extends Entity {
public static final int SOAP_BODY_BINDING = 1;
public static final int SOAP_HEADER_BINDING = 2;
public static final int SOAP_HEADERFAULT_BINDING = 3;
public static final int SOAP_FAULT_BINDING = 4;
public static final int WSDL_MIME_BINDING = 5;
public static final int PART_NOT_BOUNDED = -1;
public MessagePart(Locator locator) {
super(locator);
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getDescriptor() {
return _descriptor;
}
public void setDescriptor(QName n) {
_descriptor = n;
}
public Kind getDescriptorKind() {
return _descriptorKind;
}
public void setDescriptorKind(Kind k) {
_descriptorKind = k;
}
public QName getElementName() {
return WSDLConstants.QNAME_PART;
}
public int getBindingExtensibilityElementKind(){
return _bindingKind;
}
public void setBindingExtensibilityElementKind(int kind) {
_bindingKind = kind;
}
public void withAllQNamesDo(QNameAction action) {
if (_descriptor != null) {
action.perform(_descriptor);
}
}
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_descriptor != null && _descriptorKind != null) {
action.perform(_descriptorKind, _descriptor);
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.visit(this);
}
public void validateThis() {
if(_descriptor != null && _descriptor.getLocalPart().equals("")){
failValidation("validation.invalidElement", _descriptor.toString());
}
}
public void setMode(Mode mode){
this.mode = mode;
}
public Mode getMode(){
return mode;
}
public boolean isINOUT(){
if(mode!=null)
return (mode == Mode.INOUT);
return false;
}
public boolean isIN(){
if(mode!=null)
return (mode == Mode.IN);
return false;
}
public boolean isOUT(){
if(mode!=null)
return (mode == Mode.OUT);
return false;
}
public void setReturn(boolean ret){
isRet=ret;
}
public boolean isReturn(){
return isRet;
}
private boolean isRet;
private String _name;
private QName _descriptor;
private Kind _descriptorKind;
private int _bindingKind;
private Mode mode;
}

View File

@@ -0,0 +1,255 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.codemodel.internal.JClass;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.api.wsdl.TWSDLOperation;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.*;
/**
* Entity corresponding to the "operation" child element of a "portType" WSDL element.
*
* @author WS Development Team
*/
public class Operation extends Entity implements TWSDLOperation {
public Operation(Locator locator) {
super(locator);
_faults = new ArrayList<Fault>();
_helper = new ExtensibilityHelper();
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public String getUniqueKey() {
if (_uniqueKey == null) {
StringBuffer sb = new StringBuffer();
sb.append(_name);
sb.append(' ');
if (_input != null) {
sb.append(_input.getName());
} else {
sb.append(_name);
if (_style == OperationStyle.REQUEST_RESPONSE) {
sb.append("Request");
} else if (_style == OperationStyle.SOLICIT_RESPONSE) {
sb.append("Response");
}
}
sb.append(' ');
if (_output != null) {
sb.append(_output.getName());
} else {
sb.append(_name);
if (_style == OperationStyle.SOLICIT_RESPONSE) {
sb.append("Solicit");
} else if (_style == OperationStyle.REQUEST_RESPONSE) {
sb.append("Response");
}
}
_uniqueKey = sb.toString();
}
return _uniqueKey;
}
public OperationStyle getStyle() {
return _style;
}
public void setStyle(OperationStyle s) {
_style = s;
}
public Input getInput() {
return _input;
}
public void setInput(Input i) {
_input = i;
}
public Output getOutput() {
return _output;
}
public void setOutput(Output o) {
_output = o;
}
public void addFault(Fault f) {
_faults.add(f);
}
public Iterable<Fault> faults() {
return _faults;
}
public String getParameterOrder() {
return _parameterOrder;
}
public void setParameterOrder(String s) {
_parameterOrder = s;
}
public QName getElementName() {
return WSDLConstants.QNAME_OPERATION;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllSubEntitiesDo(EntityAction action) {
super.withAllSubEntitiesDo(action);
if (_input != null) {
action.perform(_input);
}
if (_output != null) {
action.perform(_output);
}
for (Fault _fault : _faults) {
action.perform(_fault);
}
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
if (_input != null) {
_input.accept(visitor);
}
if (_output != null) {
_output.accept(visitor);
}
for (Fault _fault : _faults) {
_fault.accept(visitor);
}
visitor.postVisit(this);
}
public void validateThis() {
if (_name == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
if (_style == null) {
failValidation("validation.missingRequiredProperty", "style");
}
// verify operation style
if (_style == OperationStyle.ONE_WAY) {
if (_input == null) {
failValidation("validation.missingRequiredSubEntity", "input");
}
if (_output != null) {
failValidation("validation.invalidSubEntity", "output");
}
if (_faults != null && _faults.size() != 0) {
failValidation("validation.invalidSubEntity", "fault");
}
} else if (_style == OperationStyle.NOTIFICATION) {
if (_parameterOrder != null) {
failValidation("validation.invalidAttribute", "parameterOrder");
}
}
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return parent.getNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
/* (non-Javadoc)
* @see TWSDLExtensible#addExtension(ExtensionImpl)
*/
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
/* (non-Javadoc)
* @see TWSDLExtensible#extensions()
*/
public Iterable<? extends TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
public Map<String, JClass> getFaults() {
return unmodifiableFaultClassMap;
}
public void putFault(String faultName, JClass exception){
faultClassMap.put(faultName, exception);
}
private TWSDLExtensible parent;
private Documentation _documentation;
private String _name;
private Input _input;
private Output _output;
private List<Fault> _faults;
private OperationStyle _style;
private String _parameterOrder;
private String _uniqueKey;
private ExtensibilityHelper _helper;
private final Map<String, JClass> faultClassMap = new HashMap<String, JClass>();
private final Map<String, JClass> unmodifiableFaultClassMap = Collections.unmodifiableMap(faultClassMap);
}

View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
/**
* Enumeration of the supported WSDL operation styles.
*
* @author WS Development Team
*/
public final class OperationStyle {
public static final OperationStyle ONE_WAY = new OperationStyle();
public static final OperationStyle REQUEST_RESPONSE = new OperationStyle();
public static final OperationStyle SOLICIT_RESPONSE = new OperationStyle();
public static final OperationStyle NOTIFICATION = new OperationStyle();
private OperationStyle() {
}
}

View File

@@ -0,0 +1,149 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import com.sun.tools.internal.ws.wscompile.AbortException;
import com.sun.tools.internal.ws.resources.WsdlMessages;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "output" child element of a port type operation.
*
* @author WS Development Team
*/
public class Output extends Entity implements TWSDLExtensible {
public Output(Locator locator, ErrorReceiver errReceiver) {
super(locator);
this.errorReceiver = errReceiver;
}
public String getName() {
return _name;
}
public void setName(String name) {
_name = name;
}
public QName getMessage() {
return _message;
}
public void setMessage(QName n) {
_message = n;
}
public Message resolveMessage(AbstractDocument document) {
return (Message) document.find(Kinds.MESSAGE, _message);
}
public QName getElementName() {
return WSDLConstants.QNAME_OUTPUT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllQNamesDo(QNameAction action) {
if (_message != null) {
action.perform(_message);
}
}
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_message != null) {
action.perform(Kinds.MESSAGE, _message);
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
visitor.postVisit(this);
}
public void validateThis() {
if (_message == null) {
errorReceiver.error(getLocator(), WsdlMessages.VALIDATION_MISSING_REQUIRED_ATTRIBUTE("name", "wsdl:message"));
throw new AbortException();
}
}
private Documentation _documentation;
private String _name;
private QName _message;
private String _action;
private ExtensibilityHelper _helper;
private TWSDLExtensible parent;
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public QName getWSDLElementName() {
return getElementName();
}
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
public String getNamespaceURI() {
return getElementName().getNamespaceURI();
}
public String getNameValue() {
return null;
}
public Iterable<? extends TWSDLExtension> extensions() {
return _helper.extensions();
}
public String getAction() {
return _action;
}
public void setAction(String _action) {
this._action = _action;
}
}

View File

@@ -0,0 +1,159 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.resources.WsdlMessages;
import com.sun.tools.internal.ws.wscompile.AbortException;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "port" WSDL element.
*
* @author WS Development Team
*/
public class Port extends GlobalEntity implements TWSDLExtensible {
public Port(Defining defining, Locator locator, ErrorReceiver errReceiver) {
super(defining, locator, errReceiver);
_helper = new ExtensibilityHelper();
}
public Service getService() {
return _service;
}
public void setService(Service s) {
_service = s;
}
public QName getBinding() {
return _binding;
}
public void setBinding(QName n) {
_binding = n;
}
public Binding resolveBinding(AbstractDocument document) {
try{
return (Binding) document.find(Kinds.BINDING, _binding);
} catch (NoSuchEntityException e) {
errorReceiver.error(getLocator(), WsdlMessages.ENTITY_NOT_FOUND_BINDING(_binding, new QName(getNamespaceURI(), getName())));
throw new AbortException();
}
}
public Kind getKind() {
return Kinds.PORT;
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getDefining().getTargetNamespaceURI();
}
public QName getWSDLElementName() {
return WSDLConstants.QNAME_PORT;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllQNamesDo(QNameAction action) {
super.withAllQNamesDo(action);
if (_binding != null) {
action.perform(_binding);
}
}
public void withAllEntityReferencesDo(EntityReferenceAction action) {
super.withAllEntityReferencesDo(action);
if (_binding != null) {
action.perform(Kinds.BINDING, _binding);
}
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
_helper.accept(visitor);
visitor.postVisit(this);
}
public void validateThis() {
if (getName() == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
if (_binding == null) {
failValidation("validation.missingRequiredAttribute", "binding");
}
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
private ExtensibilityHelper _helper;
private Documentation _documentation;
private Service _service;
private QName _binding;
public QName getElementName() {
return getWSDLElementName();
}
private TWSDLExtensible parent;
}

View File

@@ -0,0 +1,156 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.*;
/**
* Entity corresponding to the "portType" WSDL element.
*
* @author WS Development Team
*/
public class PortType extends GlobalEntity implements TWSDLExtensible {
public PortType(Defining defining, Locator locator, ErrorReceiver errReceiver) {
super(defining, locator, errReceiver);
_operations = new ArrayList();
_operationKeys = new HashSet();
_helper = new ExtensibilityHelper();
}
public void add(Operation operation) {
String key = operation.getUniqueKey();
if (_operationKeys.contains(key))
throw new ValidationException(
"validation.ambiguousName",
operation.getName());
_operationKeys.add(key);
_operations.add(operation);
}
public Iterator operations() {
return _operations.iterator();
}
public Set getOperationsNamed(String s) {
Set result = new HashSet();
for (Iterator iter = _operations.iterator(); iter.hasNext();) {
Operation operation = (Operation) iter.next();
if (operation.getName().equals(s)) {
result.add(operation);
}
}
return result;
}
public Kind getKind() {
return Kinds.PORT_TYPE;
}
public QName getElementName() {
return WSDLConstants.QNAME_PORT_TYPE;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllSubEntitiesDo(EntityAction action) {
super.withAllSubEntitiesDo(action);
for (Iterator iter = _operations.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
_helper.accept(visitor);
for (Iterator iter = _operations.iterator(); iter.hasNext();) {
((Operation) iter.next()).accept(visitor);
}
visitor.postVisit(this);
}
public void validateThis() {
if (getName() == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getDefining().getTargetNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
/* (non-Javadoc)
* @see TWSDLExtensible#addExtension(ExtensionImpl)
*/
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
/* (non-Javadoc)
* @see TWSDLExtensible#extensions()
*/
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
private TWSDLExtensible parent;
private Documentation _documentation;
private List _operations;
private Set _operationKeys;
private ExtensibilityHelper _helper;
}

View File

@@ -0,0 +1,126 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Entity corresponding to the "service" WSDL element.
*
* @author WS Development Team
*/
public class Service extends GlobalEntity implements TWSDLExtensible {
public Service(Defining defining, Locator locator, ErrorReceiver errReceiver) {
super(defining, locator, errReceiver);
_ports = new ArrayList();
_helper = new ExtensibilityHelper();
}
public void add(Port port) {
port.setService(this);
_ports.add(port);
}
public Iterator <Port> ports() {
return _ports.iterator();
}
public Kind getKind() {
return Kinds.SERVICE;
}
public QName getElementName() {
return WSDLConstants.QNAME_SERVICE;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void withAllSubEntitiesDo(EntityAction action) {
for (Iterator iter = _ports.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
_helper.withAllSubEntitiesDo(action);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
for (Iterator iter = _ports.iterator(); iter.hasNext();) {
((Port) iter.next()).accept(visitor);
}
_helper.accept(visitor);
visitor.postVisit(this);
}
public void validateThis() {
if (getName() == null) {
failValidation("validation.missingRequiredAttribute", "name");
}
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getDefining().getTargetNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public TWSDLExtensible getParent() {
return null; //To change body of implemented methods use File | Settings | File Templates.
}
private ExtensibilityHelper _helper;
private Documentation _documentation;
private List <Port> _ports;
}

View File

@@ -0,0 +1,122 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* Entity corresponding to the "types" WSDL element.
*
* @author WS Development Team
*/
public class Types extends Entity implements TWSDLExtensible {
public Types(Locator locator) {
super(locator);
_helper = new ExtensibilityHelper();
}
@Override
public QName getElementName() {
return WSDLConstants.QNAME_TYPES;
}
public Documentation getDocumentation() {
return _documentation;
}
public void setDocumentation(Documentation d) {
_documentation = d;
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
visitor.preVisit(this);
_helper.accept(visitor);
visitor.postVisit(this);
}
@Override
public void validateThis() {
}
/**
* wsdl:type does not have any name attribute
*/
@Override
public String getNameValue() {
return null;
}
@Override
public String getNamespaceURI() {
return (parent == null) ? null : parent.getNamespaceURI();
}
@Override
public QName getWSDLElementName() {
return getElementName();
}
@Override
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
@Override
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
@Override
public TWSDLExtensible getParent() {
return parent;
}
public void setParent(TWSDLExtensible parent) {
this.parent = parent;
}
@Override
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
public void accept(ExtensionVisitor visitor) throws Exception {
_helper.accept(visitor);
}
private TWSDLExtensible parent;
private ExtensibilityHelper _helper;
private Documentation _documentation;
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import javax.xml.namespace.QName;
/**
* Interface defining WSDL-related constants.
*
* @author WS Development Team
*/
public interface WSDLConstants {
// namespace URIs
static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
static final String NS_WSDL = "http://schemas.xmlsoap.org/wsdl/";
// QNames
static final QName QNAME_BINDING = new QName(NS_WSDL, "binding");
static final QName QNAME_DEFINITIONS = new QName(NS_WSDL, "definitions");
static final QName QNAME_DOCUMENTATION = new QName(NS_WSDL, "documentation");
static final QName QNAME_FAULT = new QName(NS_WSDL, "fault");
static final QName QNAME_IMPORT = new QName(NS_WSDL, "import");
static final QName QNAME_INPUT = new QName(NS_WSDL, "input");
static final QName QNAME_MESSAGE = new QName(NS_WSDL, "message");
static final QName QNAME_OPERATION = new QName(NS_WSDL, "operation");
static final QName QNAME_OUTPUT = new QName(NS_WSDL, "output");
static final QName QNAME_PART = new QName(NS_WSDL, "part");
static final QName QNAME_PORT = new QName(NS_WSDL, "port");
static final QName QNAME_PORT_TYPE = new QName(NS_WSDL, "portType");
static final QName QNAME_SERVICE = new QName(NS_WSDL, "service");
static final QName QNAME_TYPES = new QName(NS_WSDL, "types");
static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_WSDL, "arrayType");
}

View File

@@ -0,0 +1,173 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.*;
import com.sun.tools.internal.ws.wsdl.parser.MetadataFinder;
import com.sun.tools.internal.ws.wscompile.ErrorReceiver;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
/**
* A WSDL document.
*
* @author WS Development Team
*/
public class WSDLDocument extends AbstractDocument{
public WSDLDocument(MetadataFinder forest, ErrorReceiver errReceiver) {
super(forest, errReceiver);
}
public Definitions getDefinitions() {
return _definitions;
}
public void setDefinitions(Definitions d) {
_definitions = d;
}
public QName[] getAllServiceQNames() {
ArrayList serviceQNames = new ArrayList();
for (Iterator iter = getDefinitions().services(); iter.hasNext();) {
Service next = (Service) iter.next();
String targetNamespace = next.getDefining().getTargetNamespaceURI();
String localName = next.getName();
QName serviceQName = new QName(targetNamespace, localName);
serviceQNames.add(serviceQName);
}
return (QName[]) serviceQNames.toArray(new QName[serviceQNames.size()]);
}
public QName[] getAllPortQNames() {
ArrayList portQNames = new ArrayList();
for (Iterator iter = getDefinitions().services(); iter.hasNext();) {
Service next = (Service) iter.next();
//Iterator ports = next.ports();
for (Iterator piter = next.ports(); piter.hasNext();) {
// If it's a relative import
Port pnext = (Port) piter.next();
String targetNamespace =
pnext.getDefining().getTargetNamespaceURI();
String localName = pnext.getName();
QName portQName = new QName(targetNamespace, localName);
portQNames.add(portQName);
}
}
return (QName[]) portQNames.toArray(new QName[portQNames.size()]);
}
public QName[] getPortQNames(String serviceNameLocalPart) {
ArrayList portQNames = new ArrayList();
for (Iterator iter = getDefinitions().services(); iter.hasNext();) {
Service next = (Service) iter.next();
if (next.getName().equals(serviceNameLocalPart)) {
for (Iterator piter = next.ports(); piter.hasNext();) {
Port pnext = (Port) piter.next();
String targetNamespace =
pnext.getDefining().getTargetNamespaceURI();
String localName = pnext.getName();
QName portQName = new QName(targetNamespace, localName);
portQNames.add(portQName);
}
}
}
return (QName[]) portQNames.toArray(new QName[portQNames.size()]);
}
public void accept(WSDLDocumentVisitor visitor) throws Exception {
_definitions.accept(visitor);
}
@Override
public void validate(EntityReferenceValidator validator) {
GloballyValidatingAction action =
new GloballyValidatingAction(this, validator);
withAllSubEntitiesDo(action);
if (action.getException() != null) {
throw action.getException();
}
}
@Override
protected Entity getRoot() {
return _definitions;
}
private Definitions _definitions;
private static class GloballyValidatingAction implements EntityAction, EntityReferenceAction {
public GloballyValidatingAction(
AbstractDocument document,
EntityReferenceValidator validator) {
_document = document;
_validator = validator;
}
@Override
public void perform(Entity entity) {
try {
entity.validateThis();
entity.withAllEntityReferencesDo(this);
entity.withAllSubEntitiesDo(this);
} catch (ValidationException e) {
if (_exception == null) {
_exception = e;
}
}
}
@Override
public void perform(Kind kind, QName name) {
try {
_document.find(kind, name);
} catch (NoSuchEntityException e) {
// failed to resolve, check with the validator
if (_exception == null) {
if (_validator == null
|| !_validator.isValid(kind, name)) {
_exception = e;
}
}
}
}
public ValidationException getException() {
return _exception;
}
private ValidationException _exception;
private AbstractDocument _document;
private EntityReferenceValidator _validator;
}
}

View File

@@ -0,0 +1,70 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
/**
* A visitor for WSDL documents.
*
* @author WS Development Team
*/
public interface WSDLDocumentVisitor extends ExtensionVisitor {
public void preVisit(Definitions definitions) throws Exception;
public void postVisit(Definitions definitions) throws Exception;
public void visit(Import i) throws Exception;
public void preVisit(Types types) throws Exception;
public void postVisit(Types types) throws Exception;
public void preVisit(Message message) throws Exception;
public void postVisit(Message message) throws Exception;
public void visit(MessagePart part) throws Exception;
public void preVisit(PortType portType) throws Exception;
public void postVisit(PortType portType) throws Exception;
public void preVisit(Operation operation) throws Exception;
public void postVisit(Operation operation) throws Exception;
public void preVisit(Input input) throws Exception;
public void postVisit(Input input) throws Exception;
public void preVisit(Output output) throws Exception;
public void postVisit(Output output) throws Exception;
public void preVisit(Fault fault) throws Exception;
public void postVisit(Fault fault) throws Exception;
public void preVisit(Binding binding) throws Exception;
public void postVisit(Binding binding) throws Exception;
public void preVisit(BindingOperation operation) throws Exception;
public void postVisit(BindingOperation operation) throws Exception;
public void preVisit(BindingInput input) throws Exception;
public void postVisit(BindingInput input) throws Exception;
public void preVisit(BindingOutput output) throws Exception;
public void postVisit(BindingOutput output) throws Exception;
public void preVisit(BindingFault fault) throws Exception;
public void postVisit(BindingFault fault) throws Exception;
public void preVisit(Service service) throws Exception;
public void postVisit(Service service) throws Exception;
public void preVisit(Port port) throws Exception;
public void postVisit(Port port) throws Exception;
public void visit(Documentation documentation) throws Exception;
}

View File

@@ -0,0 +1,105 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitorBase;
/**
*
* @author WS Development Team
*/
public class WSDLDocumentVisitorBase extends ExtensionVisitorBase {
public WSDLDocumentVisitorBase() {
}
public void preVisit(Definitions definitions) throws Exception {
}
public void postVisit(Definitions definitions) throws Exception {
}
public void visit(Import i) throws Exception {
}
public void preVisit(Types types) throws Exception {
}
public void postVisit(Types types) throws Exception {
}
public void preVisit(Message message) throws Exception {
}
public void postVisit(Message message) throws Exception {
}
public void visit(MessagePart part) throws Exception {
}
public void preVisit(PortType portType) throws Exception {
}
public void postVisit(PortType portType) throws Exception {
}
public void preVisit(Operation operation) throws Exception {
}
public void postVisit(Operation operation) throws Exception {
}
public void preVisit(Input input) throws Exception {
}
public void postVisit(Input input) throws Exception {
}
public void preVisit(Output output) throws Exception {
}
public void postVisit(Output output) throws Exception {
}
public void preVisit(Fault fault) throws Exception {
}
public void postVisit(Fault fault) throws Exception {
}
public void preVisit(Binding binding) throws Exception {
}
public void postVisit(Binding binding) throws Exception {
}
public void preVisit(BindingOperation operation) throws Exception {
}
public void postVisit(BindingOperation operation) throws Exception {
}
public void preVisit(BindingInput input) throws Exception {
}
public void postVisit(BindingInput input) throws Exception {
}
public void preVisit(BindingOutput output) throws Exception {
}
public void postVisit(BindingOutput output) throws Exception {
}
public void preVisit(BindingFault fault) throws Exception {
}
public void postVisit(BindingFault fault) throws Exception {
}
public void preVisit(Service service) throws Exception {
}
public void postVisit(Service service) throws Exception {
}
public void preVisit(Port port) throws Exception {
}
public void postVisit(Port port) throws Exception {
}
public void visit(Documentation documentation) throws Exception {
}
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.http;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A HTTP address extension.
*
* @author WS Development Team
*/
public class HTTPAddress extends ExtensionImpl {
public HTTPAddress(Locator locator) {
super(locator);
}
public QName getElementName() {
return HTTPConstants.QNAME_ADDRESS;
}
public String getLocation() {
return _location;
}
public void setLocation(String s) {
_location = s;
}
public void validateThis() {
if (_location == null) {
failValidation("validation.missingRequiredAttribute", "location");
}
}
private String _location;
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.http;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A HTTP binding extension.
*
* @author WS Development Team
*/
public class HTTPBinding extends ExtensionImpl {
public HTTPBinding(Locator locator) {
super(locator);
}
public QName getElementName() {
return HTTPConstants.QNAME_BINDING;
}
public String getVerb() {
return _verb;
}
public void setVerb(String s) {
_verb = s;
}
public void validateThis() {
if (_verb == null) {
failValidation("validation.missingRequiredAttribute", "verb");
}
}
private String _verb;
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.http;
import javax.xml.namespace.QName;
/**
* Interface defining HTTP-extension-related constants.
*
* @author WS Development Team
*/
public interface HTTPConstants {
// namespace URIs
static final String NS_WSDL_HTTP = "http://schemas.xmlsoap.org/wsdl/http/";
// QNames
static final QName QNAME_ADDRESS = new QName(NS_WSDL_HTTP, "address");
static final QName QNAME_BINDING = new QName(NS_WSDL_HTTP, "binding");
static final QName QNAME_OPERATION = new QName(NS_WSDL_HTTP, "operation");
static final QName QNAME_URL_ENCODED = new QName(NS_WSDL_HTTP, "urlEncoded");
static final QName QNAME_URL_REPLACEMENT = new QName(NS_WSDL_HTTP, "urlReplacement");
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.http;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A HTTP operation extension.
*
* @author WS Development Team
*/
public class HTTPOperation extends ExtensionImpl {
public HTTPOperation(Locator locator) {
super(locator);
}
public QName getElementName() {
return HTTPConstants.QNAME_OPERATION;
}
public String getLocation() {
return _location;
}
public void setLocation(String s) {
_location = s;
}
public void validateThis() {
if (_location == null) {
failValidation("validation.missingRequiredAttribute", "location");
}
}
private String _location;
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.http;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A HTTP urlEncoded extension.
*
* @author WS Development Team
*/
public class HTTPUrlEncoded extends ExtensionImpl {
public HTTPUrlEncoded(Locator locator) {
super(locator);
}
public QName getElementName() {
return HTTPConstants.QNAME_URL_ENCODED;
}
public void validateThis() {
}
}

View File

@@ -0,0 +1,50 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.http;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A HTTP urlReplacement extension.
*
* @author WS Development Team
*/
public class HTTPUrlReplacement extends ExtensionImpl {
public HTTPUrlReplacement(Locator locator) {
super(locator);
}
public QName getElementName() {
return HTTPConstants.QNAME_URL_REPLACEMENT;
}
public void validateThis() {
}
}

View File

@@ -0,0 +1,79 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.jaxws;
/**
* @author Vivek Pandey
*
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public class CustomName {
/**
*
*/
public CustomName() {
}
/**
*
*/
public CustomName(String name, String javaDoc) {
this.name = name;
this.javaDoc = javaDoc;
}
/**
* @return Returns the javaDoc.
*/
public String getJavaDoc() {
return javaDoc;
}
/**
* @param javaDoc The javaDoc to set.
*/
public void setJavaDoc(String javaDoc) {
this.javaDoc = javaDoc;
}
/**
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
}
private String javaDoc;
private String name;
}

View File

@@ -0,0 +1,55 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.jaxws;
/**
* @author Vivek Pandey
*
* class representing jaxws:exception
*
*/
public class Exception {
public Exception(){}
public Exception(CustomName name){
this.className = name;
}
private CustomName className;
/**
* @return Returns the className.
*/
public CustomName getClassName() {
return className;
}
/**
* @param className The className to set.
*/
public void setClassName(CustomName className) {
this.className = className;
}
}

View File

@@ -0,0 +1,314 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.jaxws;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.w3c.dom.Element;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.*;
/**
* @author Vivek Pandey
*
* To change the template for this generated type comment go to
* Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
*/
public class JAXWSBinding extends ExtensionImpl {
/**
*
*/
public JAXWSBinding(Locator locator){
super(locator);
jaxbBindings = new HashSet<Element>();
// TODO Auto-generated constructor stub
}
/* (non-Javadoc)
* @see Entity#validateThis()
*/
public void validateThis(){
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see Elemental#getElementName()
*/
public QName getElementName(){
// TODO Auto-generated method stub
return JAXWSBindingsConstants.JAXWS_BINDINGS;
}
public QName getWSDLElementName() {
return getElementName();
}
/* (non-Javadoc)
* @see TWSDLExtensible#addExtension(ExtensionImpl)
*/
public void addExtension(ExtensionImpl e) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see TWSDLExtensible#extensions()
*/
public Iterable<ExtensionImpl> extensions() {
// TODO Auto-generated method stub
return null;
}
// /**
// * @return Returns the enableAdditionalHeaderMapping.
// */
// public Boolean isEnableAdditionalHeaderMapping() {
// return enableAdditionalHeaderMapping;
// }
// /**
// * @param enableAdditionalHeaderMapping The enableAdditionalHeaderMapping to set.
// */
// public void setEnableAdditionalHeaderMapping(
// Boolean enableAdditionalHeaderMapping) {
// this.enableAdditionalHeaderMapping = enableAdditionalHeaderMapping;
// }
/**
* @return Returns the enableAsyncMapping.
*/
public Boolean isEnableAsyncMapping() {
return enableAsyncMapping;
}
/**
* @param enableAsyncMapping The enableAsyncMapping to set.
*/
public void setEnableAsyncMapping(Boolean enableAsyncMapping) {
this.enableAsyncMapping = enableAsyncMapping;
}
/**
* @return Returns the enableMimeContentMapping.
*/
public Boolean isEnableMimeContentMapping() {
return enableMimeContentMapping;
}
/**
* @param enableMimeContentMapping The enableMimeContentMapping to set.
*/
public void setEnableMimeContentMapping(Boolean enableMimeContentMapping) {
this.enableMimeContentMapping = enableMimeContentMapping;
}
/**
* @return Returns the enableWrapperStyle.
*/
public Boolean isEnableWrapperStyle() {
return enableWrapperStyle;
}
/**
* @param enableWrapperStyle The enableWrapperStyle to set.
*/
public void setEnableWrapperStyle(Boolean enableWrapperStyle) {
this.enableWrapperStyle = enableWrapperStyle;
}
/**
* @return Returns the jaxwsPackage.
*/
public CustomName getJaxwsPackage() {
return jaxwsPackage;
}
/**
* @param jaxwsPackage The jaxwsPackage to set.
*/
public void setJaxwsPackage(CustomName jaxwsPackage) {
this.jaxwsPackage = jaxwsPackage;
}
/**
* @return Returns the node.
*/
public String getNode() {
return node;
}
/**
* @param node The node to set.
*/
public void setNode(String node) {
this.node = node;
}
/**
* @return Returns the version.
*/
public String getVersion() {
return version;
}
/**
* @param version The version to set.
*/
public void setVersion(String version) {
this.version = version;
}
/**
* @return Returns the wsdlLocation.
*/
public String getWsdlLocation() {
return wsdlLocation;
}
/**
* @param wsdlLocation The wsdlLocation to set.
*/
public void setWsdlLocation(String wsdlLocation) {
this.wsdlLocation = wsdlLocation;
}
/**
* @return Returns the wsdlNamespace.
*/
public String getWsdlNamespace() {
return wsdlNamespace;
}
/**
* @param wsdlNamespace The wsdlNamespace to set.
*/
public void setWsdlNamespace(String wsdlNamespace) {
this.wsdlNamespace = wsdlNamespace;
}
/**
* @return Returns the jaxbBindings.
*/
public Set<Element> getJaxbBindings() {
return jaxbBindings;
}
/**
* @param jaxbBinding The jaxbBindings to set.
*/
public void addJaxbBindings(Element jaxbBinding) {
if(jaxbBindings == null)
return;
this.jaxbBindings.add(jaxbBinding);
}
/**
* @return the isProvider.
*/
public Boolean isProvider() {
return isProvider;
}
/**
* @param isProvider The isProvider to set.
*/
public void setProvider(Boolean isProvider) {
this.isProvider = isProvider;
}
/**
* @return Returns the methodName.
*/
public CustomName getMethodName() {
return methodName;
}
/**
* @param methodName The methodName to set.
*/
public void setMethodName(CustomName methodName) {
this.methodName = methodName;
}
/**
* @return Returns the parameter.
*/
public Iterator<Parameter> parameters() {
return parameters.iterator();
}
/**
* @param parameter The parameter to set.
*/
public void addParameter(Parameter parameter) {
if(parameters == null)
parameters = new ArrayList<Parameter>();
parameters.add(parameter);
}
public String getParameterName(String msgName, String wsdlPartName, QName element, boolean wrapperStyle){
if(msgName == null || wsdlPartName == null || element == null || parameters == null)
return null;
for(Parameter param : parameters){
if(param.getMessageName().equals(msgName) && param.getPart().equals(wsdlPartName)){
if(wrapperStyle && (param.getElement() != null)){
if(param.getElement().equals(element))
return param.getName();
}else if(!wrapperStyle){
return param.getName();
}
}
}
return null;
}
/**
* @return Returns the className.
*/
public CustomName getClassName() {
return className;
}
/**
* @param className The className to set.
*/
public void setClassName(CustomName className) {
this.className = className;
}
private String wsdlNamespace;
private String wsdlLocation;
private String node;
private String version;
private CustomName jaxwsPackage;
private List<Parameter> parameters;
private Boolean enableWrapperStyle;
private Boolean enableAsyncMapping;
// private Boolean enableAdditionalHeaderMapping;
private Boolean enableMimeContentMapping;
private Boolean isProvider;
private Set<Element> jaxbBindings;
// portType className
private CustomName className;
//portType WSDLOperation
private CustomName methodName;
}

View File

@@ -0,0 +1,194 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.jaxws;
import com.sun.tools.internal.ws.wsdl.parser.Constants;
import javax.xml.namespace.QName;
/**
* @author Vivek Pandey
*
*/
public interface JAXWSBindingsConstants {
static final String NS_JAXWS_BINDINGS = "http://java.sun.com/xml/ns/jaxws";
static final String NS_JAXB_BINDINGS = "http://java.sun.com/xml/ns/jaxb";
static final String NS_XJC_BINDINGS = "http://java.sun.com/xml/ns/jaxb/xjc";
/**
* jaxws:bindings schema component
*
* <jaxws:bindings wsdlLocation="xs:anyURI"? node="xs:string"?
* version="string"?> binding declarations...
* </jaxws:bindings>
*
* wsdlLocation="xs:anyURI"? node="xs:string"? version="string"?> binding
* declarations... </jaxws:bindings>
*
* <code>@wsdlLocation</code> A URI pointing to a WSDL file establishing the scope of the
* contents of this binding declaration. It MUST NOT be
* present if the binding declaration is used as an extension
* inside a WSDL document or if there is an ancestor binding
* declaration that contains this attribute.
*
* <code>@node</code> An XPath expression pointing to the element in the WSDL file in
* scope that this binding declaration is attached to.
*
* <code>@version</code> A version identifier. It MAY only appear on jaxws:bindings
* elements that don't have any jaxws:bindings ancestors (i.e. on
* outermost binding declarations).
*/
static final QName JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS, "bindings");
static final String WSDL_LOCATION_ATTR = "wsdlLocation";
static final String NODE_ATTR = "node";
static final String VERSION_ATTR = "version";
/*
* <jaxws:package name="xs:string">? <jaxws:javadoc>xs:string
* </jaxws:javadoc> </jaxws:package>
*/
static final QName PACKAGE = new QName(NS_JAXWS_BINDINGS, "package");
static final String NAME_ATTR = "name";
static final QName JAVADOC = new QName(NS_JAXWS_BINDINGS, "javadoc");
/*
* <jaxws:enableWrapperStyle>xs:boolean </jaxws:enableWrapperStyle>?
*/
static final QName ENABLE_WRAPPER_STYLE = new QName(NS_JAXWS_BINDINGS, "enableWrapperStyle");
/*
* <jaxws:enableAsynchronousMapping>xs:boolean
* </jaxws:enableAsynchronousMapping>?
*/
static final QName ENABLE_ASYNC_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAsyncMapping");
/*
* <jaxws:enableAdditionalSOAPHeaderMapping>xs:boolean</jaxws:enableAdditionalSOAPHeaderMapping>?
*/
static final QName ENABLE_ADDITIONAL_SOAPHEADER_MAPPING = new QName(NS_JAXWS_BINDINGS, "enableAdditionalSOAPHeaderMapping");
/*
* <jaxws:enableMIMEContent>xs:boolean</jaxws:enableMIMEContent>?
*/
static final QName ENABLE_MIME_CONTENT = new QName(NS_JAXWS_BINDINGS, "enableMIMEContent");
/*
* <jaxwsc:provider>xs:boolean</jaxws:provider>?
*/
static final QName PROVIDER = new QName(NS_JAXWS_BINDINGS, "provider");
/*
* PortType
*
* <jaxws:class name="xs:string">?
* <jaxws:javadoc>xs:string</jaxws:javadoc>?
* </jaxws:class>
*
* <jaxws:enableWrapperStyle>
* xs:boolean
* </jaxws:enableWrapperStyle>?
*
* <jaxws:enableAsynchronousMapping>
* xs:boolean
* </jaxws:enableAsynchronousMapping>?
*
*/
static final QName CLASS = new QName(NS_JAXWS_BINDINGS, "class");
/*
* PortType WSDLOperation
*
* <jaxws:method name="xs:string">?
* <jaxws:javadoc>xs:string</jaxws:javadoc>?
* </jaxws:method>
*
* <jaxws:enableWrapperStyle>
* xs:boolean
* </jaxws:enableWrapperStyle>?
*
* <jaxws:enableAsyncMapping>
* xs:boolean
* </jaxws:enableAsyncMapping>?
*
* <jaxws:parameter part="xs:string"
* childElementName="xs:QName"?
* name="xs:string"/>*
*/
static final QName METHOD = new QName(NS_JAXWS_BINDINGS, "method");
static final QName PARAMETER = new QName(NS_JAXWS_BINDINGS, "parameter");
static final String PART_ATTR = "part";
static final String ELEMENT_ATTR = "childElementName";
/*
* Binding
*
* <jaxws:enableAdditionalSOAPHeaderMapping>
* xs:boolean
* </jaxws:enableAdditionalSOAPHeaderMapping>?
*
* <jaxws:enableMIMEContent>
* xs:boolean
* </jaxws:enableMIMEContent>?
*/
/*
* WSDLBoundOperation
*
* <jaxws:enableAdditionalSOAPHeaderMapping>
* xs:boolean
* </jaxws:enableAdditionalSOAPHeaderMapping>?
*
* <jaxws:enableMIMEContent>
* xs:boolean
* </jaxws:enableMIMEContent>?
*
* <jaxws:parameter part="xs:string"
* element="xs:QName"?
* name="xs:string"/>*
*
* <jaxws:exception part="xs:string">*
* <jaxws:class name="xs:string">?
* <jaxws:javadoc>xs:string</jaxws:javadoc>?
* </jaxws:class>
* </jaxws:exception>
*/
static final QName EXCEPTION = new QName(NS_JAXWS_BINDINGS, "exception");
/*
* jaxb:bindgs QName
*/
static final QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS, "bindings");
static final String JAXB_BINDING_VERSION = "2.0";
static final QName XSD_APPINFO = new QName(Constants.NS_XSD, "appinfo");
static final QName XSD_ANNOTATION = new QName(Constants.NS_XSD, "annotation");
}

View File

@@ -0,0 +1,103 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.jaxws;
import javax.xml.namespace.QName;
/**
* @author Vivek Pandey
*
* class representing jaxws:parameter
*
*/
public class Parameter {
private String part;
private QName element;
private String name;
private String messageName;
/**
* @param part
* @param element
* @param name
*/
public Parameter(String msgName, String part, QName element, String name) {
this.part = part;
this.element = element;
this.name = name;
this.messageName = msgName;
}
public String getMessageName() {
return messageName;
}
public void setMessageName(String messageName) {
this.messageName = messageName;
}
/**
* @return Returns the element.
*/
public QName getElement() {
return element;
}
/**
* @param element The element to set.
*/
public void setElement(QName element) {
this.element = element;
}
/**
* @return Returns the name.
*/
public String getName() {
return name;
}
/**
* @param name The name to set.
*/
public void setName(String name) {
this.name = name;
}
/**
* @return Returns the part.
*/
public String getPart() {
return part;
}
/**
* @param part The part to set.
*/
public void setPart(String part) {
this.part = part;
}
}

View File

@@ -0,0 +1,45 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.mime;
import javax.xml.namespace.QName;
/**
* Interface defining MIME-extension-related constants.
*
* @author WS Development Team
*/
public interface MIMEConstants {
// namespace URIs
static final String NS_WSDL_MIME = "http://schemas.xmlsoap.org/wsdl/mime/";
// QNames
static final QName QNAME_CONTENT = new QName(NS_WSDL_MIME, "content");
static final QName QNAME_MULTIPART_RELATED = new QName(NS_WSDL_MIME, "multipartRelated");
static final QName QNAME_PART = new QName(NS_WSDL_MIME, "part");
static final QName QNAME_MIME_XML = new QName(NS_WSDL_MIME, "mimeXml");
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.mime;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A MIME content extension.
*
* @author WS Development Team
*/
public class MIMEContent extends ExtensionImpl {
public MIMEContent(Locator locator) {
super(locator);
}
public QName getElementName() {
return MIMEConstants.QNAME_CONTENT;
}
public String getPart() {
return _part;
}
public void setPart(String s) {
_part = s;
}
public String getType() {
return _type;
}
public void setType(String s) {
_type = s;
}
public void validateThis() {
}
private String _part;
private String _type;
}

View File

@@ -0,0 +1,80 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.mime;
import com.sun.tools.internal.ws.wsdl.framework.Entity;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionVisitor;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* A MIME multipartRelated extension.
*
* @author WS Development Team
*/
public class MIMEMultipartRelated extends ExtensionImpl {
public MIMEMultipartRelated(Locator locator) {
super(locator);
_parts = new ArrayList<MIMEPart>();
}
public QName getElementName() {
return MIMEConstants.QNAME_MULTIPART_RELATED;
}
public void add(MIMEPart part) {
_parts.add(part);
}
public Iterable<MIMEPart> getParts() {
return _parts;
}
public void withAllSubEntitiesDo(EntityAction action) {
super.withAllSubEntitiesDo(action);
for (Iterator iter = _parts.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
}
public void accept(ExtensionVisitor visitor) throws Exception {
visitor.preVisit(this);
visitor.postVisit(this);
}
public void validateThis() {
}
private List<MIMEPart> _parts;
}

View File

@@ -0,0 +1,90 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.mime;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtensible;
import com.sun.tools.internal.ws.api.wsdl.TWSDLExtension;
import com.sun.tools.internal.ws.wsdl.framework.EntityAction;
import com.sun.tools.internal.ws.wsdl.framework.ExtensibilityHelper;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A MIME part extension.
*
* @author WS Development Team
*/
public class MIMEPart extends ExtensionImpl implements TWSDLExtensible {
public MIMEPart(Locator locator) {
super(locator);
_helper = new ExtensibilityHelper();
}
public QName getElementName() {
return MIMEConstants.QNAME_PART;
}
public String getName() {
return _name;
}
public void setName(String s) {
_name = s;
}
public String getNameValue() {
return getName();
}
public String getNamespaceURI() {
return getParent().getNamespaceURI();
}
public QName getWSDLElementName() {
return getElementName();
}
public void addExtension(TWSDLExtension e) {
_helper.addExtension(e);
}
public Iterable<TWSDLExtension> extensions() {
return _helper.extensions();
}
public void withAllSubEntitiesDo(EntityAction action) {
_helper.withAllSubEntitiesDo(action);
}
public void validateThis() {
}
private String _name;
private ExtensibilityHelper _helper;
}

View File

@@ -0,0 +1,60 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.mime;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A MIME mimeXml extension.
*
* @author WS Development Team
*/
public class MIMEXml extends ExtensionImpl {
public MIMEXml(Locator locator) {
super(locator);
}
public QName getElementName() {
return MIMEConstants.QNAME_MIME_XML;
}
public String getPart() {
return _part;
}
public void setPart(String s) {
_part = s;
}
public void validateThis() {
}
private String _part;
}

View File

@@ -0,0 +1,136 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.schema;
import javax.xml.namespace.QName;
/**
*
* @author WS Development Team
*/
public interface SchemaConstants {
// namespace URIs
static final String NS_XMLNS = "http://www.w3.org/2000/xmlns/";
static final String NS_XSD = "http://www.w3.org/2001/XMLSchema";
static final String NS_XSI = "http://www.w3.org/2001/XMLSchema-instance";
// QNames
static final QName QNAME_ALL = new QName(NS_XSD, "all");
static final QName QNAME_ANNOTATION = new QName(NS_XSD, "annotation");
static final QName QNAME_ANY = new QName(NS_XSD, "any");
static final QName QNAME_ANY_ATTRIBUTE = new QName(NS_XSD, "anyAttribute");
static final QName QNAME_ATTRIBUTE = new QName(NS_XSD, "attribute");
static final QName QNAME_ATTRIBUTE_GROUP = new QName(NS_XSD, "attributeGroup");
static final QName QNAME_CHOICE = new QName(NS_XSD, "choice");
static final QName QNAME_COMPLEX_CONTENT = new QName(NS_XSD, "complexContent");
static final QName QNAME_COMPLEX_TYPE = new QName(NS_XSD, "complexType");
static final QName QNAME_ELEMENT = new QName(NS_XSD, "element");
static final QName QNAME_ENUMERATION = new QName(NS_XSD, "enumeration");
static final QName QNAME_EXTENSION = new QName(NS_XSD, "extension");
static final QName QNAME_FIELD = new QName(NS_XSD, "field");
static final QName QNAME_FRACTION_DIGITS = new QName(NS_XSD, "fractionDigits");
static final QName QNAME_GROUP = new QName(NS_XSD, "group");
static final QName QNAME_IMPORT = new QName(NS_XSD, "import");
static final QName QNAME_INCLUDE = new QName(NS_XSD, "include");
static final QName QNAME_KEY = new QName(NS_XSD, "key");
static final QName QNAME_KEYREF = new QName(NS_XSD, "keyref");
static final QName QNAME_LENGTH = new QName(NS_XSD, "length");
static final QName QNAME_LIST = new QName(NS_XSD, "list");
static final QName QNAME_MAX_EXCLUSIVE = new QName(NS_XSD, "maxExclusive");
static final QName QNAME_MAX_INCLUSIVE = new QName(NS_XSD, "maxInclusive");
static final QName QNAME_MAX_LENGTH = new QName(NS_XSD, "maxLength");
static final QName QNAME_MIN_EXCLUSIVE = new QName(NS_XSD, "minExclusive");
static final QName QNAME_MIN_INCLUSIVE = new QName(NS_XSD, "minInclusive");
static final QName QNAME_MIN_LENGTH = new QName(NS_XSD, "minLength");
static final QName QNAME_NOTATION = new QName(NS_XSD, "notation");
static final QName QNAME_RESTRICTION = new QName(NS_XSD, "restriction");
static final QName QNAME_PATTERN = new QName(NS_XSD, "pattern");
static final QName QNAME_PRECISION = new QName(NS_XSD, "precision");
static final QName QNAME_REDEFINE = new QName(NS_XSD, "redefine");
static final QName QNAME_SCALE = new QName(NS_XSD, "scale");
static final QName QNAME_SCHEMA = new QName(NS_XSD, "schema");
static final QName QNAME_SELECTOR = new QName(NS_XSD, "selector");
static final QName QNAME_SEQUENCE = new QName(NS_XSD, "sequence");
static final QName QNAME_SIMPLE_CONTENT =
new QName(NS_XSD, "simpleContent");
static final QName QNAME_SIMPLE_TYPE = new QName(NS_XSD, "simpleType");
static final QName QNAME_TOTAL_DIGITS = new QName(NS_XSD, "totalDigits");
static final QName QNAME_UNIQUE = new QName(NS_XSD, "unique");
static final QName QNAME_UNION = new QName(NS_XSD, "union");
static final QName QNAME_WHITE_SPACE = new QName(NS_XSD, "whiteSpace");
// QNames for built-in XSD types
static final QName QNAME_TYPE_STRING = new QName(NS_XSD, "string");
static final QName QNAME_TYPE_NORMALIZED_STRING = new QName(NS_XSD, "normalizedString");
static final QName QNAME_TYPE_TOKEN = new QName(NS_XSD, "token");
static final QName QNAME_TYPE_BYTE = new QName(NS_XSD, "byte");
static final QName QNAME_TYPE_UNSIGNED_BYTE = new QName(NS_XSD, "unsignedByte");
static final QName QNAME_TYPE_BASE64_BINARY = new QName(NS_XSD, "base64Binary");
static final QName QNAME_TYPE_HEX_BINARY = new QName(NS_XSD, "hexBinary");
static final QName QNAME_TYPE_INTEGER = new QName(NS_XSD, "integer");
static final QName QNAME_TYPE_POSITIVE_INTEGER = new QName(NS_XSD, "positiveInteger");
static final QName QNAME_TYPE_NEGATIVE_INTEGER = new QName(NS_XSD, "negativeInteger");
static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER = new QName(NS_XSD, "nonNegativeInteger");
static final QName QNAME_TYPE_NON_POSITIVE_INTEGER = new QName(NS_XSD, "nonPositiveInteger");
static final QName QNAME_TYPE_INT = new QName(NS_XSD, "int");
static final QName QNAME_TYPE_UNSIGNED_INT = new QName(NS_XSD, "unsignedInt");
static final QName QNAME_TYPE_LONG = new QName(NS_XSD, "long");
static final QName QNAME_TYPE_UNSIGNED_LONG = new QName(NS_XSD, "unsignedLong");
static final QName QNAME_TYPE_SHORT = new QName(NS_XSD, "short");
static final QName QNAME_TYPE_UNSIGNED_SHORT = new QName(NS_XSD, "unsignedShort");
static final QName QNAME_TYPE_DECIMAL = new QName(NS_XSD, "decimal");
static final QName QNAME_TYPE_FLOAT = new QName(NS_XSD, "float");
static final QName QNAME_TYPE_DOUBLE = new QName(NS_XSD, "double");
static final QName QNAME_TYPE_BOOLEAN = new QName(NS_XSD, "boolean");
static final QName QNAME_TYPE_TIME = new QName(NS_XSD, "time");
static final QName QNAME_TYPE_DATE_TIME = new QName(NS_XSD, "dateTime");
static final QName QNAME_TYPE_DURATION = new QName(NS_XSD, "duration");
static final QName QNAME_TYPE_DATE = new QName(NS_XSD, "date");
static final QName QNAME_TYPE_G_MONTH = new QName(NS_XSD, "gMonth");
static final QName QNAME_TYPE_G_YEAR = new QName(NS_XSD, "gYear");
static final QName QNAME_TYPE_G_YEAR_MONTH = new QName(NS_XSD, "gYearMonth");
static final QName QNAME_TYPE_G_DAY = new QName(NS_XSD, "gDay");
static final QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_XSD, "gMonthDay");
static final QName QNAME_TYPE_NAME = new QName(NS_XSD, "Name");
static final QName QNAME_TYPE_QNAME = new QName(NS_XSD, "QName");
static final QName QNAME_TYPE_NCNAME = new QName(NS_XSD, "NCName");
static final QName QNAME_TYPE_ANY_URI = new QName(NS_XSD, "anyURI");
static final QName QNAME_TYPE_ID = new QName(NS_XSD, "ID");
static final QName QNAME_TYPE_IDREF = new QName(NS_XSD, "IDREF");
static final QName QNAME_TYPE_IDREFS = new QName(NS_XSD, "IDREFS");
static final QName QNAME_TYPE_ENTITY = new QName(NS_XSD, "ENTITY");
static final QName QNAME_TYPE_ENTITIES = new QName(NS_XSD, "ENTITIES");
static final QName QNAME_TYPE_NOTATION = new QName(NS_XSD, "NOTATION");
static final QName QNAME_TYPE_NMTOKEN = new QName(NS_XSD, "NMTOKEN");
static final QName QNAME_TYPE_NMTOKENS = new QName(NS_XSD, "NMTOKENS");
static final QName QNAME_TYPE_LANGUAGE = new QName(NS_XSD, "language");
// QNames for special types
static final QName QNAME_TYPE_URTYPE = new QName(NS_XSD, "anyType");
static final QName QNAME_TYPE_SIMPLE_URTYPE = new QName(NS_XSD, "anySimpleType");
}

View File

@@ -0,0 +1,48 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.schema;
import com.sun.tools.internal.ws.wsdl.framework.Kind;
/**
*
* @author WS Development Team
*/
public class SchemaKinds {
public static final Kind XSD_ATTRIBUTE = new Kind("xsd:attribute");
public static final Kind XSD_ATTRIBUTE_GROUP =
new Kind("xsd:attributeGroup");
public static final Kind XSD_CONSTRAINT = new Kind("xsd:constraint");
public static final Kind XSD_ELEMENT = new Kind("xsd:element");
public static final Kind XSD_GROUP = new Kind("xsd:group");
public static final Kind XSD_IDENTITY_CONSTRAINT =
new Kind("xsd:identityConstraint");
public static final Kind XSD_NOTATION = new Kind("xsd:notation");
public static final Kind XSD_TYPE = new Kind("xsd:type");
private SchemaKinds() {
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
public class SOAP12Binding extends SOAPBinding{
public SOAP12Binding(Locator locator) {
super(locator);
}
@Override public QName getElementName() {
return SOAP12Constants.QNAME_BINDING;
}
}

View File

@@ -0,0 +1,156 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import javax.xml.namespace.QName;
/**
* Interface defining SOAP1.2-related constants.
*
* @author WS Development Team
*/
public interface SOAP12Constants {
// namespace URIs
static final String NS_WSDL_SOAP = "http://schemas.xmlsoap.org/wsdl/soap12/";
static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
// other URIs
static final String URI_SOAP_TRANSPORT_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
// QNames
static final QName QNAME_ADDRESS = new QName(NS_WSDL_SOAP, "address");
static final QName QNAME_BINDING = new QName(NS_WSDL_SOAP, "binding");
static final QName QNAME_BODY = new QName(NS_WSDL_SOAP, "body");
static final QName QNAME_FAULT = new QName(NS_WSDL_SOAP, "fault");
static final QName QNAME_HEADER = new QName(NS_WSDL_SOAP, "header");
static final QName QNAME_HEADERFAULT = new QName(NS_WSDL_SOAP, "headerfault");
static final QName QNAME_OPERATION = new QName(NS_WSDL_SOAP, "operation");
// SOAP encoding QNames
static final QName QNAME_TYPE_ARRAY = new QName(NS_SOAP_ENCODING, "Array");
static final QName QNAME_ATTR_GROUP_COMMON_ATTRIBUTES = new QName(NS_SOAP_ENCODING, "commonAttributes");
static final QName QNAME_ATTR_ARRAY_TYPE = new QName(NS_SOAP_ENCODING, "arrayType");
static final QName QNAME_ATTR_ITEM_TYPE = new QName(NS_SOAP_ENCODING, "itemType");
static final QName QNAME_ATTR_ARRAY_SIZE = new QName(NS_SOAP_ENCODING, "arraySize");
static final QName QNAME_ATTR_OFFSET = new QName(NS_SOAP_ENCODING, "offset");
static final QName QNAME_ATTR_POSITION = new QName(NS_SOAP_ENCODING, "position");
static final QName QNAME_TYPE_BASE64 = new QName(NS_SOAP_ENCODING, "base64");
static final QName QNAME_ELEMENT_STRING = new QName(NS_SOAP_ENCODING, "string");
static final QName QNAME_ELEMENT_NORMALIZED_STRING = new QName(NS_SOAP_ENCODING, "normalizedString");
static final QName QNAME_ELEMENT_TOKEN = new QName(NS_SOAP_ENCODING, "token");
static final QName QNAME_ELEMENT_BYTE = new QName(NS_SOAP_ENCODING, "byte");
static final QName QNAME_ELEMENT_UNSIGNED_BYTE = new QName(NS_SOAP_ENCODING, "unsignedByte");
static final QName QNAME_ELEMENT_BASE64_BINARY = new QName(NS_SOAP_ENCODING, "base64Binary");
static final QName QNAME_ELEMENT_HEX_BINARY = new QName(NS_SOAP_ENCODING, "hexBinary");
static final QName QNAME_ELEMENT_INTEGER = new QName(NS_SOAP_ENCODING, "integer");
static final QName QNAME_ELEMENT_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "positiveInteger");
static final QName QNAME_ELEMENT_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "negativeInteger");
static final QName QNAME_ELEMENT_NON_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
static final QName QNAME_ELEMENT_NON_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
static final QName QNAME_ELEMENT_INT = new QName(NS_SOAP_ENCODING, "int");
static final QName QNAME_ELEMENT_UNSIGNED_INT = new QName(NS_SOAP_ENCODING, "unsignedInt");
static final QName QNAME_ELEMENT_LONG = new QName(NS_SOAP_ENCODING, "long");
static final QName QNAME_ELEMENT_UNSIGNED_LONG = new QName(NS_SOAP_ENCODING, "unsignedLong");
static final QName QNAME_ELEMENT_SHORT = new QName(NS_SOAP_ENCODING, "short");
static final QName QNAME_ELEMENT_UNSIGNED_SHORT = new QName(NS_SOAP_ENCODING, "unsignedShort");
static final QName QNAME_ELEMENT_DECIMAL = new QName(NS_SOAP_ENCODING, "decimal");
static final QName QNAME_ELEMENT_FLOAT = new QName(NS_SOAP_ENCODING, "float");
static final QName QNAME_ELEMENT_DOUBLE = new QName(NS_SOAP_ENCODING, "double");
static final QName QNAME_ELEMENT_BOOLEAN = new QName(NS_SOAP_ENCODING, "boolean");
static final QName QNAME_ELEMENT_TIME = new QName(NS_SOAP_ENCODING, "time");
static final QName QNAME_ELEMENT_DATE_TIME = new QName(NS_SOAP_ENCODING, "dateTime");
static final QName QNAME_ELEMENT_DURATION = new QName(NS_SOAP_ENCODING, "duration");
static final QName QNAME_ELEMENT_DATE = new QName(NS_SOAP_ENCODING, "date");
static final QName QNAME_ELEMENT_G_MONTH = new QName(NS_SOAP_ENCODING, "gMonth");
static final QName QNAME_ELEMENT_G_YEAR = new QName(NS_SOAP_ENCODING, "gYear");
static final QName QNAME_ELEMENT_G_YEAR_MONTH = new QName(NS_SOAP_ENCODING, "gYearMonth");
static final QName QNAME_ELEMENT_G_DAY = new QName(NS_SOAP_ENCODING, "gDay");
static final QName QNAME_ELEMENT_G_MONTH_DAY = new QName(NS_SOAP_ENCODING, "gMonthDay");
static final QName QNAME_ELEMENT_NAME = new QName(NS_SOAP_ENCODING, "Name");
static final QName QNAME_ELEMENT_QNAME = new QName(NS_SOAP_ENCODING, "QName");
static final QName QNAME_ELEMENT_NCNAME = new QName(NS_SOAP_ENCODING, "NCName");
static final QName QNAME_ELEMENT_ANY_URI = new QName(NS_SOAP_ENCODING, "anyURI");
static final QName QNAME_ELEMENT_ID = new QName(NS_SOAP_ENCODING, "ID");
static final QName QNAME_ELEMENT_IDREF = new QName(NS_SOAP_ENCODING, "IDREF");
static final QName QNAME_ELEMENT_IDREFS = new QName(NS_SOAP_ENCODING, "IDREFS");
static final QName QNAME_ELEMENT_ENTITY = new QName(NS_SOAP_ENCODING, "ENTITY");
static final QName QNAME_ELEMENT_ENTITIES = new QName(NS_SOAP_ENCODING, "ENTITIES");
static final QName QNAME_ELEMENT_NOTATION = new QName(NS_SOAP_ENCODING, "NOTATION");
static final QName QNAME_ELEMENT_NMTOKEN = new QName(NS_SOAP_ENCODING, "NMTOKEN");
static final QName QNAME_ELEMENT_NMTOKENS = new QName(NS_SOAP_ENCODING, "NMTOKENS");
static final QName QNAME_TYPE_STRING = new QName(NS_SOAP_ENCODING, "string");
static final QName QNAME_TYPE_NORMALIZED_STRING = new QName(NS_SOAP_ENCODING, "normalizedString");
static final QName QNAME_TYPE_TOKEN = new QName(NS_SOAP_ENCODING, "token");
static final QName QNAME_TYPE_BYTE = new QName(NS_SOAP_ENCODING, "byte");
static final QName QNAME_TYPE_UNSIGNED_BYTE = new QName(NS_SOAP_ENCODING, "unsignedByte");
static final QName QNAME_TYPE_BASE64_BINARY = new QName(NS_SOAP_ENCODING, "base64Binary");
static final QName QNAME_TYPE_HEX_BINARY = new QName(NS_SOAP_ENCODING, "hexBinary");
static final QName QNAME_TYPE_INTEGER = new QName(NS_SOAP_ENCODING, "integer");
static final QName QNAME_TYPE_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "positiveInteger");
static final QName QNAME_TYPE_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "negativeInteger");
static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
static final QName QNAME_TYPE_NON_POSITIVE_INTEGER = new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
static final QName QNAME_TYPE_INT = new QName(NS_SOAP_ENCODING, "int");
static final QName QNAME_TYPE_UNSIGNED_INT = new QName(NS_SOAP_ENCODING, "unsignedInt");
static final QName QNAME_TYPE_LONG = new QName(NS_SOAP_ENCODING, "long");
static final QName QNAME_TYPE_UNSIGNED_LONG = new QName(NS_SOAP_ENCODING, "unsignedLong");
static final QName QNAME_TYPE_SHORT = new QName(NS_SOAP_ENCODING, "short");
static final QName QNAME_TYPE_UNSIGNED_SHORT = new QName(NS_SOAP_ENCODING, "unsignedShort");
static final QName QNAME_TYPE_DECIMAL = new QName(NS_SOAP_ENCODING, "decimal");
static final QName QNAME_TYPE_FLOAT = new QName(NS_SOAP_ENCODING, "float");
static final QName QNAME_TYPE_DOUBLE = new QName(NS_SOAP_ENCODING, "double");
static final QName QNAME_TYPE_BOOLEAN = new QName(NS_SOAP_ENCODING, "boolean");
static final QName QNAME_TYPE_TIME = new QName(NS_SOAP_ENCODING, "time");
static final QName QNAME_TYPE_DATE_TIME = new QName(NS_SOAP_ENCODING, "dateTime");
static final QName QNAME_TYPE_DURATION = new QName(NS_SOAP_ENCODING, "duration");
static final QName QNAME_TYPE_DATE = new QName(NS_SOAP_ENCODING, "date");
static final QName QNAME_TYPE_G_MONTH = new QName(NS_SOAP_ENCODING, "gMonth");
static final QName QNAME_TYPE_G_YEAR = new QName(NS_SOAP_ENCODING, "gYear");
static final QName QNAME_TYPE_G_YEAR_MONTH = new QName(NS_SOAP_ENCODING, "gYearMonth");
static final QName QNAME_TYPE_G_DAY = new QName(NS_SOAP_ENCODING, "gDay");
static final QName QNAME_TYPE_G_MONTH_DAY = new QName(NS_SOAP_ENCODING, "gMonthDay");
static final QName QNAME_TYPE_NAME = new QName(NS_SOAP_ENCODING, "Name");
static final QName QNAME_TYPE_QNAME = new QName(NS_SOAP_ENCODING, "QName");
static final QName QNAME_TYPE_NCNAME = new QName(NS_SOAP_ENCODING, "NCName");
static final QName QNAME_TYPE_ANY_URI = new QName(NS_SOAP_ENCODING, "anyURI");
static final QName QNAME_TYPE_ID = new QName(NS_SOAP_ENCODING, "ID");
static final QName QNAME_TYPE_IDREF = new QName(NS_SOAP_ENCODING, "IDREF");
static final QName QNAME_TYPE_IDREFS = new QName(NS_SOAP_ENCODING, "IDREFS");
static final QName QNAME_TYPE_ENTITY = new QName(NS_SOAP_ENCODING, "ENTITY");
static final QName QNAME_TYPE_ENTITIES = new QName(NS_SOAP_ENCODING, "ENTITIES");
static final QName QNAME_TYPE_NOTATION = new QName(NS_SOAP_ENCODING, "NOTATION");
static final QName QNAME_TYPE_NMTOKEN = new QName(NS_SOAP_ENCODING, "NMTOKEN");
static final QName QNAME_TYPE_NMTOKENS = new QName(NS_SOAP_ENCODING, "NMTOKENS");
static final QName QNAME_TYPE_LANGUAGE = new QName(NS_SOAP_ENCODING, "LANGUAGE");
// SOAP attributes with non-colonized names
static final QName QNAME_ATTR_ID = new QName("", "id");
static final QName QNAME_ATTR_HREF = new QName("", "ref");
}

View File

@@ -0,0 +1,63 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A SOAP address extension.
*
* @author WS Development Team
*/
public class SOAPAddress extends ExtensionImpl {
public SOAPAddress(Locator locator) {
super(locator);
}
public QName getElementName() {
return SOAPConstants.QNAME_ADDRESS;
}
public String getLocation() {
return _location;
}
public void setLocation(String s) {
_location = s;
}
public void validateThis() {
if (_location == null) {
failValidation("validation.missingRequiredAttribute", "location");
}
}
private String _location;
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A SOAP binding extension.
*
* @author WS Development Team
*/
public class SOAPBinding extends ExtensionImpl {
public SOAPBinding(Locator locator) {
super(locator);
_style = SOAPStyle.DOCUMENT;
}
public QName getElementName() {
return SOAPConstants.QNAME_BINDING;
}
public String getTransport() {
return _transport;
}
public void setTransport(String s) {
_transport = s;
}
public SOAPStyle getStyle() {
return _style;
}
public void setStyle(SOAPStyle s) {
_style = s;
}
public boolean isDocument() {
return _style == SOAPStyle.DOCUMENT;
}
public boolean isRPC() {
return _style == SOAPStyle.RPC;
}
public void validateThis() {
}
private String _transport;
private SOAPStyle _style;
}

View File

@@ -0,0 +1,99 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A SOAP body extension.
*
* @author WS Development Team
*/
public class SOAPBody extends ExtensionImpl {
public SOAPBody(Locator locator) {
super(locator);
}
public QName getElementName() {
return SOAPConstants.QNAME_BODY;
}
public String getNamespace() {
return _namespace;
}
public void setNamespace(String s) {
_namespace = s;
}
public SOAPUse getUse() {
return _use;
}
public void setUse(SOAPUse u) {
_use = u;
}
public boolean isEncoded() {
return _use == SOAPUse.ENCODED;
}
public boolean isLiteral() {
return _use == SOAPUse.LITERAL;
}
public String getEncodingStyle() {
return _encodingStyle;
}
public void setEncodingStyle(String s) {
_encodingStyle = s;
}
public String getParts() {
return _parts;
}
public void setParts(String s) {
_parts = s;
}
public void validateThis() {
if(_use == SOAPUse.ENCODED) {
throw new ValidationException("validation.unsupportedUse.encoded", getLocator().getLineNumber(),getLocator().getSystemId());
}
}
private String _encodingStyle;
private String _namespace;
private String _parts;
private SOAPUse _use=SOAPUse.LITERAL;
}

View File

@@ -0,0 +1,259 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.xml.internal.ws.encoding.soap.streaming.SOAPNamespaceConstants;
import javax.xml.namespace.QName;
/**
* Interface defining SOAP-related constants.
*
* @author WS Development Team
*/
public interface SOAPConstants {
// namespace URIs
public static final String URI_ENVELOPE = SOAPNamespaceConstants.ENVELOPE;
public static final String NS_WSDL_SOAP =
"http://schemas.xmlsoap.org/wsdl/soap/";
public static final String NS_SOAP_ENCODING = "http://schemas.xmlsoap.org/soap/encoding/";
// other URIs
public final String URI_SOAP_TRANSPORT_HTTP =
"http://schemas.xmlsoap.org/soap/http";
// QNames
public static final QName QNAME_ADDRESS =
new QName(NS_WSDL_SOAP, "address");
public static final QName QNAME_BINDING =
new QName(NS_WSDL_SOAP, "binding");
public static final QName QNAME_BODY = new QName(NS_WSDL_SOAP, "body");
public static final QName QNAME_FAULT = new QName(NS_WSDL_SOAP, "fault");
public static final QName QNAME_HEADER = new QName(NS_WSDL_SOAP, "header");
public static final QName QNAME_HEADERFAULT =
new QName(NS_WSDL_SOAP, "headerfault");
public static final QName QNAME_OPERATION =
new QName(NS_WSDL_SOAP, "operation");
public static final QName QNAME_MUSTUNDERSTAND =
new QName(URI_ENVELOPE, "mustUnderstand");
// SOAP encoding QNames
public static final QName QNAME_TYPE_ARRAY =
new QName(NS_SOAP_ENCODING, "Array");
public static final QName QNAME_ATTR_GROUP_COMMON_ATTRIBUTES =
new QName(NS_SOAP_ENCODING, "commonAttributes");
public static final QName QNAME_ATTR_ARRAY_TYPE =
new QName(NS_SOAP_ENCODING, "arrayType");
public static final QName QNAME_ATTR_OFFSET =
new QName(NS_SOAP_ENCODING, "offset");
public static final QName QNAME_ATTR_POSITION =
new QName(NS_SOAP_ENCODING, "position");
public static final QName QNAME_TYPE_BASE64 =
new QName(NS_SOAP_ENCODING, "base64");
public static final QName QNAME_ELEMENT_STRING =
new QName(NS_SOAP_ENCODING, "string");
public static final QName QNAME_ELEMENT_NORMALIZED_STRING =
new QName(NS_SOAP_ENCODING, "normalizedString");
public static final QName QNAME_ELEMENT_TOKEN =
new QName(NS_SOAP_ENCODING, "token");
public static final QName QNAME_ELEMENT_BYTE =
new QName(NS_SOAP_ENCODING, "byte");
public static final QName QNAME_ELEMENT_UNSIGNED_BYTE =
new QName(NS_SOAP_ENCODING, "unsignedByte");
public static final QName QNAME_ELEMENT_BASE64_BINARY =
new QName(NS_SOAP_ENCODING, "base64Binary");
public static final QName QNAME_ELEMENT_HEX_BINARY =
new QName(NS_SOAP_ENCODING, "hexBinary");
public static final QName QNAME_ELEMENT_INTEGER =
new QName(NS_SOAP_ENCODING, "integer");
public static final QName QNAME_ELEMENT_POSITIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "positiveInteger");
public static final QName QNAME_ELEMENT_NEGATIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "negativeInteger");
public static final QName QNAME_ELEMENT_NON_NEGATIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
public static final QName QNAME_ELEMENT_NON_POSITIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
public static final QName QNAME_ELEMENT_INT =
new QName(NS_SOAP_ENCODING, "int");
public static final QName QNAME_ELEMENT_UNSIGNED_INT =
new QName(NS_SOAP_ENCODING, "unsignedInt");
public static final QName QNAME_ELEMENT_LONG =
new QName(NS_SOAP_ENCODING, "long");
public static final QName QNAME_ELEMENT_UNSIGNED_LONG =
new QName(NS_SOAP_ENCODING, "unsignedLong");
public static final QName QNAME_ELEMENT_SHORT =
new QName(NS_SOAP_ENCODING, "short");
public static final QName QNAME_ELEMENT_UNSIGNED_SHORT =
new QName(NS_SOAP_ENCODING, "unsignedShort");
public static final QName QNAME_ELEMENT_DECIMAL =
new QName(NS_SOAP_ENCODING, "decimal");
public static final QName QNAME_ELEMENT_FLOAT =
new QName(NS_SOAP_ENCODING, "float");
public static final QName QNAME_ELEMENT_DOUBLE =
new QName(NS_SOAP_ENCODING, "double");
public static final QName QNAME_ELEMENT_BOOLEAN =
new QName(NS_SOAP_ENCODING, "boolean");
public static final QName QNAME_ELEMENT_TIME =
new QName(NS_SOAP_ENCODING, "time");
public static final QName QNAME_ELEMENT_DATE_TIME =
new QName(NS_SOAP_ENCODING, "dateTime");
public static final QName QNAME_ELEMENT_DURATION =
new QName(NS_SOAP_ENCODING, "duration");
public static final QName QNAME_ELEMENT_DATE =
new QName(NS_SOAP_ENCODING, "date");
public static final QName QNAME_ELEMENT_G_MONTH =
new QName(NS_SOAP_ENCODING, "gMonth");
public static final QName QNAME_ELEMENT_G_YEAR =
new QName(NS_SOAP_ENCODING, "gYear");
public static final QName QNAME_ELEMENT_G_YEAR_MONTH =
new QName(NS_SOAP_ENCODING, "gYearMonth");
public static final QName QNAME_ELEMENT_G_DAY =
new QName(NS_SOAP_ENCODING, "gDay");
public static final QName QNAME_ELEMENT_G_MONTH_DAY =
new QName(NS_SOAP_ENCODING, "gMonthDay");
public static final QName QNAME_ELEMENT_NAME =
new QName(NS_SOAP_ENCODING, "Name");
public static final QName QNAME_ELEMENT_QNAME =
new QName(NS_SOAP_ENCODING, "QName");
public static final QName QNAME_ELEMENT_NCNAME =
new QName(NS_SOAP_ENCODING, "NCName");
public static final QName QNAME_ELEMENT_ANY_URI =
new QName(NS_SOAP_ENCODING, "anyURI");
public static final QName QNAME_ELEMENT_ID =
new QName(NS_SOAP_ENCODING, "ID");
public static final QName QNAME_ELEMENT_IDREF =
new QName(NS_SOAP_ENCODING, "IDREF");
public static final QName QNAME_ELEMENT_IDREFS =
new QName(NS_SOAP_ENCODING, "IDREFS");
public static final QName QNAME_ELEMENT_ENTITY =
new QName(NS_SOAP_ENCODING, "ENTITY");
public static final QName QNAME_ELEMENT_ENTITIES =
new QName(NS_SOAP_ENCODING, "ENTITIES");
public static final QName QNAME_ELEMENT_NOTATION =
new QName(NS_SOAP_ENCODING, "NOTATION");
public static final QName QNAME_ELEMENT_NMTOKEN =
new QName(NS_SOAP_ENCODING, "NMTOKEN");
public static final QName QNAME_ELEMENT_NMTOKENS =
new QName(NS_SOAP_ENCODING, "NMTOKENS");
public static final QName QNAME_TYPE_STRING =
new QName(NS_SOAP_ENCODING, "string");
public static final QName QNAME_TYPE_NORMALIZED_STRING =
new QName(NS_SOAP_ENCODING, "normalizedString");
public static final QName QNAME_TYPE_TOKEN =
new QName(NS_SOAP_ENCODING, "token");
public static final QName QNAME_TYPE_BYTE =
new QName(NS_SOAP_ENCODING, "byte");
public static final QName QNAME_TYPE_UNSIGNED_BYTE =
new QName(NS_SOAP_ENCODING, "unsignedByte");
public static final QName QNAME_TYPE_BASE64_BINARY =
new QName(NS_SOAP_ENCODING, "base64Binary");
public static final QName QNAME_TYPE_HEX_BINARY =
new QName(NS_SOAP_ENCODING, "hexBinary");
public static final QName QNAME_TYPE_INTEGER =
new QName(NS_SOAP_ENCODING, "integer");
public static final QName QNAME_TYPE_POSITIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "positiveInteger");
public static final QName QNAME_TYPE_NEGATIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "negativeInteger");
public static final QName QNAME_TYPE_NON_NEGATIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "nonNegativeInteger");
public static final QName QNAME_TYPE_NON_POSITIVE_INTEGER =
new QName(NS_SOAP_ENCODING, "nonPositiveInteger");
public static final QName QNAME_TYPE_INT =
new QName(NS_SOAP_ENCODING, "int");
public static final QName QNAME_TYPE_UNSIGNED_INT =
new QName(NS_SOAP_ENCODING, "unsignedInt");
public static final QName QNAME_TYPE_LONG =
new QName(NS_SOAP_ENCODING, "long");
public static final QName QNAME_TYPE_UNSIGNED_LONG =
new QName(NS_SOAP_ENCODING, "unsignedLong");
public static final QName QNAME_TYPE_SHORT =
new QName(NS_SOAP_ENCODING, "short");
public static final QName QNAME_TYPE_UNSIGNED_SHORT =
new QName(NS_SOAP_ENCODING, "unsignedShort");
public static final QName QNAME_TYPE_DECIMAL =
new QName(NS_SOAP_ENCODING, "decimal");
public static final QName QNAME_TYPE_FLOAT =
new QName(NS_SOAP_ENCODING, "float");
public static final QName QNAME_TYPE_DOUBLE =
new QName(NS_SOAP_ENCODING, "double");
public static final QName QNAME_TYPE_BOOLEAN =
new QName(NS_SOAP_ENCODING, "boolean");
public static final QName QNAME_TYPE_TIME =
new QName(NS_SOAP_ENCODING, "time");
public static final QName QNAME_TYPE_DATE_TIME =
new QName(NS_SOAP_ENCODING, "dateTime");
public static final QName QNAME_TYPE_DURATION =
new QName(NS_SOAP_ENCODING, "duration");
public static final QName QNAME_TYPE_DATE =
new QName(NS_SOAP_ENCODING, "date");
public static final QName QNAME_TYPE_G_MONTH =
new QName(NS_SOAP_ENCODING, "gMonth");
public static final QName QNAME_TYPE_G_YEAR =
new QName(NS_SOAP_ENCODING, "gYear");
public static final QName QNAME_TYPE_G_YEAR_MONTH =
new QName(NS_SOAP_ENCODING, "gYearMonth");
public static final QName QNAME_TYPE_G_DAY =
new QName(NS_SOAP_ENCODING, "gDay");
public static final QName QNAME_TYPE_G_MONTH_DAY =
new QName(NS_SOAP_ENCODING, "gMonthDay");
public static final QName QNAME_TYPE_NAME =
new QName(NS_SOAP_ENCODING, "Name");
public static final QName QNAME_TYPE_QNAME =
new QName(NS_SOAP_ENCODING, "QName");
public static final QName QNAME_TYPE_NCNAME =
new QName(NS_SOAP_ENCODING, "NCName");
public static final QName QNAME_TYPE_ANY_URI =
new QName(NS_SOAP_ENCODING, "anyURI");
public static final QName QNAME_TYPE_ID = new QName(NS_SOAP_ENCODING, "ID");
public static final QName QNAME_TYPE_IDREF =
new QName(NS_SOAP_ENCODING, "IDREF");
public static final QName QNAME_TYPE_IDREFS =
new QName(NS_SOAP_ENCODING, "IDREFS");
public static final QName QNAME_TYPE_ENTITY =
new QName(NS_SOAP_ENCODING, "ENTITY");
public static final QName QNAME_TYPE_ENTITIES =
new QName(NS_SOAP_ENCODING, "ENTITIES");
public static final QName QNAME_TYPE_NOTATION =
new QName(NS_SOAP_ENCODING, "NOTATION");
public static final QName QNAME_TYPE_NMTOKEN =
new QName(NS_SOAP_ENCODING, "NMTOKEN");
public static final QName QNAME_TYPE_NMTOKENS =
new QName(NS_SOAP_ENCODING, "NMTOKENS");
public static final QName QNAME_TYPE_LANGUAGE =
new QName(NS_SOAP_ENCODING, "LANGUAGE");
// SOAP attributes with non-colonized names
public static final QName QNAME_ATTR_ID = new QName("", "id");
public static final QName QNAME_ATTR_HREF = new QName("", "href");
}

View File

@@ -0,0 +1,100 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A SOAP fault extension.
*
* @author WS Development Team
*/
public class SOAPFault extends ExtensionImpl {
public SOAPFault(Locator locator) {
super(locator);
_use = SOAPUse.LITERAL;
}
public QName getElementName() {
return SOAPConstants.QNAME_FAULT;
}
public String getName() {
return _name;
}
public void setName(String s) {
_name = s;
}
public String getNamespace() {
return _namespace;
}
public void setNamespace(String s) {
_namespace = s;
}
public SOAPUse getUse() {
return _use;
}
public void setUse(SOAPUse u) {
_use = u;
}
public boolean isEncoded() {
return _use == SOAPUse.ENCODED;
}
public boolean isLiteral() {
return _use == SOAPUse.LITERAL;
}
public String getEncodingStyle() {
return _encodingStyle;
}
public void setEncodingStyle(String s) {
_encodingStyle = s;
}
public void validateThis() {
if(_use == SOAPUse.ENCODED) {
throw new ValidationException("validation.unsupportedUse.encoded", getLocator().getLineNumber(),getLocator().getSystemId());
}
}
private String _name;
private String _encodingStyle;
private String _namespace;
private SOAPUse _use = SOAPUse.LITERAL;
}

View File

@@ -0,0 +1,155 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.*;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* A SOAP header extension.
*
* @author WS Development Team
*/
public class SOAPHeader extends ExtensionImpl {
public SOAPHeader(Locator locator) {
super(locator);
_faults = new ArrayList();
}
public void add(SOAPHeaderFault fault) {
_faults.add(fault);
}
public Iterator faults() {
return _faults.iterator();
}
public QName getElementName() {
return SOAPConstants.QNAME_HEADER;
}
public String getNamespace() {
return _namespace;
}
public void setNamespace(String s) {
_namespace = s;
}
public SOAPUse getUse() {
return _use;
}
public void setUse(SOAPUse u) {
_use = u;
}
public boolean isEncoded() {
return _use == SOAPUse.ENCODED;
}
public boolean isLiteral() {
return _use == SOAPUse.LITERAL;
}
public String getEncodingStyle() {
return _encodingStyle;
}
public void setEncodingStyle(String s) {
_encodingStyle = s;
}
public String getPart() {
return _part;
}
public void setMessage(QName message) {
_message = message;
}
public QName getMessage() {
return _message;
}
public void setPart(String s) {
_part = s;
}
public void withAllSubEntitiesDo(EntityAction action) {
super.withAllSubEntitiesDo(action);
for (Iterator iter = _faults.iterator(); iter.hasNext();) {
action.perform((Entity) iter.next());
}
}
public void withAllQNamesDo(QNameAction action) {
super.withAllQNamesDo(action);
if (_message != null) {
action.perform(_message);
}
}
public void accept(ExtensionVisitor visitor) throws Exception {
visitor.preVisit(this);
for (Iterator iter = _faults.iterator(); iter.hasNext();) {
((SOAPHeaderFault) iter.next()).accept(visitor);
}
visitor.postVisit(this);
}
public void validateThis() {
if (_message == null) {
failValidation("validation.missingRequiredAttribute", "message");
}
if (_part == null) {
failValidation("validation.missingRequiredAttribute", "part");
}
// Fix for bug 4851427
// if (_use == null) {
// failValidation("validation.missingRequiredAttribute", "use");
// }
if(_use == SOAPUse.ENCODED) {
throw new ValidationException("validation.unsupportedUse.encoded", getLocator().getLineNumber(),getLocator().getSystemId());
}
}
private String _encodingStyle;
private String _namespace;
private String _part;
private QName _message;
private SOAPUse _use=SOAPUse.LITERAL;
private List _faults;
}

View File

@@ -0,0 +1,123 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import com.sun.tools.internal.ws.wsdl.framework.QNameAction;
import com.sun.tools.internal.ws.wsdl.framework.ValidationException;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A SOAP header fault extension.
*
* @author WS Development Team
*/
public class SOAPHeaderFault extends ExtensionImpl {
public SOAPHeaderFault(Locator locator) {
super(locator);
}
public QName getElementName() {
return SOAPConstants.QNAME_HEADERFAULT;
}
public String getNamespace() {
return _namespace;
}
public void setNamespace(String s) {
_namespace = s;
}
public SOAPUse getUse() {
return _use;
}
public void setUse(SOAPUse u) {
_use = u;
}
public boolean isEncoded() {
return _use == SOAPUse.ENCODED;
}
public boolean isLiteral() {
return _use == SOAPUse.LITERAL;
}
public String getEncodingStyle() {
return _encodingStyle;
}
public void setEncodingStyle(String s) {
_encodingStyle = s;
}
public String getPart() {
return _part;
}
public void setMessage(QName message) {
_message = message;
}
public QName getMessage() {
return _message;
}
public void setPart(String s) {
_part = s;
}
public void withAllQNamesDo(QNameAction action) {
super.withAllQNamesDo(action);
if (_message != null) {
action.perform(_message);
}
}
public void validateThis() {
if (_message == null) {
failValidation("validation.missingRequiredAttribute", "message");
}
if (_part == null) {
failValidation("validation.missingRequiredAttribute", "part");
}
if(_use == SOAPUse.ENCODED) {
throw new ValidationException("validation.unsupportedUse.encoded", getLocator().getLineNumber(),getLocator().getSystemId());
}
}
private String _encodingStyle;
private String _namespace;
private String _part;
private QName _message;
private SOAPUse _use=SOAPUse.LITERAL;
}

View File

@@ -0,0 +1,78 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
import com.sun.tools.internal.ws.wsdl.framework.ExtensionImpl;
import org.xml.sax.Locator;
import javax.xml.namespace.QName;
/**
* A SOAP operation extension.
*
* @author WS Development Team
*/
public class SOAPOperation extends ExtensionImpl {
public SOAPOperation(Locator locator) {
super(locator);
}
public QName getElementName() {
return SOAPConstants.QNAME_OPERATION;
}
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 boolean isDocument() {
return _style == SOAPStyle.DOCUMENT;
}
public boolean isRPC() {
return _style == SOAPStyle.RPC;
}
public void validateThis() {
}
private String _soapAction;
private SOAPStyle _style;
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
/**
* A SOAP "style" enumeration.
*
* @author WS Development Team
*/
public final class SOAPStyle {
public static final SOAPStyle RPC = new SOAPStyle();
public static final SOAPStyle DOCUMENT = new SOAPStyle();
private SOAPStyle() {
}
}

View File

@@ -0,0 +1,40 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.internal.ws.wsdl.document.soap;
/**
* A SOAP "use" enumeration.
*
* @author WS Development Team
*/
public final class SOAPUse {
public static final SOAPUse LITERAL = new SOAPUse();
public static final SOAPUse ENCODED = new SOAPUse();
private SOAPUse() {
}
}