com.sun.tools.internal.ws.processor.model.ModelException Java Examples

The following examples show how to use com.sun.tools.internal.ws.processor.model.ModelException. 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: JavaStructureType.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void add(JavaStructureMember m) {
    if (membersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness.javastructuretype",
            new Object[] {m.getName(), getRealName()});
    }
    members.add(m);
    membersByName.put(m.getName(), m);
}
 
Example #2
Source File: JavaStructureType.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMembersByName() {
    membersByName = new HashMap<String, JavaStructureMember>();
    if (members != null) {
        for (JavaStructureMember m : members) {
            if (m.getName() != null &&
                membersByName.containsKey(m.getName())) {

                throw new ModelException("model.uniqueness");
            }
            membersByName.put(m.getName(), m);
        }
    }
}
 
Example #3
Source File: JavaInterface.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addMethod(JavaMethod method) {

        if (hasMethod(method)) {
            throw new ModelException("model.uniqueness");
        }
        methods.add(method);
    }
 
Example #4
Source File: JAXBStructuredType.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void add(JAXBElementMember m) {
    if (_elementMembersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness");
    }
    _elementMembers.add(m);
    if (m.getName() != null) {
        _elementMembersByName.put(m.getName().getLocalPart(), m);
    }
}
 
Example #5
Source File: JAXBStructuredType.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void setParentType(JAXBStructuredType parent) {
    if (_parentType != null &&
        parent != null &&
        !_parentType.equals(parent)) {

        throw new ModelException("model.parent.type.already.set",
            new Object[] { getName().toString(),
                _parentType.getName().toString(),
                parent.getName().toString()});
    }
    this._parentType = parent;
}
 
Example #6
Source File: JAXBModelBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds model from WSDL document. Model contains abstraction which is used by the
 * generators to generate the stub/tie/serializers etc. code.
 *
 * @see com.sun.tools.internal.ws.processor.modeler.Modeler#buildModel()
 */

private void internalBuildJAXBModel(){
    try {
        schemaCompiler =  options.getSchemaCompiler();
        schemaCompiler.resetSchema();
        if(options.entityResolver != null) {
            //set if its not null so as not to override catalog option specified via xjc args
            schemaCompiler.setEntityResolver(options.entityResolver);
        }
        schemaCompiler.setClassNameAllocator(_classNameAllocator);
        schemaCompiler.setErrorListener(errReceiver);
        int schemaElementCount = 1;

        for (Element element : forest.getInlinedSchemaElement()) {
            String location = element.getOwnerDocument().getDocumentURI();
            String systemId = location + "#types?schema" + schemaElementCount++;
            if(forest.isMexMetadata)
                schemaCompiler.parseSchema(systemId,element);
            else
                new DOMForestScanner(forest).scan(element,schemaCompiler.getParserHandler(systemId));
        }

        //feed external jaxb:bindings file
        InputSource[] externalBindings = options.getSchemaBindings();
        if(externalBindings != null){
            for(InputSource jaxbBinding : externalBindings){
                schemaCompiler.parseSchema(jaxbBinding);
            }
        }
    } catch (Exception e) {
        throw new ModelException(e);
    }
}
 
Example #7
Source File: JavaStructureType.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void add(JavaStructureMember m) {
    if (membersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness.javastructuretype",
            new Object[] {m.getName(), getRealName()});
    }
    members.add(m);
    membersByName.put(m.getName(), m);
}
 
Example #8
Source File: JavaStructureType.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMembersByName() {
    membersByName = new HashMap<String, JavaStructureMember>();
    if (members != null) {
        for (JavaStructureMember m : members) {
            if (m.getName() != null &&
                membersByName.containsKey(m.getName())) {

                throw new ModelException("model.uniqueness");
            }
            membersByName.put(m.getName(), m);
        }
    }
}
 
Example #9
Source File: JavaInterface.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void addMethod(JavaMethod method) {

        if (hasMethod(method)) {
            throw new ModelException("model.uniqueness");
        }
        methods.add(method);
    }
 
Example #10
Source File: JAXBStructuredType.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void add(JAXBElementMember m) {
    if (_elementMembersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness");
    }
    _elementMembers.add(m);
    if (m.getName() != null) {
        _elementMembersByName.put(m.getName().getLocalPart(), m);
    }
}
 
Example #11
Source File: JAXBStructuredType.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void setParentType(JAXBStructuredType parent) {
    if (_parentType != null &&
        parent != null &&
        !_parentType.equals(parent)) {

        throw new ModelException("model.parent.type.already.set",
            new Object[] { getName().toString(),
                _parentType.getName().toString(),
                parent.getName().toString()});
    }
    this._parentType = parent;
}
 
Example #12
Source File: JAXBModelBuilder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds model from WSDL document. Model contains abstraction which is used by the
 * generators to generate the stub/tie/serializers etc. code.
 *
 * @see com.sun.tools.internal.ws.processor.modeler.Modeler#buildModel()
 */

