当前位置: 首页>>代码示例>>Java>>正文


Java Type.qualifiedTypeName方法代码示例

本文整理汇总了Java中com.sun.javadoc.Type.qualifiedTypeName方法的典型用法代码示例。如果您正苦于以下问题:Java Type.qualifiedTypeName方法的具体用法?Java Type.qualifiedTypeName怎么用?Java Type.qualifiedTypeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.javadoc.Type的用法示例。


在下文中一共展示了Type.qualifiedTypeName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: computeOperationString

import com.sun.javadoc.Type; //导入方法依赖的package包/类
/**
 * Computes the string representation of this method
 * appropriate for the construction of a
 * java.rmi.server.Operation object.
 **/
private String computeOperationString() {
    /*
     * To be consistent with previous implementations, we use
     * the deprecated style of placing the "[]" for the return
     * type (if any) after the parameter list.
     */
    Type returnType = methodDoc.returnType();
    String op = returnType.qualifiedTypeName() + " " +
        methodDoc.name() + "(";
    Parameter[] parameters = methodDoc.parameters();
    for (int i = 0; i < parameters.length; i++) {
        if (i > 0) {
            op += ", ";
        }
        op += parameters[i].type().toString();
    }
    op += ")" + returnType.dimension();
    return op;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:RemoteClass.java

示例2: checkSupportedFieldType

import com.sun.javadoc.Type; //导入方法依赖的package包/类
/**
 * Check that object types of primitives are not used as types.
 * E.g. java.lang.Integer cannot be used for a field in a class.
 * @param errInfo
 * @param type
 * @throws GeneratorException
 */
private void checkSupportedFieldType(ErrorInfo errInfo, Type type) throws GeneratorException {
	errInfo = errInfo.copy();
	
	// Do not use reference types of primitives, e.g. java.lang.Integer.
	// This primitive types cannot be null in all languages, e.g. in C++;
	String qname = type.qualifiedTypeName();
	TypeInfo tinfo = new TypeInfo(type.simpleTypeName(), qname, type.dimension(), null, false, false, false);
	if (qname.startsWith("java.lang.") && 
		tinfo.isPrimitiveType() && 
		!qname.equals("java.lang.String")) {
		
		errInfo.msg = "Reference types of primitives cannot be used as class members" +
				" or function parameters or return values. " + 
				"Please use the primitive type. " +
				"Example: use \"int\" instead of \"Integer\".";
		throw new GeneratorException(errInfo);
	}
}
 
开发者ID:wolfgangimig,项目名称:byps,代码行数:26,代码来源:BConvert.java

示例3: findTypeInDiagram

import com.sun.javadoc.Type; //导入方法依赖的package包/类
private static ClassDoc findTypeInDiagram(Type type, Collection<ClassDoc> diagramClasses) {
    if (type != null && diagramClasses != null) {
        final String qualifiedTypeName = type.qualifiedTypeName();
        for (ClassDoc renderedClass : diagramClasses) {
            if (qualifiedTypeName.equals(renderedClass.qualifiedTypeName())) return renderedClass;
        }
    }
    return null;
}
 
开发者ID:talsma-ict,项目名称:umldoclet,代码行数:10,代码来源:ClassPropertyRenderer.java

示例4: 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));
}
 
开发者ID:mikesamuel,项目名称:closure-maven-plugin,代码行数:8,代码来源:PluginConfigDoclet.java

示例5: possiblyQualifiedName

import com.sun.javadoc.Type; //导入方法依赖的package包/类
protected String possiblyQualifiedName(Type type)
{
   if (null == type.asClassDoc()
       || !omitPackageQualifier(type.asClassDoc().containingPackage())) {
      return type.qualifiedTypeName();
   }
   else {
      return type.typeName();
   }
}
 
开发者ID:vilie,项目名称:javify,代码行数:11,代码来源:AbstractDoclet.java

示例6: possiblyQualifiedName

import com.sun.javadoc.Type; //导入方法依赖的package包/类
protected String possiblyQualifiedName(Type type)
{
   if (null == type.asClassDoc() 
       || !omitPackageQualifier(type.asClassDoc().containingPackage())) {
      return type.qualifiedTypeName();
   }
   else {
      return type.typeName();
   }
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:11,代码来源:AbstractDoclet.java

示例7: 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";
}
 
开发者ID:calrissian,项目名称:rest-doclet,代码行数:48,代码来源:TypeUtils.java

示例8: makeElementTypeInfo

import com.sun.javadoc.Type; //导入方法依赖的package包/类
/**
 * Convert a javadoc Type object into an object of my TypeInfo class.
 * @param errInfo
 * @param type
 * @param errorContext
 * @return TypeInfo object
 * @throws GeneratorException
 */
private TypeInfo makeElementTypeInfo(ErrorInfo errInfo, Type type, String errorContext) throws GeneratorException {
	errInfo = errInfo.copy();
	
	if (type == null) return null;
	
	TypeInfo tinfo = null;

	WildcardType wtype = type.asWildcardType();
	
	String qname = type.qualifiedTypeName();
	if (wtype != null) {

		// Wildcard Parameter machen keinen Sinn.
		// Die Elemente werden sowohl als Konsument als auch als Produzent verwendet.
		// http://www.torsten-horn.de/techdocs/java-generics.htm#Wildcard-extends-versus-T-extends
		errInfo.msg = "Wildcard parameter types are unsupported, please replace type=\"" + type +"\" by \"Object\".";
		throw new GeneratorException(errInfo);
		
	}
	else {
		ParameterizedType ptype = type.asParameterizedType();
		List<TypeInfo> argInfos = getParameterizedTypeArgs(errInfo, ptype, errorContext);
		
		ClassDoc cls = type.asClassDoc();
		boolean isEnum = false;
		boolean isInline = false; 
		boolean isFinal = false;
		
		if (cls != null) {
			isEnum = cls.isEnum() || cls.isEnumConstant();
			isInline = isInline(cls);
			isFinal = cls.isFinal();
		}
		
		tinfo = classDB.createTypeInfo(
				type.simpleTypeName(),
				qname,
				type.dimension(),
				argInfos,
				isEnum, 
				isFinal, 
				isInline);
		
		makeSerialInfoForCollectionType(errInfo, tinfo);
	}
	

	return tinfo;
}
 
开发者ID:wolfgangimig,项目名称:byps,代码行数:58,代码来源:BConvert.java


注:本文中的com.sun.javadoc.Type.qualifiedTypeName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。