Package org.codehaus.enunciate.contract.validation

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


          if ( (value.getDelegate() instanceof FieldDeclaration ) && enforceNoFieldAccessors ) {
            result.addError(value, "If you're mapping to AMF, you can't use fields for your accessors. ");
          }

          if (!isSupported(value.getAccessorType())) {
            result.addError(value, "AMF doesn't support the '" + value.getAccessorType() + "' type.");
          }
        }
      }
    }
View Full Code Here


        }
      }
    }

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

    return result;
  }
View Full Code Here

  @Override
  public ValidationResult validateSimpleType(SimpleTypeDefinition simpleType) {
    ValidationResult result = super.validateSimpleType(simpleType);
    if (!isAMFTransient(simpleType)) {
      if (!hasDefaultConstructor(simpleType)) {
        result.addError(simpleType, "The mapping from AMF to JAXB requires a public no-arg constructor.");
      }

      if (!disabledRules.contains("as3.conflicting.names")) {
        if ("Date".equals(simpleType.getClientSimpleName())) {
          result.addError(simpleType, "ActionScript can't handle a class named 'Date'.  It conflicts with the top-level ActionScript class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
View Full Code Here

        result.addError(simpleType, "The mapping from AMF to JAXB requires a public no-arg constructor.");
      }

      if (!disabledRules.contains("as3.conflicting.names")) {
        if ("Date".equals(simpleType.getClientSimpleName())) {
          result.addError(simpleType, "ActionScript can't handle a class named 'Date'.  It conflicts with the top-level ActionScript class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
        else if ("Event".equals(simpleType.getClientSimpleName())) {
          result.addError(simpleType, "The Enunciate-generated ActionScript code can't handle a class named 'Event'.  It conflicts with the ActionScript remoting class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
      }
View Full Code Here

      if (!disabledRules.contains("as3.conflicting.names")) {
        if ("Date".equals(simpleType.getClientSimpleName())) {
          result.addError(simpleType, "ActionScript can't handle a class named 'Date'.  It conflicts with the top-level ActionScript class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
        else if ("Event".equals(simpleType.getClientSimpleName())) {
          result.addError(simpleType, "The Enunciate-generated ActionScript code can't handle a class named 'Event'.  It conflicts with the ActionScript remoting class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
      }
    }
    return result;
  }
View Full Code Here

  public ValidationResult validateEnumType(EnumTypeDefinition enumType) {
    ValidationResult result = super.validateEnumType(enumType);
    if (!isAMFTransient(enumType)) {
      if (!disabledRules.contains("as3.conflicting.names")) {
        if ("Date".equals(enumType.getClientSimpleName())) {
          result.addError(enumType, "ActionScript can't handle a class named 'Date'.  It conflicts with the top-level ActionScript class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
        else if ("Event".equals(enumType.getClientSimpleName())) {
          result.addError(enumType, "The Enunciate-generated ActionScript code can't handle a class named 'Event'.  It conflicts with the ActionScript remoting class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
      }
View Full Code Here

      if (!disabledRules.contains("as3.conflicting.names")) {
        if ("Date".equals(enumType.getClientSimpleName())) {
          result.addError(enumType, "ActionScript can't handle a class named 'Date'.  It conflicts with the top-level ActionScript class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
        else if ("Event".equals(enumType.getClientSimpleName())) {
          result.addError(enumType, "The Enunciate-generated ActionScript code can't handle a class named 'Event'.  It conflicts with the ActionScript remoting class of the same name. Either rename the class, or use the @org.codehaus.enunciate.ClientName annotation to rename the class on the client-side.");
        }
      }
    }
    return result;
  }
View Full Code Here

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

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

  public ValidationResult validateRootElement(RootElementDeclaration elType) {
    ValidationResult result = super.validateRootElement(elType);
    if (!serverSideTypesToUse.isEmpty()) {
      try {
        if (!elType.getQualifiedName().equals(clientConversion.convert(elType))) {
          result.addError(elType, "If you're using server-side types in your client library, you can't convert the name of "
            + elType.getQualifiedName() + " to " + clientConversion.convert(elType) + ".");
        }
      }
      catch (TemplateModelException e) {
        throw new IllegalStateException(e);
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.