for (WebParam webParam : webMethod.getWebParameters()) {
imports.add(classnameFor.convert(webParam));
addComponentTypes(webParam.getType(), imports);
}
DecoratedTypeMirror returnType = (DecoratedTypeMirror) webMethod.getReturnType();
if (!returnType.isVoid()) {
imports.add(classnameFor.convert((ImplicitChildElement) webMethod.getWebResult()));
addComponentTypes(returnType, imports);
}
}
}
else if (declaration instanceof TypeDefinition) {
TypeDefinition typeDef = (TypeDefinition) declaration;
if (!typeDef.isBaseObject()) {
imports.add(classnameFor.convert(typeDef.getSuperclass()));
}
for (Attribute attribute : typeDef.getAttributes()) {
imports.add(classnameFor.convert(attribute));
TypeMirror accessorType;
if (attribute.isAdapted()) {
// If the attribute is adaptable, we need to use the adapting type
// else it will try to import the "real type" defined by the attribute.
accessorType = attribute.getAdapterType().getAdaptingType();
}
else {
accessorType = attribute.getAccessorType();
}
addComponentTypes(accessorType, imports);
}
for (Element element : typeDef.getElements()) {
imports.add(classnameFor.convert(element));
TypeMirror accessorType;
if (element.isAdapted()) {
// If the element is adaptable, we need to use the adapting type
// else it will try to import the "real type" defined by the attribute.
accessorType = element.getAdapterType().getAdaptingType();
}
else {
accessorType = element.getAccessorType();
}
addComponentTypes(accessorType, imports);
}
Value value = typeDef.getValue();
if (value != null) {
imports.add(classnameFor.convert(value));
addComponentTypes(value.getAccessorType(), imports);
}
}
else if (declaration instanceof WebMethod) {
WebMethod webMethod = (WebMethod) declaration;
DecoratedTypeMirror returnType = (DecoratedTypeMirror) webMethod.getReturnType();
if (!returnType.isVoid()) {
imports.add(classnameFor.convert((ImplicitChildElement) webMethod.getWebResult()));
addComponentTypes(returnType, imports);
}
}
else {