return false;
}
@Override
public ValidationResult validateComplexType(ComplexTypeDefinition complexType) {
ValidationResult result = super.validateComplexType(complexType);
if (!isGWTTransient(complexType)) {
if (!hasDefaultConstructor(complexType)) {
result.addError(complexType, "The mapping from GWT to JAXB requires a public no-arg constructor.");
}
if ((this.enforceNamespaceConformance)
&& (!complexType.getPackage().getQualifiedName().startsWith(this.gwtModuleNamespace))
&& (!isKnownGwtType(complexType))) {
result.addError(complexType, String.format("The package of the complex type, %s, must start with the GWT module namespace, %s.", complexType.getPackage().getQualifiedName(), gwtModuleNamespace));
}
for (Attribute attribute : complexType.getAttributes()) {
if (!isGWTTransient(attribute)) {
if ((attribute.getDelegate() instanceof FieldDeclaration) && (enforceNoFieldAccessors)) {
result.addError(attribute, "If you're mapping to GWT, you can't use fields for your accessors. ");
}
if (!isSupported(attribute.getAccessorType())) {
result.addError(attribute, "GWT doesn't support the '" + attribute.getAccessorType() + "' type.");
}
}
}
for (Element element : complexType.getElements()) {
if (!isGWTTransient(element)) {
if ((element.getDelegate() instanceof FieldDeclaration) && (enforceNoFieldAccessors)) {
result.addError(element, "If you're mapping to GWT, you can't use fields for your accessors. ");
}
if (!isSupported(element.getAccessorType())) {
result.addError(element, "GWT doesn't support the '" + element.getAccessorType() + "' type.");
}
if (this.generateJsonOverlays) {
if (element instanceof ElementRef && ((ElementRef) element).isElementRefs()) {
result.addWarning(complexType, "GWT overlay types don't fully support the @XmlElementRefs annotation. The items in the collection will only be available to the client-side in the form of a raw, untyped JsArray. Consider redesigning using a collection of a single type. See http://jira.codehaus.org/browse/ENUNCIATE-543 for more information, and feel free to contribute your ideas on how to solve this problem.");
}
else if (element.getAnnotation(XmlElements.class) != null) {
result.addWarning(complexType, "GWT overlay types don't fully support the @XmlElements annotation. The items in the collection will only be available to the client-side in the form of a raw, untyped JsArray. Consider redesigning using a collection of a single type. See http://jira.codehaus.org/browse/ENUNCIATE-543 for more information, and feel free to contribute your ideas on how to solve this issue.");
}
}
}
}
Value value = complexType.getValue();
if (value != null) {
if (!isGWTTransient(value)) {
if ((value.getDelegate() instanceof FieldDeclaration) && (enforceNoFieldAccessors)) {
result.addError(value, "If you're mapping to GWT, you can't use fields for your accessors. ");
}
if (!isSupported(value.getAccessorType())) {
result.addError(value, "GWT doesn't support the '" + value.getAccessorType() + "' type.");
}
}
}
}
if (((DecoratedTypeMirror) complexType.getSuperclass()).isInstanceOf(Map.class.getName())) {
result.addError(complexType, "Enunciate can't generate GWT code that handles types that implement java.util.Map. I'm afraid you'll have to disable the GWT module or use @XmlJavaTypeAdapter to adapt the type.");
}
return result;
}