com.thoughtworks.qdox.model.Type.getFullyQualifiedName()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中com.thoughtworks.qdox.model.Type.getFullyQualifiedName()方法的一些代码示例,展示了Type.getFullyQualifiedName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Type.getFullyQualifiedName()方法的具体详情如下:
包路径:com.thoughtworks.qdox.model.Type
类名称:Type
方法名:getFullyQualifiedName

Type.getFullyQualifiedName介绍

[英]Returns the FQN of an Object or the handler of a Type If the name of the can't be resolved based on the imports and the classes on the classpath the name will be returned InnerClasses will use the $ sign Some examples how names will be translated

Object > java.lang.Object 
java.util.List > java.util.List 
?  > ? 
T  > T 
anypackage.Outer.Inner > anypackage.Outer$Inner

[中]返回对象或类型处理程序的FQN。如果无法根据导入和类路径上的类解析其名称,则返回该名称。内部类将使用$符号。一些示例说明如何翻译名称

Object > java.lang.Object 
java.util.List > java.util.List 
?  > ? 
T  > T 
anypackage.Outer.Inner > anypackage.Outer$Inner

代码示例

代码示例来源:origin: com.thoughtworks.qdox/qdox

/**
 * 
 * @deprecated instead use getFullyQualifiedName()
 */
public String getFullQualifiedName() {
  return getFullyQualifiedName();
}

代码示例来源:origin: com.thoughtworks.qdox/qdox

/**
 * The FQN representation of an Object for code usage
 * This implementation ignores generics
 *
 * Some examples how Objects will be translated
 * <pre>
 * Object > java.lang.object
 * java.util.List<T> > java.util.List
 * ? > ?
 * T > T
 * anypackage.Outer.Inner > anypackage.Outer.Inner
 * </pre>
 * 
 * @return type representation for code usage
 */
public String getValue() {
  String fqn = getFullyQualifiedName();
  return ( fqn == null ? "" : fqn.replaceAll( "\\$", "." ) );
}

代码示例来源:origin: org.buildobjects/docufier

private boolean hasAnnotation(String name, JavaMethod method) {
  for (Annotation a : method.getAnnotations()){
    if (a.getType().getFullyQualifiedName().endsWith(name)){
      return true;
    }
  }
  return false;
}

代码示例来源:origin: com.thoughtworks.qdox/qdox

/**
 * 
 * @param superClass
 * @return
 * @since 1.12
 */
protected int getTypeVariableIndex( JavaClass superClass ) {
  TypeVariable[] typeVariables = superClass.getTypeParameters();
  for(int typeIndex=0;typeIndex<typeVariables.length; typeIndex++) {
    if(typeVariables[typeIndex].getFullyQualifiedName().equals( getFullyQualifiedName())) {
      return typeIndex;
    }
  }
  return -1;
}

代码示例来源:origin: com.thoughtworks.qdox/qdox

public JavaClass getJavaClass() {
  JavaClass result = null;
  
  JavaClassParent javaClassParent = getJavaClassParent();
  if (javaClassParent != null) {
    result = javaClassParent.getNestedClassByName(getFullyQualifiedName());
    if(result == null) {
      JavaClassContext context = javaClassParent.getJavaClassContext();
      if (context.getClassLibrary() != null) {
        result = context.getClassByName(getFullyQualifiedName());
      }
    }
  }
  return result;
}

代码示例来源:origin: gwt-maven-plugin/gwt-maven-plugin

/**
 * Determine if a client service method is deprecated.
 * 
 * @see MGWT-352
 */
private boolean isDeprecated( JavaMethod method )
{
  if ( method == null )
    return false;
  for ( Annotation annotation : method.getAnnotations() )
  {
    if ( "java.lang.Deprecated".equals( annotation.getType().getFullyQualifiedName() ) )
    {
      return true;
    }
  }
  return method.getTagByName( "deprecated" ) != null;
}

代码示例来源:origin: com.thoughtworks.qdox/qdox

/**
 * 
 * @param resolve
 * @param callingClass
 * @return
 * @since 1.12
 */
protected Type getReturnType ( boolean resolve, JavaClass callingClass) {
  Type result = null;
  if (getReturns() != null) {
    result =  getReturns().resolve( this.getParentClass(), callingClass );
    
    //According to java-specs, if it could be resolved the upper boundary, so Object, should be returned  
    if ( !resolve && !returns.getFullyQualifiedName().equals( result.getFullyQualifiedName() ) )
    {
      result = new Type( "java.lang.Object" );
    }
  }
  return result;
}

代码示例来源:origin: org.codehaus.mojo/gwt-maven-plugin

/**
 * Determine if a client service method is deprecated.
 * 
 * @see MGWT-352
 */
private boolean isDeprecated( JavaMethod method )
{
  if ( method == null )
    return false;
  for ( Annotation annotation : method.getAnnotations() )
  {
    if ( "java.lang.Deprecated".equals( annotation.getType().getFullyQualifiedName() ) )
    {
      return true;
    }
  }
  return method.getTagByName( "deprecated" ) != null;
}

代码示例来源:origin: com.thoughtworks.qdox/qdox

protected Type[] getParameterTypes ( boolean resolve, JavaClass callingClass) {
    Type[] result = new Type[getParameters().length];

    for (int paramIndex = 0; paramIndex < getParameters().length; paramIndex++ )
    {
      Type curType = getParameters()[paramIndex].getType().resolve( this.getParentClass(), callingClass );
      //According to java-specs, if it could be resolved the upper boundary, so Object, should be returned  
      if ( !resolve && returns != null && !returns.getFullyQualifiedName().equals( curType.getFullyQualifiedName() ) )
      {
        result[paramIndex] = new Type( "java.lang.Object" );
      }
      else {
        result[paramIndex] = curType;
      }
      
    }
    return result;
  }
}

代码示例来源:origin: com.thoughtworks.qdox/qdox

if ( subclass.getSuperClass() != null && fqn.equals( subclass.getSuperClass().getFullyQualifiedName() ) ) {
  result = subclass.getSuperClass().getActualTypeArguments()[typeIndex];    
    if ( fqn.equals( subclass.getImplements()[i].getFullyQualifiedName() ) )

相关文章