com.sun.tools.internal.ws.wscompile.AbortException Java Examples

The following examples show how to use com.sun.tools.internal.ws.wscompile.AbortException. 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: Message.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void addParameter(Parameter p) {
    if (_parametersByName.containsKey(p.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(p.getName(), p.getName()));
        throw new AbortException();
    }
    _parameters.add(p);
    String name = p.getCustomName() != null ? p.getCustomName() : p.getName();
    _parametersByName.put(name, p);
}
 
Example #2
Source File: Message.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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()));
}
 
Example #3
Source File: Port.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #4
Source File: JAXBModelBuilder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void bind(){
    S2JJAXBModel rawJaxbModel = schemaCompiler.bind();
    if(rawJaxbModel == null)
        throw new AbortException();
    options.setCodeModel(rawJaxbModel.generateCode(null, errReceiver));
    jaxbModel = new JAXBModel(rawJaxbModel);
    jaxbModel.setGeneratedClassNames(_classNameAllocator.getJaxbGeneratedClasses());
}
 
Example #5
Source File: Message.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/** attachment block */
public void addAttachmentBlock(Block b) {
    if (_attachmentBlocks.containsKey(b.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
        throw new AbortException();
    }
    _attachmentBlocks.put(b.getName(), b);
    b.setLocation(Block.ATTACHMENT);
}
 
Example #6
Source File: Message.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addParameter(Parameter p) {
    if (_parametersByName.containsKey(p.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(p.getName(), p.getName()));
        throw new AbortException();
    }
    _parameters.add(p);
    String name = p.getCustomName() != null ? p.getCustomName() : p.getName();
    _parametersByName.put(name, p);
}
 
Example #7
Source File: Message.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeParametersByName() {
    _parametersByName = new HashMap();
    if (_parameters != null) {
        for (Iterator iter = _parameters.iterator(); iter.hasNext();) {
            Parameter param = (Parameter) iter.next();
            if (param.getName() != null &&
                _parametersByName.containsKey(param.getName())) {
                errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getName()));
                throw new AbortException();
            }
            _parametersByName.put(param.getName(), param);
        }
    }
}
 
Example #8
Source File: WebServiceAp.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void processError(String message) {
    if (isCommandLineInvocation) {
        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message);
        throw new AbortException();
    } else {
        throw new ModelerException(message);
    }
}
 
Example #9
Source File: ModelerUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel, ErrorReceiverFilter errReceiver){
    RpcLitStructure rpcStruct = (RpcLitStructure)block.getType();

    List<Parameter> parameters = new ArrayList<Parameter>();
    for(MessagePart part : message.getParts()){
        if(!ModelerUtils.isBoundToSOAPBody(part))
            continue;
        QName name = part.getDescriptor();
        TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
        if(typeAndAnn == null){
            String msgQName = "{"+message.getDefining().getTargetNamespaceURI()+"}"+message.getName();
            errReceiver.error(part.getLocator(), ModelerMessages.WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(name.toString(),
                    part.getName(), msgQName));
            throw new AbortException();
        }
        String type = typeAndAnn.getTypeClass().fullName();
        type = ClassNameInfo.getGenericClass(type);
        RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
        param.setJavaType(javaType);
        rpcStruct.addRpcLitMember(param);
        Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
        parameter.setEmbedded(true);
        parameters.add(parameter);
    }
    return parameters;
}
 
Example #10
Source File: WSDLModelerBase.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void error(Entity entity, String message){
    if (entity == null) {
        errReceiver.error(null, message);
    } else {
        errReceiver.error(entity.getLocator(), message);
    }
    throw new AbortException();
}
 
Example #11
Source File: JAXBModelBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void bind(){
    S2JJAXBModel rawJaxbModel = schemaCompiler.bind();
    if(rawJaxbModel == null)
        throw new AbortException();
    options.setCodeModel(rawJaxbModel.generateCode(null, errReceiver));
    jaxbModel = new JAXBModel(rawJaxbModel);
    jaxbModel.setGeneratedClassNames(_classNameAllocator.getJaxbGeneratedClasses());
}
 
Example #12
Source File: Message.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
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()));
}
 
Example #13
Source File: Message.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addHeaderBlock(Block b) {
    if (_headerBlocks.containsKey(b.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
        throw new AbortException();
    }
    _headerBlocks.put(b.getName(), b);
    b.setLocation(Block.HEADER);
}
 
Example #14
Source File: WebServiceAp.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void processError(String message) {
    if (isCommandLineInvocation) {
        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message);
        throw new AbortException();
    } else {
        throw new ModelerException(message);
    }
}
 
Example #15
Source File: Message.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void initializeParametersByName() {
    _parametersByName = new HashMap();
    if (_parameters != null) {
        for (Iterator iter = _parameters.iterator(); iter.hasNext();) {
            Parameter param = (Parameter) iter.next();
            if (param.getName() != null &&
                _parametersByName.containsKey(param.getName())) {
                errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getName()));
                throw new AbortException();
            }
            _parametersByName.put(param.getName(), param);
        }
    }
}
 
