com.sun.tools.internal.ws.api.wsdl.TWSDLExtension Java Examples

The following examples show how to use com.sun.tools.internal.ws.api.wsdl.TWSDLExtension. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WSDLModelerBase.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
protected TWSDLExtension getAnyExtensionOfType(
    TWSDLExtensible extensible,
    Class type) {
    if (extensible == null) {
        return null;
    }
    for (TWSDLExtension extension:extensible.extensions()) {
        if(extension.getClass().equals(type)) {
            return extension;
        }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                        || type.equals(MIMEPart.class))) {
            for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
                //bug fix: 5024001
                TWSDLExtension extn = getExtensionOfType(part, type);
                if (extn != null) {
                    return extn;
                }
            }
        }
    }

    return null;
}
 
Example #2
Source File: WSDLModelerBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param mimeParts
 */
protected boolean validateMimeParts(Iterable<MIMEPart> mimeParts) {
    boolean gotRootPart = false;
    List<MIMEContent> mimeContents = new ArrayList<MIMEContent>();
    for (MIMEPart mPart : mimeParts) {
        for (TWSDLExtension obj : mPart.extensions()) {
            if (obj instanceof SOAPBody) {
                if (gotRootPart) {
                    warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(info.operation.getName().getLocalPart()));
                    return false;
                }
                gotRootPart = true;
            } else if (obj instanceof MIMEContent) {
                mimeContents.add((MIMEContent) obj);
            }
        }
        if (!validateMimeContentPartNames(mimeContents)) {
            return false;
        }
        if(mPart.getName() != null) {
            warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(info.portTypeOperation.getName()));
        }
    }
    return true;

}
 
Example #3
Source File: WSDLModelerBase.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
protected TWSDLExtension getAnyExtensionOfType(
    TWSDLExtensible extensible,
    Class type) {
    if (extensible == null) {
        return null;
    }
    for (TWSDLExtension extension:extensible.extensions()) {
        if(extension.getClass().equals(type)) {
            return extension;
        }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                        || type.equals(MIMEPart.class))) {
            for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
                //bug fix: 5024001
                TWSDLExtension extn = getExtensionOfType(part, type);
                if (extn != null) {
                    return extn;
                }
            }
        }
    }

    return null;
}
 
Example #4
Source File: WSDLModelerBase.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @return List of SOAPHeader extensions
 */
protected List<SOAPHeader> getHeaderExtensions(TWSDLExtensible extensible) {
    List<SOAPHeader> headerList = new ArrayList<SOAPHeader>();
    for (TWSDLExtension extension : extensible.extensions()) {
        if (extension.getClass()==MIMEMultipartRelated.class) {
            for( MIMEPart part : ((MIMEMultipartRelated) extension).getParts() ) {
                boolean isRootPart = isRootPart(part);
                for (TWSDLExtension obj : part.extensions()) {
                    if (obj instanceof SOAPHeader) {
                        //bug fix: 5024015
                        if (!isRootPart) {
                            warning((Entity) obj, ModelerMessages.MIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(info.bindingOperation.getName()));
                            return new ArrayList<SOAPHeader>();
                        }
                        headerList.add((SOAPHeader) obj);
                    }
                }
            }
        } else if (extension instanceof SOAPHeader) {
            headerList.add((SOAPHeader) extension);
        }
    }
     return headerList;
}
 
Example #5
Source File: WSDLModelerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @return List of SOAPHeader extensions
 */
protected List<SOAPHeader> getHeaderExtensions(TWSDLExtensible extensible) {
    List<SOAPHeader> headerList = new ArrayList<SOAPHeader>();
    for (TWSDLExtension extension : extensible.extensions()) {
        if (extension.getClass()==MIMEMultipartRelated.class) {
            for( MIMEPart part : ((MIMEMultipartRelated) extension).getParts() ) {
                boolean isRootPart = isRootPart(part);
                for (TWSDLExtension obj : part.extensions()) {
                    if (obj instanceof SOAPHeader) {
                        //bug fix: 5024015
                        if (!isRootPart) {
                            warning((Entity) obj, ModelerMessages.MIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(info.bindingOperation.getName()));
                            return new ArrayList<SOAPHeader>();
                        }
                        headerList.add((SOAPHeader) obj);
                    }
                }
            }
        } else if (extension instanceof SOAPHeader) {
            headerList.add((SOAPHeader) extension);
        }
    }
     return headerList;
}
 
