Package org.codehaus.enunciate.contract.validation

Examples of org.codehaus.enunciate.contract.validation.ValidationResult.addError()


        result.addError(element, "C# can't handle properties/fields that are of the same name as their containing class. Either rename the property/field, or use the @org.codehaus.enunciate.ClientName annotation to rename the property/field on the client-side.");
      }
    }

    if (((DecoratedTypeMirror) complexType.getSuperclass()).isInstanceOf(Map.class.getName())) {
      result.addError(complexType, "Enunciate can't generate C# code that handles types that implement java.util.Map. I'm afraid you'll have to disable the C# module or use @XmlJavaTypeAdapter to adapt the type.");
    }

    return result;
  }
View Full Code Here


    ValidationResult result = super.validate(model);

    for (SchemaInfo schema : model.getNamespacesToSchemas().values()) {
      for (ImplicitSchemaElement element : schema.getImplicitSchemaElements()) {
        if (element.getElementName() == null || "".equals(element.getElementName())) {
          result.addError(element.getPosition(), "Implicit schema elements must have a non-null and non-empty element name.");
        }
      }
    }

    return result;
View Full Code Here

        for (WebMessagePart webMessagePart : webMessage.getParts()) {
          if (!(webMessagePart instanceof WebFault) && (webMessagePart.isImplicitSchemaElement())) {
            ImplicitSchemaElement el = ((ImplicitSchemaElement) webMessagePart);
            WebMessagePart otherPart = implicitElementNames.put(el.getElementName(), webMessagePart);
            if (otherPart != null && ((ImplicitSchemaElement)otherPart).getTypeQName() != null && !((ImplicitSchemaElement)otherPart).getTypeQName().equals(el.getTypeQName())) {
              result.addError(webMethod, "Web method defines a message part named '" + el.getElementName() +
                "' that is identical to the name of a web message part defined in " + otherPart.getWebMethod().getPosition() + ".  Please use annotations to disambiguate.");
            }
          }
        }
      }
View Full Code Here

      //it seems broken to state an @xmlValue property in the property order, but wsgen does it, so we'll account for the case here.
      assertedProperties.remove(complexType.getValue().getSimpleName());
    }

    if (!assertedProperties.isEmpty()) {
      result.addError(complexType, "Properties are declared in the @XmlType.propOrder element, but are not in the element accessor list: [" +
        assertedProperties + "]. Perhaps you're missing a setter method for these properties? If so, this is an Enunciate limitation and not a JAXB " +
        "limitation. Either add some no-op setter methods for these properties, or disable the java-client module.");
    }

    if (!serverSideTypesToUse.isEmpty()) {
View Full Code Here

    }

    if (!serverSideTypesToUse.isEmpty()) {
      try {
        if (!complexType.getQualifiedName().equals(clientConversion.convert(complexType))) {
          result.addError(complexType, "If you're using server-side types in your client library, you can't convert the name of "
            + complexType.getQualifiedName() + " to " + clientConversion.convert(complexType) + ".");
        }
      }
      catch (TemplateModelException e) {
        throw new IllegalStateException(e);
View Full Code Here

    if (!serverSideTypesToUse.isEmpty()) {
      for (WebMethod webMethod : ei.getWebMethods()) {
        for (WebFault webFault : webMethod.getWebFaults()) {
          try {
            if (!webFault.getQualifiedName().equals(clientConversion.convert(webFault))) {
              result.addError(webFault, "If you're using server-side types in your client library, you can't convert the name of "
                + webFault.getQualifiedName() + " to " + clientConversion.convert(webFault) + ".");
            }
          }
          catch (TemplateModelException e) {
            throw new IllegalStateException(e);
View Full Code Here

    if (ei.getEndpointImplementations().size() > 1) {
      ArrayList<String> impls = new ArrayList<String>();
      for (EndpointImplementation impl : ei.getEndpointImplementations()) {
        impls.add(impl.getQualifiedName());
      }
      result.addError(ei, "Sorry, the Java client module doesn't support two endpoint implementations for interface '" + ei.getQualifiedName() +
        "'.  Found " + ei.getEndpointImplementations().size() + " implementations (" + impls.toString() + ").");
    }
    else if (ei.getEndpointImplementations().isEmpty()) {
      result.addError(ei, "The Java client module requires an implementation for each endpoint interface.");
    }
View Full Code Here

      }
      result.addError(ei, "Sorry, the Java client module doesn't support two endpoint implementations for interface '" + ei.getQualifiedName() +
        "'.  Found " + ei.getEndpointImplementations().size() + " implementations (" + impls.toString() + ").");
    }
    else if (ei.getEndpointImplementations().isEmpty()) {
      result.addError(ei, "The Java client module requires an implementation for each endpoint interface.");
    }

    return result;
  }
View Full Code Here

    if (!isAMFTransient(ei)) {
      for (WebMethod webMethod : ei.getWebMethods()) {
        if (!isAMFTransient(webMethod)) {
          if (!isSupported(webMethod.getWebResult())) {
            result.addError(webMethod, "AMF doesn't support '" + webMethod.getWebResult() + "' as a return type.");
          }
          for (WebParam webParam : webMethod.getWebParameters()) {
            if (!isSupported(webParam.getType())) {
              result.addError(webParam, "AMF doesn't support '" + webParam.getType() + "' as a parameter type.");
            }
View Full Code Here

          if (!isSupported(webMethod.getWebResult())) {
            result.addError(webMethod, "AMF doesn't support '" + webMethod.getWebResult() + "' as a return type.");
          }
          for (WebParam webParam : webMethod.getWebParameters()) {
            if (!isSupported(webParam.getType())) {
              result.addError(webParam, "AMF doesn't support '" + webParam.getType() + "' as a parameter type.");
            }
          }
        }
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.