private void internalBuildJAXBModel(){
    try {
        schemaCompiler =  options.getSchemaCompiler();
        schemaCompiler.resetSchema();
        if(options.entityResolver != null) {
            //set if its not null so as not to override catalog option specified via xjc args
            schemaCompiler.setEntityResolver(options.entityResolver);
        }
        schemaCompiler.setClassNameAllocator(_classNameAllocator);
        schemaCompiler.setErrorListener(errReceiver);
        int schemaElementCount = 1;

        for (Element element : forest.getInlinedSchemaElement()) {
            String location = element.getOwnerDocument().getDocumentURI();
            String systemId = location + "#types?schema" + schemaElementCount++;
            if(forest.isMexMetadata)
                schemaCompiler.parseSchema(systemId,element);
            else
                new DOMForestScanner(forest).scan(element,schemaCompiler.getParserHandler(systemId));
        }

        //feed external jaxb:bindings file
        InputSource[] externalBindings = options.getSchemaBindings();
        if(externalBindings != null){
            for(InputSource jaxbBinding : externalBindings){
                schemaCompiler.parseSchema(jaxbBinding);
            }
        }
    } catch (Exception e) {
        throw new ModelException(e);
    }
}
 
Example #13
Source File: JavaStructureType.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void add(JavaStructureMember m) {
    if (membersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness.javastructuretype",
            new Object[] {m.getName(), getRealName()});
    }
    members.add(m);
    membersByName.put(m.getName(), m);
}
 
Example #14
Source File: JavaStructureType.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMembersByName() {
    membersByName = new HashMap<String, JavaStructureMember>();
    if (members != null) {
        for (JavaStructureMember m : members) {
            if (m.getName() != null &&
                membersByName.containsKey(m.getName())) {

                throw new ModelException("model.uniqueness");
            }
            membersByName.put(m.getName(), m);
        }
    }
}
 
Example #15
Source File: JavaInterface.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void addMethod(JavaMethod method) {

        if (hasMethod(method)) {
            throw new ModelException("model.uniqueness");
        }
        methods.add(method);
    }
 
Example #16
Source File: JAXBStructuredType.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void add(JAXBElementMember m) {
    if (_elementMembersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness");
    }
    _elementMembers.add(m);
    if (m.getName() != null) {
        _elementMembersByName.put(m.getName().getLocalPart(), m);
    }
}
 
Example #17
Source File: JAXBStructuredType.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void setParentType(JAXBStructuredType parent) {
    if (_parentType != null &&
        parent != null &&
        !_parentType.equals(parent)) {

        throw new ModelException("model.parent.type.already.set",
            new Object[] { getName().toString(),
                _parentType.getName().toString(),
                parent.getName().toString()});
    }
    this._parentType = parent;
}
 
Example #18
Source File: JAXBModelBuilder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds model from WSDL document. Model contains abstraction which is used by the
 * generators to generate the stub/tie/serializers etc. code.
 *
 * @see com.sun.tools.internal.ws.processor.modeler.Modeler#buildModel()
 */

private void internalBuildJAXBModel(){
    try {
        schemaCompiler =  options.getSchemaCompiler();
        schemaCompiler.resetSchema();
        if(options.entityResolver != null) {
            //set if its not null so as not to override catalog option specified via xjc args
            schemaCompiler.setEntityResolver(options.entityResolver);
        }
        schemaCompiler.setClassNameAllocator(_classNameAllocator);
        schemaCompiler.setErrorListener(errReceiver);
        int schemaElementCount = 1;

        for (Element element : forest.getInlinedSchemaElement()) {
            String location = element.getOwnerDocument().getDocumentURI();
            String systemId = location + "#types?schema" + schemaElementCount++;
            if(forest.isMexMetadata)
                schemaCompiler.parseSchema(systemId,element);
            else
                new DOMForestScanner(forest).scan(element,schemaCompiler.getParserHandler(systemId));
        }

        //feed external jaxb:bindings file
        InputSource[] externalBindings = options.getSchemaBindings();
        if(externalBindings != null){
            for(InputSource jaxbBinding : externalBindings){
                schemaCompiler.parseSchema(jaxbBinding);
            }
        }
    } catch (Exception e) {
        throw new ModelException(e);
    }
}
 
Example #19
Source File: JavaStructureType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void add(JavaStructureMember m) {
    if (membersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness.javastructuretype",
            new Object[] {m.getName(), getRealName()});
    }
    members.add(m);
    membersByName.put(m.getName(), m);
}
 
Example #20
Source File: JavaStructureType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMembersByName() {
    membersByName = new HashMap<String, JavaStructureMember>();
    if (members != null) {
        for (JavaStructureMember m : members) {
            if (m.getName() != null &&
                membersByName.containsKey(m.getName())) {

                throw new ModelException("model.uniqueness");
            }
            membersByName.put(m.getName(), m);
        }
    }
}
 
Example #21
Source File: JavaInterface.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void addMethod(JavaMethod method) {

        if (hasMethod(method)) {
            throw new ModelException("model.uniqueness");
        }
        methods.add(method);
    }
 
Example #22
Source File: JAXBStructuredType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void add(JAXBElementMember m) {
    if (_elementMembersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness");
    }
    _elementMembers.add(m);
    if (m.getName() != null) {
        _elementMembersByName.put(m.getName().getLocalPart(), m);
    }
}
 
