本文整理汇总了Java中com.sun.javadoc.Type.isPrimitive方法的典型用法代码示例。如果您正苦于以下问题:Java Type.isPrimitive方法的具体用法?Java Type.isPrimitive怎么用?Java Type.isPrimitive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.javadoc.Type
的用法示例。
在下文中一共展示了Type.isPrimitive方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getFields
import com.sun.javadoc.Type; //导入方法依赖的package包/类
protected List<APIParameter> getFields(Type type, ParameterType paramType, HashSet<String> processingClasses) {
processingClasses.add(type.toString());
List<APIParameter> result = new LinkedList<APIParameter>();
if (!type.isPrimitive()) {
ParameterizedType pt = type.asParameterizedType();
if (pt != null && pt.typeArguments().length > 0) {
for (Type arg : pt.typeArguments()) {
if (!this.isParameterizedTypeInStopClasses(arg)) {
APIParameter tmp = new APIParameter();
tmp.setName(arg.simpleTypeName());
tmp.setType(this.getTypeName(arg, false));
tmp.setDescription("");
tmp.setParentTypeArgument(true);
if (!processingClasses.contains(arg.qualifiedTypeName())) {
tmp.setFields(this.getFields(arg, paramType, processingClasses));
}
result.add(tmp);
}
}
}
ClassDoc classDoc = this.wrDoc.getConfiguration().root.classNamed(type.qualifiedTypeName());
if (classDoc != null) {
result.addAll(this.getFields(classDoc, paramType, processingClasses));
}
}
return result;
}
示例2: isSelfExplanatory
import com.sun.javadoc.Type; //导入方法依赖的package包/类
static boolean isSelfExplanatory(Type t) {
if (t.isPrimitive()) { return true; }
String qualName = t.qualifiedTypeName();
return (
qualName.startsWith("java.lang.")
|| File.class.getName().equals(qualName));
}
示例3: parseTypeInfo
import com.sun.javadoc.Type; //导入方法依赖的package包/类
protected TypeInfo parseTypeInfo(Type type) {
TypeInfo typeInfoNode = objectFactory.createTypeInfo();
typeInfoNode.setName(type.simpleTypeName());
typeInfoNode.setDisplayName(type.simpleTypeName());
if (type.isPrimitive()) {
typeInfoNode.setIdentifier(type.qualifiedTypeName());
} else {
typeInfoNode.setIdentifier(parseIdentifier(type));
}
typeInfoNode.setFull(type.qualifiedTypeName());
String dimension = type.dimension();
if (dimension.length() > 0) {
typeInfoNode.setDimension(dimension);
}
WildcardType wildcard = type.asWildcardType();
if (wildcard != null) {
typeInfoNode.setWildcard(parseWildcard(wildcard));
}
ParameterizedType parameterized = type.asParameterizedType();
if (parameterized != null) {
for (Type typeArgument : parameterized.typeArguments()) {
typeInfoNode.getGeneric().add(parseTypeInfo(typeArgument));
}
}
return typeInfoNode;
}
示例4: getExportedName
import com.sun.javadoc.Type; //导入方法依赖的package包/类
private String getExportedName(Type clz, boolean link) {
return clz.isPrimitive() ? "void".equals(clz.typeName()) ? " "
: clz.typeName() : getExportedName(clz.asClassDoc(), link);
}
示例5: basicType
import com.sun.javadoc.Type; //导入方法依赖的package包/类
/**
* Returns the basic type. If not one of the supported swagger basic types then it is treated as an Object.
* @param type
* @return
*/
public static String basicType(Type type) {
if (type == null)
return "void";
//next primitives
if (type.isPrimitive())
return type.qualifiedTypeName();
String name = type.qualifiedTypeName();
//Check the java.lang classes
if (name.equals(String.class.getName()))
return "string";
if (name.equals(Boolean.class.getName()))
return "boolean";
if (name.equals(Integer.class.getName()))
return "int";
if (name.equals(Long.class.getName()))
return "long";
if (name.equals(Float.class.getName()))
return "float";
if (name.equals(Double.class.getName()))
return "double";
if (name.equals(Byte.class.getName()))
return "byte";
if (name.equals(Date.class.getName()))
return "Date";
//Process enums as strings.
if (!isEmpty(type.asClassDoc().enumConstants()))
return "string";
//TODO look into supporting models.
return "object";
}
示例6: typeLink
import com.sun.javadoc.Type; //导入方法依赖的package包/类
/**
* Appends to the current document a valid markdown
* link for the given ``type``. If this ``type``
* is a primitive one, then only a bold label
* is produced. Otherwise it return a link
* created by the {@link #classLink(PackageDoc, ClassDoc)}
* method.
*
* @param source Source package to start URL from.
* @param type Target type to reach from this package.
*/
public void typeLink(final PackageDoc source, final Type type) {
if (type.isPrimitive()) {
code(type.simpleTypeName());
}
else {
final ClassDoc classDoc = type.asClassDoc();
classLink(source, classDoc);
parameterLinks(source, type);
}
}