Example #6
Source File: WSDLModelerBase.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @param mimeParts
 */
protected boolean validateMimeParts(Iterable<MIMEPart> mimeParts) {
    boolean gotRootPart = false;
    List<MIMEContent> mimeContents = new ArrayList<MIMEContent>();
    for (MIMEPart mPart : mimeParts) {
        for (TWSDLExtension obj : mPart.extensions()) {
            if (obj instanceof SOAPBody) {
                if (gotRootPart) {
                    warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_MORE_THAN_ONE_SOAP_BODY(info.operation.getName().getLocalPart()));
                    return false;
                }
                gotRootPart = true;
            } else if (obj instanceof MIMEContent) {
                mimeContents.add((MIMEContent) obj);
            }
        }
        if (!validateMimeContentPartNames(mimeContents)) {
            return false;
        }
        if(mPart.getName() != null) {
            warning(mPart, ModelerMessages.MIMEMODELER_INVALID_MIME_PART_NAME_NOT_ALLOWED(info.portTypeOperation.getName()));
        }
    }
    return true;

}
 
Example #7
Source File: WSDLModelerBase.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * @return List of SOAPHeader extensions
 */
protected List<SOAPHeader> getHeaderExtensions(TWSDLExtensible extensible) {
    List<SOAPHeader> headerList = new ArrayList<SOAPHeader>();
    for (TWSDLExtension extension : extensible.extensions()) {
        if (extension.getClass()==MIMEMultipartRelated.class) {
            for( MIMEPart part : ((MIMEMultipartRelated) extension).getParts() ) {
                boolean isRootPart = isRootPart(part);
                for (TWSDLExtension obj : part.extensions()) {
                    if (obj instanceof SOAPHeader) {
                        //bug fix: 5024015
                        if (!isRootPart) {
                            warning((Entity) obj, ModelerMessages.MIMEMODELER_WARNING_IGNORINGINVALID_HEADER_PART_NOT_DECLARED_IN_ROOT_PART(info.bindingOperation.getName()));
                            return new ArrayList<SOAPHeader>();
                        }
                        headerList.add((SOAPHeader) obj);
                    }
                }
            }
        } else if (extension instanceof SOAPHeader) {
            headerList.add((SOAPHeader) extension);
        }
    }
     return headerList;
}
 
Example #8
Source File: WSDLModelerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
protected TWSDLExtension getAnyExtensionOfType(
    TWSDLExtensible extensible,
    Class type) {
    if (extensible == null) {
        return null;
    }
    for (TWSDLExtension extension:extensible.extensions()) {
        if(extension.getClass().equals(type)) {
            return extension;
        }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                        || type.equals(MIMEPart.class))) {
            for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
                //bug fix: 5024001
                TWSDLExtension extn = getExtensionOfType(part, type);
                if (extn != null) {
                    return extn;
                }
            }
        }
    }

    return null;
}
 
Example #9
Source File: WSDLModelerBase.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
protected TWSDLExtension getAnyExtensionOfType(
    TWSDLExtensible extensible,
    Class type) {
    if (extensible == null) {
        return null;
    }
    for (TWSDLExtension extension:extensible.extensions()) {
        if(extension.getClass().equals(type)) {
            return extension;
        }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                        || type.equals(MIMEPart.class))) {
            for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
                //bug fix: 5024001
                TWSDLExtension extn = getExtensionOfType(part, type);
                if (extn != null) {
                    return extn;
                }
            }
        }
    }

    return null;
}
 
Example #10
Source File: WSDLModelerBase.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
protected TWSDLExtension getAnyExtensionOfType(
    TWSDLExtensible extensible,
    Class type) {
    if (extensible == null) {
        return null;
    }
    for (TWSDLExtension extension:extensible.extensions()) {
        if(extension.getClass().equals(type)) {
            return extension;
        }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                        || type.equals(MIMEPart.class))) {
            for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
                //bug fix: 5024001
                TWSDLExtension extn = getExtensionOfType(part, type);
                if (extn != null) {
                    return extn;
                }
            }
        }
    }

    return null;
}
 