Example #23
Source File: JAXBStructuredType.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setParentType(JAXBStructuredType parent) {
    if (_parentType != null &&
        parent != null &&
        !_parentType.equals(parent)) {

        throw new ModelException("model.parent.type.already.set",
            new Object[] { getName().toString(),
                _parentType.getName().toString(),
                parent.getName().toString()});
    }
    this._parentType = parent;
}
 
Example #24
Source File: JAXBModelBuilder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds model from WSDL document. Model contains abstraction which is used by the
 * generators to generate the stub/tie/serializers etc. code.
 *
 * @see com.sun.tools.internal.ws.processor.modeler.Modeler#buildModel()
 */

private void internalBuildJAXBModel(){
    try {
        schemaCompiler =  options.getSchemaCompiler();
        schemaCompiler.resetSchema();
        if(options.entityResolver != null) {
            //set if its not null so as not to override catalog option specified via xjc args
            schemaCompiler.setEntityResolver(options.entityResolver);
        }
        schemaCompiler.setClassNameAllocator(_classNameAllocator);
        schemaCompiler.setErrorListener(errReceiver);
        int schemaElementCount = 1;

        for (Element element : forest.getInlinedSchemaElement()) {
            String location = element.getOwnerDocument().getDocumentURI();
            String systemId = location + "#types?schema" + schemaElementCount++;
            if(forest.isMexMetadata)
                schemaCompiler.parseSchema(systemId,element);
            else
                new DOMForestScanner(forest).scan(element,schemaCompiler.getParserHandler(systemId));
        }

        //feed external jaxb:bindings file
        InputSource[] externalBindings = options.getSchemaBindings();
        if(externalBindings != null){
            for(InputSource jaxbBinding : externalBindings){
                schemaCompiler.parseSchema(jaxbBinding);
            }
        }
    } catch (Exception e) {
        throw new ModelException(e);
    }
}
 
Example #25
Source File: JavaStructureType.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void add(JavaStructureMember m) {
    if (membersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness.javastructuretype",
            new Object[] {m.getName(), getRealName()});
    }
    members.add(m);
    membersByName.put(m.getName(), m);
}
 
Example #26
Source File: JavaStructureType.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void initializeMembersByName() {
    membersByName = new HashMap<String, JavaStructureMember>();
    if (members != null) {
        for (JavaStructureMember m : members) {
            if (m.getName() != null &&
                membersByName.containsKey(m.getName())) {

                throw new ModelException("model.uniqueness");
            }
            membersByName.put(m.getName(), m);
        }
    }
}
 
Example #27
Source File: JavaInterface.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void addMethod(JavaMethod method) {

        if (hasMethod(method)) {
            throw new ModelException("model.uniqueness");
        }
        methods.add(method);
    }
 
Example #28
Source File: JAXBStructuredType.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void add(JAXBElementMember m) {
    if (_elementMembersByName.containsKey(m.getName())) {
        throw new ModelException("model.uniqueness");
    }
    _elementMembers.add(m);
    if (m.getName() != null) {
        _elementMembersByName.put(m.getName().getLocalPart(), m);
    }
}
 
Example #29
Source File: JAXBStructuredType.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void setParentType(JAXBStructuredType parent) {
    if (_parentType != null &&
        parent != null &&
        !_parentType.equals(parent)) {

        throw new ModelException("model.parent.type.already.set",
            new Object[] { getName().toString(),
                _parentType.getName().toString(),
                parent.getName().toString()});
    }
    this._parentType = parent;
}
 
Example #30
Source File: JAXBModelBuilder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Builds model from WSDL document. Model contains abstraction which is used by the
 * generators to generate the stub/tie/serializers etc. code.
 *
 * @see com.sun.tools.internal.ws.processor.modeler.Modeler#buildModel()
 */

private void internalBuildJAXBModel(){
    try {
        schemaCompiler =  options.getSchemaCompiler();
        schemaCompiler.resetSchema();
        if(options.entityResolver != null) {
            //set if its not null so as not to override catalog option specified via xjc args
            schemaCompiler.setEntityResolver(options.entityResolver);
        }
        schemaCompiler.setClassNameAllocator(_classNameAllocator);
        schemaCompiler.setErrorListener(errReceiver);
        int schemaElementCount = 1;

        for (Element element : forest.getInlinedSchemaElement()) {
            String location = element.getOwnerDocument().getDocumentURI();
            String systemId = location + "#types?schema" + schemaElementCount++;
            if(forest.isMexMetadata)
                schemaCompiler.parseSchema(systemId,element);
            else
                new DOMForestScanner(forest).scan(element,schemaCompiler.getParserHandler(systemId));
        }

        //feed external jaxb:bindings file
        InputSource[] externalBindings = options.getSchemaBindings();
        if(externalBindings != null){
            for(InputSource jaxbBinding : externalBindings){
                schemaCompiler.parseSchema(jaxbBinding);
            }
        }
    } catch (Exception e) {
        throw new ModelException(e);
    }
}