Example #16
Source File: ModelerUtils.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel, ErrorReceiverFilter errReceiver){
    RpcLitStructure rpcStruct = (RpcLitStructure)block.getType();

    List<Parameter> parameters = new ArrayList<Parameter>();
    for(MessagePart part : message.getParts()){
        if(!ModelerUtils.isBoundToSOAPBody(part))
            continue;
        QName name = part.getDescriptor();
        TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
        if(typeAndAnn == null){
            String msgQName = "{"+message.getDefining().getTargetNamespaceURI()+"}"+message.getName();
            errReceiver.error(part.getLocator(), ModelerMessages.WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(name.toString(),
                    part.getName(), msgQName));
            throw new AbortException();
        }
        String type = typeAndAnn.getTypeClass().fullName();
        type = ClassNameInfo.getGenericClass(type);
        RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
        param.setJavaType(javaType);
        rpcStruct.addRpcLitMember(param);
        Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
        parameter.setEmbedded(true);
        parameters.add(parameter);
    }
    return parameters;
}
 
Example #17
Source File: Message.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/** attachment block */
public void addAttachmentBlock(Block b) {
    if (_attachmentBlocks.containsKey(b.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
        throw new AbortException();
    }
    _attachmentBlocks.put(b.getName(), b);
    b.setLocation(Block.ATTACHMENT);
}
 
Example #18
Source File: Message.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void addHeaderBlock(Block b) {
    if (_headerBlocks.containsKey(b.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
        throw new AbortException();
    }
    _headerBlocks.put(b.getName(), b);
    b.setLocation(Block.HEADER);
}
 
Example #19
Source File: Message.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void addBodyBlock(Block b) {
    if (_bodyBlocks.containsKey(b.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PART_NOT_UNIQUE(((com.sun.tools.internal.ws.wsdl.document.Message)getEntity()).getName(), b.getName()));
        throw new AbortException();
    }
    _bodyBlocks.put(b.getName(), b);
    b.setLocation(Block.BODY);
}
 
Example #20
Source File: AbstractDocument.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public GloballyKnown find(Kind k, QName name) {
    Map map = getMap(k);
    Object result = map.get(name);
    if (result == null){
        errReceiver.error(null, WsdlMessages.ENTITY_NOT_FOUND_BY_Q_NAME(k.getName(), name, _systemId));
        throw new AbortException();
    }
    return (GloballyKnown) result;
}
 
Example #21
Source File: AbstractDocument.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void define(GloballyKnown e) {
    Map map = getMap(e.getKind());
    if (e.getName() == null)
        return;
    QName name =
        new QName(e.getDefining().getTargetNamespaceURI(), e.getName());

    if (map.containsKey(name)){
        errReceiver.error(e.getLocator(), WsdlMessages.ENTITY_DUPLICATE_WITH_TYPE(e.getElementName().getLocalPart(), e.getName()));
        throw new AbortException();
    }else{
        map.put(name, e);
    }
}
 
Example #22
Source File: Binding.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #23
Source File: Port.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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();
    }
}
 
Example #24
Source File: Message.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
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()));
}
 
Example #25
Source File: JAXBModelBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void bind(){
    S2JJAXBModel rawJaxbModel = schemaCompiler.bind();
    if(rawJaxbModel == null)
        throw new AbortException();
    options.setCodeModel(rawJaxbModel.generateCode(null, errReceiver));
    jaxbModel = new JAXBModel(rawJaxbModel);
    jaxbModel.setGeneratedClassNames(_classNameAllocator.getJaxbGeneratedClasses());
}
 
Example #26
Source File: WSDLModelerBase.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void error(Entity entity, String message){
    if (entity == null) {
        errReceiver.error(null, message);
    } else {
        errReceiver.error(entity.getLocator(), message);
    }
    throw new AbortException();
}
 
Example #27
Source File: ModelerUtils.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel, ErrorReceiverFilter errReceiver){
    RpcLitStructure rpcStruct = (RpcLitStructure)block.getType();

    List<Parameter> parameters = new ArrayList<Parameter>();
    for(MessagePart part : message.getParts()){
        if(!ModelerUtils.isBoundToSOAPBody(part))
            continue;
        QName name = part.getDescriptor();
        TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
        if(typeAndAnn == null){
            String msgQName = "{"+message.getDefining().getTargetNamespaceURI()+"}"+message.getName();
            errReceiver.error(part.getLocator(), ModelerMessages.WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(name.toString(),
                    part.getName(), msgQName));
            throw new AbortException();
        }
        String type = typeAndAnn.getTypeClass().fullName();
        type = ClassNameInfo.getGenericClass(type);
        RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
        param.setJavaType(javaType);
        rpcStruct.addRpcLitMember(param);
        Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
        parameter.setEmbedded(true);
        parameters.add(parameter);
    }
    return parameters;
}
 
Example #28
Source File: WebServiceAp.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void processError(String message) {
    if (isCommandLineInvocation) {
        processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, message);
        throw new AbortException();
    } else {
        throw new ModelerException(message);
    }
}
 
Example #29
Source File: Message.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void initializeParametersByName() {
    _parametersByName = new HashMap();
    if (_parameters != null) {
        for (Iterator iter = _parameters.iterator(); iter.hasNext();) {
            Parameter param = (Parameter) iter.next();
            if (param.getName() != null &&
                _parametersByName.containsKey(param.getName())) {
                errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(param.getName(), param.getName()));
                throw new AbortException();
            }
            _parametersByName.put(param.getName(), param);
        }
    }
}
 
Example #30
Source File: Message.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void addParameter(Parameter p) {
    if (_parametersByName.containsKey(p.getName())) {
        errorReceiver.error(getEntity().getLocator(), ModelMessages.MODEL_PARAMETER_NOTUNIQUE(p.getName(), p.getName()));
        throw new AbortException();
    }
    _parameters.add(p);
    String name = p.getCustomName() != null ? p.getCustomName() : p.getName();
    _parametersByName.put(name, p);
}