當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。