Package org.codehaus.enunciate.contract.validation

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


      //web result cannot be a header.
      if (webMethod.getWebResult().isHeader()) {
        Declaration conflict = paramsByName.put(webMethod.getWebResult().getElementName(), webMethod);
        if (conflict != null) {
          result.addError(webMethod, "C# requires that all header parameters defined in the same endpoint interface have unique names. " +
            "This parameter conflicts with the one at " + (conflict.getPosition() == null ? "(unknown source position)" : conflict.getPosition()));
        }
      }

      if (webMethod.getWebResult().getType() instanceof MapType) {
View Full Code Here


            "This parameter conflicts with the one at " + (conflict.getPosition() == null ? "(unknown source position)" : conflict.getPosition()));
        }
      }

      if (webMethod.getWebResult().getType() instanceof MapType) {
        result.addError(webMethod, "C# can't handle types that are maps.");
      }

      if (capitalize(webMethod.getClientSimpleName()).equals(ei.getClientSimpleName())) {
        result.addError(webMethod, "C# can't handle methods that are of the same name as their containing class. Either rename the method, or use the @org.codehaus.enunciate.ClientName annotation to rename the method (or type) on the client-side.");
      }
View Full Code Here

      if (webMethod.getWebResult().getType() instanceof MapType) {
        result.addError(webMethod, "C# can't handle types that are maps.");
      }

      if (capitalize(webMethod.getClientSimpleName()).equals(ei.getClientSimpleName())) {
        result.addError(webMethod, "C# can't handle methods that are of the same name as their containing class. Either rename the method, or use the @org.codehaus.enunciate.ClientName annotation to rename the method (or type) on the client-side.");
      }
    }

    return result;
  }
View Full Code Here

  @Override
  public ValidationResult validateSimpleType(SimpleTypeDefinition simpleType) {
    ValidationResult result = super.validateSimpleType(simpleType);
    if (simpleType.getValue() != null) {
      if (capitalize(simpleType.getValue().getClientSimpleName()).equals(simpleType.getClientSimpleName())) {
        result.addError(simpleType.getValue(), "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.");
      }
    }
    return result;
  }
View Full Code Here

      if (clientNameInfo != null) {
        simpleName = clientNameInfo.value();
      }

      if ("event".equals(simpleName)) {
        result.addError(enumItem, "C# can't handle an enum constant named 'Event'. Either rename the enum constant, or use the @org.codehaus.enunciate.ClientName annotation to rename it on the client-side.");
      }
      else if (simpleName.equals(enumType.getClientSimpleName())) {
        result.addError(enumItem, "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.");
      }
    }
View Full Code Here

      if ("event".equals(simpleName)) {
        result.addError(enumItem, "C# can't handle an enum constant named 'Event'. Either rename the enum constant, or use the @org.codehaus.enunciate.ClientName annotation to rename it on the client-side.");
      }
      else if (simpleName.equals(enumType.getClientSimpleName())) {
        result.addError(enumItem, "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.");
      }
    }
    return result;
  }
View Full Code Here

  @Override
  public ValidationResult validateComplexType(ComplexTypeDefinition complexType) {
    ValidationResult result = super.validateComplexType(complexType);
    for (Attribute attribute : complexType.getAttributes()) {
      if (capitalize(attribute.getClientSimpleName()).equals(complexType.getClientSimpleName())) {
        result.addError(attribute, "C# can't handle properties/fields that are of the same name as their containing class.");
      }
    }

    if (complexType.getValue() != null) {
      if (capitalize(complexType.getValue().getClientSimpleName()).equals(complexType.getClientSimpleName())) {
View Full Code Here

      }
    }

    if (complexType.getValue() != null) {
      if (capitalize(complexType.getValue().getClientSimpleName()).equals(complexType.getClientSimpleName())) {
        result.addError(complexType.getValue(), "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.");
      }
    }

    for (Element element : complexType.getElements()) {
      if (element.getAccessorType() instanceof MapType && !element.isAdapted()) {
View Full Code Here

      }
    }

    for (Element element : complexType.getElements()) {
      if (element.getAccessorType() instanceof MapType && !element.isAdapted()) {
        result.addError(element, "C# doesn't have a built-in way of serializing a Map. So you're going to have to use @XmlJavaTypeAdapter to supply " +
          "your own adapter for the Map, or disable the C# module.");
      }

      if (capitalize(element.getClientSimpleName()).equals(complexType.getClientSimpleName())) {
        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.");
View Full Code Here

        result.addError(element, "C# doesn't have a built-in way of serializing a Map. So you're going to have to use @XmlJavaTypeAdapter to supply " +
          "your own adapter for the Map, or disable the C# module.");
      }

      if (capitalize(element.getClientSimpleName()).equals(complexType.getClientSimpleName())) {
        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.");
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.