本文整理汇总了Java中com.leansoft.mxjc.model.TypeInfo.setFullName方法的典型用法代码示例。如果您正苦于以下问题:Java TypeInfo.setFullName方法的具体用法?Java TypeInfo.setFullName怎么用?Java TypeInfo.setFullName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.leansoft.mxjc.model.TypeInfo
的用法示例。
在下文中一共展示了TypeInfo.setFullName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFaultInfo
import com.leansoft.mxjc.model.TypeInfo; //导入方法依赖的package包/类
private FaultInfo getFaultInfo(Fault fault) {
FaultInfo faultInfo = new FaultInfo();
String className = Names.customExceptionClassName(fault);
faultInfo.setFullName(className);
faultInfo.setPackageName(ClassNameUtil.getPackageName(className));
faultInfo.setName(ClassNameUtil.stripQualifier(className));
if (fault.getJavaDoc() != null) {
faultInfo.setDocComment(fault.getJavaDoc());
}
String localPart = fault.getBlock().getName().getLocalPart();
String targetNamespace = fault.getBlock().getName().getNamespaceURI();
QName schemaName = new QName(localPart, targetNamespace);
faultInfo.setSchemaName(schemaName);
JType faultBean = fault.getBlock().getType().getJavaType().getType().getType();
TypeInfo faultBeanTypeInfo = new TypeInfo();
faultBeanTypeInfo.setFullName(faultBean.fullName());
faultBeanTypeInfo.setName(faultBean.name());
faultInfo.setFaultBeanTypeInfo(faultBeanTypeInfo);
return faultInfo;
}
示例2: convertType
import com.leansoft.mxjc.model.TypeInfo; //导入方法依赖的package包/类
/**
* Check and convert a type
*
* @param type, TypeInfo instance
*/
private void convertType(TypeInfo type) {
String targetTypeFullName = typeMapping.get(type.getFullName());
if (targetTypeFullName != null) {
type.setFullName(targetTypeFullName);
type.setName(ClassNameUtil.stripQualifier(targetTypeFullName));
} else {
if (type.isCollection()) { // special handling for collection type
for(String oldTypeFullName : typeMapping.keySet()) {
if (type.getFullName().indexOf(oldTypeFullName) > 0) { // including type parameter?
String newTypeFullName = typeMapping.get(oldTypeFullName);
String newFullName = type.getFullName().replace(oldTypeFullName, newTypeFullName);
String oldSimpleName = ClassNameUtil.stripQualifier(oldTypeFullName);
String newSimpleName = ClassNameUtil.stripQualifier(newTypeFullName);
String newName = type.getName().replace(oldSimpleName, newSimpleName);
type.setFullName(newFullName);
type.setName(newName);
}
}
}
}
}
示例3: convertType
import com.leansoft.mxjc.model.TypeInfo; //导入方法依赖的package包/类
/**
* Check and covert a type
*
* @param type
*/
private void convertType(TypeInfo type) {
if (type == null) return; // be cautious
String picoPrimitiveType = Java2PicoTypeMapper.lookupPicoType(type.getFullName());
if (picoPrimitiveType != null) {// pico primitive type
type.setFullName(PicoTypeMapper.lookupWrapper(picoPrimitiveType));
type.setName(picoPrimitiveType); // pico primitive
type.setPrimitive(true);
} else if (type.isEnum()) {
type.setName(PicoType.ENUM); // pico enum type
type.setPrimitive(true); // treat enum as primitive type
} else {
type.setName(PicoType.OBJECT);
type.setPrimitive(false);
}
}
示例4: prefixType
import com.leansoft.mxjc.model.TypeInfo; //导入方法依赖的package包/类
private void prefixType(TypeInfo type, String prefix) {
if (type == null) return; // be cautious
// for pico primitives, do not prefix
if (Java2PicoTypeMapper.lookupPicoType(type.getFullName()) != null) {
return;
}
String name = type.getName();
type.setName(prefix + name);
type.setFullName(prefix + name); // remove package for pico
}
示例5: adjustPackageNameOfNestClass
import com.leansoft.mxjc.model.TypeInfo; //导入方法依赖的package包/类
private void adjustPackageNameOfNestClass(List<ClassInfo> classes) {
for(ClassInfo classInfo : classes) {
// adjust class
if (classInfo.isNestClass()) {
String pkgName = classInfo.getPackageName().toLowerCase();
classInfo.setPackageName(pkgName);
classInfo.setFullName(pkgName + "." + classInfo.getName());
}
// adjust fields
for(FieldInfo fieldInfo : classInfo.getFields()) {
TypeInfo attrType = fieldInfo.getType();
// no need to handle primitive type
if (attrType.isPrimitive())
continue;
// handle array
if (attrType.isArray()) {
// T of T[]
TypeInfo elementType = attrType.getElementType();
// no need to handle primitive type
if (elementType.isPrimitive()) {
continue;
}
if (elementType.isNestClass()) {
String elementTypePackageName = ClassNameUtil
.getPackageName(elementType.getFullName());
elementTypePackageName = elementTypePackageName.toLowerCase();
elementType.setFullName(elementTypePackageName + "." + elementType.getName());
}
continue;
}
if (attrType.isNestClass()) {
String attrTypePackageName = ClassNameUtil.getPackageName(attrType.getFullName());
attrTypePackageName = attrTypePackageName.toLowerCase();
attrType.setFullName(attrTypePackageName + "." + attrType.getName());
}
// has type parameters?
for (TypeInfo paramType : attrType.getTypeParameters()) {
if (paramType.isNestClass()) {
String paramTypePackageName = ClassNameUtil
.getPackageName(paramType.getFullName());
paramTypePackageName = paramTypePackageName.toLowerCase();
paramType.setFullName(paramTypePackageName + "." + paramType.getName());
}
}
}
}
}