use of com.webcohesion.enunciate.metadata.ClientName in project enunciate by stoicflame.
the class TypeNameForMethod method convert.
@Override
public String convert(TypeElement declaration) throws TemplateModelException {
String fqn = declaration.getQualifiedName().toString();
if (classConversions.containsKey(fqn)) {
return classConversions.get(fqn);
} else if (declaration.getKind() == ElementKind.ENUM) {
return "string";
} else if (isCollection(declaration) || isStream(declaration) || isMap(declaration)) {
return "array";
}
if (this.jacksonContext != null) {
AdapterType adapterType = JacksonUtil.findAdapterType(declaration, this.jacksonContext);
if (adapterType != null) {
return convert(adapterType.getAdaptingType());
}
}
if (this.jackson1Context != null) {
com.webcohesion.enunciate.modules.jackson1.model.adapters.AdapterType adapter1Type = com.webcohesion.enunciate.modules.jackson1.model.util.JacksonUtil.findAdapterType(declaration, this.jackson1Context);
if (adapter1Type != null) {
return convert(adapter1Type.getAdaptingType());
}
}
String convertedPackage = convertPackage(this.context.getProcessingEnvironment().getElementUtils().getPackageOf(declaration));
ClientName specifiedName = declaration.getAnnotation(ClientName.class);
String simpleName = specifiedName == null ? declaration.getSimpleName().toString() : specifiedName.value();
return convertedPackage + getPackageSeparator() + simpleName;
}
use of com.webcohesion.enunciate.metadata.ClientName in project enunciate by stoicflame.
the class ClientClassnameForMethod method convert.
@Override
public String convert(TypeElement declaration) throws TemplateModelException {
String fqn = declaration.getQualifiedName().toString();
if (classConversions.containsKey(fqn)) {
return classConversions.get(fqn);
} else if (declaration.getKind() == ElementKind.ENUM) {
return "String";
} else if (isCollection(declaration) || isStream(declaration) || isMap(declaration)) {
return "Array";
}
if (this.jacksonContext != null) {
AdapterType adapterType = JacksonUtil.findAdapterType(declaration, this.jacksonContext);
if (adapterType != null) {
return convert(adapterType.getAdaptingType());
}
}
if (this.jackson1Context != null) {
com.webcohesion.enunciate.modules.jackson1.model.adapters.AdapterType adapter1Type = com.webcohesion.enunciate.modules.jackson1.model.util.JacksonUtil.findAdapterType(declaration, this.jackson1Context);
if (adapter1Type != null) {
return convert(adapter1Type.getAdaptingType());
}
}
String convertedPackage = convertPackage(this.context.getProcessingEnvironment().getElementUtils().getPackageOf(declaration));
ClientName specifiedName = declaration.getAnnotation(ClientName.class);
String simpleName = specifiedName == null ? declaration.getSimpleName().toString() : specifiedName.value();
return convertedPackage + getPackageSeparator() + simpleName;
}
use of com.webcohesion.enunciate.metadata.ClientName in project enunciate by stoicflame.
the class AnyElement method getClientSimpleName.
/**
* The simple name for client-side code generation.
*
* @return The simple name for client-side code generation.
*/
public String getClientSimpleName() {
String clientSimpleName = getSimpleName().toString();
ClientName clientName = getAnnotation(ClientName.class);
if (clientName != null) {
clientSimpleName = clientName.value();
}
return clientSimpleName;
}
use of com.webcohesion.enunciate.metadata.ClientName in project enunciate by stoicflame.
the class ClientClassnameForMethod method convert.
@Override
public String convert(TypeElement declaration) throws TemplateModelException {
String fqn = declaration.getQualifiedName().toString();
if (classConversions.containsKey(fqn)) {
return classConversions.get(fqn);
} else if (declaration.getKind() == ElementKind.ENUM) {
return "String";
} else if (isCollection(declaration) || isStream(declaration) || isMap(declaration)) {
return "Array";
}
if (this.jacksonContext != null) {
AdapterType adapterType = JacksonUtil.findAdapterType(declaration, this.jacksonContext);
if (adapterType != null) {
return convert(adapterType.getAdaptingType());
}
}
if (this.jackson1Context != null) {
com.webcohesion.enunciate.modules.jackson1.model.adapters.AdapterType adapter1Type = com.webcohesion.enunciate.modules.jackson1.model.util.JacksonUtil.findAdapterType(declaration, this.jackson1Context);
if (adapter1Type != null) {
return convert(adapter1Type.getAdaptingType());
}
}
String convertedPackage = convertPackage(this.context.getProcessingEnvironment().getElementUtils().getPackageOf(declaration));
ClientName specifiedName = declaration.getAnnotation(ClientName.class);
String simpleName = specifiedName == null ? declaration.getSimpleName().toString() : specifiedName.value();
return convertedPackage + getPackageSeparator() + simpleName;
}
use of com.webcohesion.enunciate.metadata.ClientName in project enunciate by stoicflame.
the class TypeNameForMethod method convert.
@Override
public String convert(TypeElement declaration) throws TemplateModelException {
String fqn = declaration.getQualifiedName().toString();
if (classConversions.containsKey(fqn)) {
return classConversions.get(fqn);
} else if (declaration.getKind() == ElementKind.ENUM) {
return "string";
} else if (isCollection(declaration) || isStream(declaration) || isMap(declaration)) {
return "array";
}
if (this.jacksonContext != null) {
AdapterType adapterType = JacksonUtil.findAdapterType(declaration, this.jacksonContext);
if (adapterType != null) {
return convert(adapterType.getAdaptingType());
}
}
if (this.jackson1Context != null) {
com.webcohesion.enunciate.modules.jackson1.model.adapters.AdapterType adapter1Type = com.webcohesion.enunciate.modules.jackson1.model.util.JacksonUtil.findAdapterType(declaration, this.jackson1Context);
if (adapter1Type != null) {
return convert(adapter1Type.getAdaptingType());
}
}
String convertedPackage = convertPackage(this.context.getProcessingEnvironment().getElementUtils().getPackageOf(declaration));
ClientName specifiedName = declaration.getAnnotation(ClientName.class);
String simpleName = specifiedName == null ? declaration.getSimpleName().toString() : specifiedName.value();
return "\\" + convertedPackage + getPackageSeparator() + simpleName;
}
Aggregations