Example #11
Source File: WSDLModelerBase.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
protected TWSDLExtension getAnyExtensionOfType(
    TWSDLExtensible extensible,
    Class type) {
    if (extensible == null) {
        return null;
    }
    for (TWSDLExtension extension:extensible.extensions()) {
        if(extension.getClass().equals(type)) {
            return extension;
        }else if (extension.getClass().equals(MIMEMultipartRelated.class) &&
                (type.equals(SOAPBody.class) || type.equals(MIMEContent.class)
                        || type.equals(MIMEPart.class))) {
            for (MIMEPart part : ((MIMEMultipartRelated)extension).getParts()) {
                //bug fix: 5024001
                TWSDLExtension extn = getExtensionOfType(part, type);
                if (extn != null) {
                    return extn;
                }
            }
        }
    }

    return null;
}
 
Example #12
Source File: WSDLModelerBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected static TWSDLExtension getExtensionOfType(
        TWSDLExtensible extensible,
        Class type) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(type)) {
            return extension;
        }
    }

    return null;
}
 
Example #13
Source File: ExtensibilityHelper.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Iterable<TWSDLExtension> extensions() {
    if (_extensions == null) {
        return new ArrayList<TWSDLExtension>();
    } else {
        return _extensions;
    }
}
 
Example #14
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static JAXWSBinding getJAXWSExtension(TWSDLExtensible extensible) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(JAXWSBinding.class)) {
            return (JAXWSBinding)extension;
        }
    }

    return null;
}
 
Example #15
Source File: JAXWSBindingExtensionHandler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static JAXWSBinding getJAXWSExtension(TWSDLExtensible extensible) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(JAXWSBinding.class)) {
            return (JAXWSBinding)extension;
        }
    }

    return null;
}
 
Example #16
Source File: JAXWSBindingExtensionHandler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static JAXWSBinding getJAXWSExtension(TWSDLExtensible extensible) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(JAXWSBinding.class)) {
            return (JAXWSBinding)extension;
        }
    }

    return null;
}
 
Example #17
Source File: WSDLModelerBase.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected static TWSDLExtension getExtensionOfType(
        TWSDLExtensible extensible,
        Class type) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(type)) {
            return extension;
        }
    }

    return null;
}
 
Example #18
Source File: WSDLModelerBase.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
protected boolean isRequestMimeMultipart() {
    for (TWSDLExtension extension: info.bindingOperation.getInput().extensions()) {
        if (extension.getClass().equals(MIMEMultipartRelated.class)) {
            return true;
        }
    }
    return false;
}
 
Example #19
Source File: WSDLModelerBase.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param part
 * @return true if part is the Root part
 */
private boolean isRootPart(MIMEPart part) {
    for (TWSDLExtension twsdlExtension : part.extensions()) {
        if (twsdlExtension instanceof SOAPBody) {
            return true;
        }
    }
    return false;
}
 
Example #20
Source File: WSDLModelerBase.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @param part
 * @return true if part is the Root part
 */
private boolean isRootPart(MIMEPart part) {
    for (TWSDLExtension twsdlExtension : part.extensions()) {
        if (twsdlExtension instanceof SOAPBody) {
            return true;
        }
    }
    return false;
}
 
Example #21
Source File: JAXWSBindingExtensionHandler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static JAXWSBinding getJAXWSExtension(TWSDLExtensible extensible) {
    for (TWSDLExtension extension:extensible.extensions()) {
        if (extension.getClass().equals(JAXWSBinding.class)) {
            return (JAXWSBinding)extension;
        }
    }

    return null;
}
 
Example #22
Source File: Output.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public Iterable<? extends TWSDLExtension> extensions() {
    return _helper.extensions();
}
 
Example #23
Source File: PortType.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public Iterable<TWSDLExtension> extensions() {
    return _helper.extensions();
}
 
Example #24
Source File: BindingFault.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void addExtension(TWSDLExtension e) {
    _helper.addExtension(e);
}
 
Example #25
Source File: Input.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public Iterable<? extends TWSDLExtension> extensions() {
    return _helper.extensions();
}
 
Example #26
Source File: Binding.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void addExtension(TWSDLExtension e) {
    _helper.addExtension(e);
}
 
Example #27
Source File: Definitions.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public Iterable<TWSDLExtension> extensions() {
    return _helper.extensions();
}
 
Example #28
Source File: Port.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public Iterable<TWSDLExtension> extensions() {
    return _helper.extensions();
}
 
Example #29
Source File: Input.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public void addExtension(TWSDLExtension e) {
    _helper.addExtension(e);
}
 
Example #30
Source File: ExtensionVisitorBase.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void postVisit(TWSDLExtension extension) throws Exception {
}