return result;
}
@Override
public ValidationResult validateComplexType(ComplexTypeDefinition complexType) {
ValidationResult result = super.validateComplexType(complexType);
if (!isAMFTransient(complexType)) {
if (!hasDefaultConstructor(complexType)) {
result.addError(complexType, "The mapping from AMF to JAXB requires a public no-arg constructor.");
}
if (!disabledRules.contains("as3.conflicting.names")) {
if ("Date".equals(complexType.getClientSimpleName())) {
result.addError(complexType, "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(complexType.getClientSimpleName())) {
result.addError(complexType, "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.");
}
}
for (Attribute attribute : complexType.getAttributes()) {
if (!isAMFTransient(attribute)) {
if ( (attribute.getDelegate() instanceof FieldDeclaration ) && enforceNoFieldAccessors ) {
result.addError(attribute, "If you're mapping to AMF, you can't use fields for your accessors. ");
}
if (!isSupported(attribute.getAccessorType())) {
result.addError(attribute, "AMF doesn't support the '" + attribute.getAccessorType() + "' type.");
}
}
}
for (Element element : complexType.getElements()) {
if (!isAMFTransient(element)) {
if ( (element.getDelegate() instanceof FieldDeclaration ) && enforceNoFieldAccessors ) {
result.addError(element, "If you're mapping to AMF, you can't use fields for your accessors. ");
}
if (!isSupported(element.getAccessorType())) {
result.addError(element, "AMF doesn't support the '" + element.getAccessorType() + "' type.");
}
}
}
Value value = complexType.getValue();
if (value != null) {
if (!isAMFTransient(value)) {
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.");
}
}
}
}
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;
}