com.thoughtworks.qdox.model.Type类的使用及代码示例

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

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

Type介绍

暂无

代码示例

代码示例来源:origin: org.apache.xbean/xbean-spring

private org.apache.xbean.spring.generator.Type toMappingType(Type type, String nestedType) {
  try {
    if (type.isArray()) {
      return org.apache.xbean.spring.generator.Type.newArrayType(type.getValue(), type.getDimensions());
    } else if (type.isA(collectionType)) {
      if (nestedType == null) nestedType = "java.lang.Object";
      return org.apache.xbean.spring.generator.Type.newCollectionType(type.getValue(),
          org.apache.xbean.spring.generator.Type.newSimpleType(nestedType));
    }
  } catch (Throwable t) {
    log.debug("Could not load type mapping", t);
  }
  return org.apache.xbean.spring.generator.Type.newSimpleType(type.getValue());
}

代码示例来源:origin: qdox/qdox

/**
 * @since 1.3
 */
public boolean isA(String fullClassName) {
  Type type = new Type(fullClassName, 0, this);
  return asType().isA(type);
}

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

/**
 * @since 1.3
 */
public boolean isA(Type type) {
  if (this.equals(type)) {
    return true;
  } else {
    JavaClass javaClass = getJavaClass();
    if (javaClass != null) {
      // ask our interfaces
      Type[] implementz = javaClass.getImplements();
      for (int i = 0; i < implementz.length; i++) {
        if (implementz[i].isA(type)) {
          return true;
        }
      }
      // ask our superclass
      Type supertype = javaClass.getSuperClass();
      if (supertype != null) {
        if (supertype.isA(type)) {
          return true;
        }
      }
    }
  }
  // We'we walked up the hierarchy and found nothing.
  return false;
}

代码示例来源:origin: qdox/qdox

public boolean equals(Object obj) {
  if (obj == null) return false;
  Type t = (Type) obj;
  return getValue().equals(t.getValue()) && t.getDimensions() == getDimensions();
}

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

public Object getParameterValue() {
    return type.getValue() + ".class";
  }
}

代码示例来源:origin: org.apache.maven/maven-plugin-tools-java

if ( !type.isArray() )
  pd.setType( type.getValue() );
  StringBuffer value = new StringBuffer( type.getValue() );
  int remaining = type.getDimensions();
    role = field.getType().toString();

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

writer.print( method.getParameterTypes( true )[j].getGenericValue() );
  if ( param.getType().getDimensions() != method.getParameterTypes( true )[j].getDimensions() )
    for ( int dimensions = 0; dimensions < param.getType().getDimensions(); dimensions++ )
if ( method.getReturnType().isVoid() )
else if ( method.getReturnType().isPrimitive() )
  String primitive = method.getReturnType().getGenericValue();
  writer.println( "AsyncCallback<" + WRAPPERS.get( primitive ) + "> callback );" );
  String type = returnType.getGenericValue();
  if ( method.getReturnType().getDimensions() != method.getReturnType( true ).getDimensions() )
    for ( int dimensions = 0; dimensions < method.getReturnType().getDimensions(); dimensions++ )

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

/**
 * @see http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Class.html#toString()
 */
public String toString() {
  StringBuffer sb = new StringBuffer();
  if(asType().isPrimitive() || (Type.VOID.equals(asType()))) {
    sb.append(asType().getValue());
  }
  else {
    sb.append(isInterface() ? "interface" : "class");
    sb.append(" ");
    sb.append(getFullyQualifiedName());
  }
  return sb.toString();
}

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

public String getGenericValue() {
  StringBuffer result = new StringBuffer("<");
  result.append(super.getValue());
  if(bounds != null && bounds.length > 0) {
    result.append(" extends ");
    for(int index = 0; index < bounds.length; index++) {
      if(index > 0) {
        result.append(",");
      }
      result.append(bounds[index].getGenericValue());
    }
  }
  result.append(">");
  return result.toString();
}

代码示例来源:origin: qdox/qdox

result.write(returns.toString());
  result.write(' ');
if (i > 0) result.write(", ");
if (isDeclaration) {
  result.write(parameter.getType().toString());
  if (parameter.isVarArgs()) {
    result.write("...");
  for (int i = 0; i < exceptions.length; i++) {
    if (i > 0) result.write(", ");
    result.write(exceptions[i].getValue());

代码示例来源:origin: qdox/qdox

public JavaClass getJavaClass() {
  JavaClassParent javaClassParent = getJavaClassParent();
  if (javaClassParent == null) {
    return null;
  }
  ClassLibrary classLibrary = javaClassParent.getClassLibrary();
  if (classLibrary == null) {
    return null;
  }
  return classLibrary.getClassByName(getValue());
}

代码示例来源:origin: org.codehaus.mojo.groovy.runtime/groovy-runtime-1.1

assertNodeType(ASSIGN, node);
if (type.isPrimitive()) {
  if (type.getValue().equals("boolean")) {
    initialValue = "false";
    initialValue = "(" + type.getValue() + ") 0";

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

result.append(getReturns().getValue() + " ");
    result.append(",");
  String typeValue = getParameters()[paramIndex].getType().getResolvedValue(getTypeParameters());
  result.append(typeValue);
for(int i = 0; i < exceptions.length; i++) {
  result.append(i==0 ? " throws " : ",");
  result.append(exceptions[i].getValue());

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

int typeIndex = getTypeVariableIndex( parentClass );
if ( typeIndex >= 0 )
  if ( subclass.getSuperClass() != null && fqn.equals( subclass.getSuperClass().getFullyQualifiedName() ) ) {
    result = subclass.getSuperClass().getActualTypeArguments()[typeIndex];    
      if ( fqn.equals( subclass.getImplements()[i].getFullyQualifiedName() ) ) 
        result = subclass.getImplements()[i].getActualTypeArguments()[typeIndex].resolve( subclass.getImplementedInterfaces()[i] );
        break;
  result = new Type( this.fullName, this.name, this.dimensions, this.context );
  for (int i = 0; i < this.getActualTypeArguments().length; i++ )
    result.actualArgumentTypes[i] = this.actualArgumentTypes[i].resolve( parentClass, subclass );

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

public static Type createUnresolved(TypeDef typeDef, int dimensions, JavaClassParent context) {
  return new Type(null, typeDef, dimensions, context);
}

代码示例来源:origin: org.jboss.aop/jboss-aop

for (int k = 0; k < params.length; k++)
 if (!params[k].getName().equals(method.getParameters()[k].getType().toString()))

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

/**
 * @since 1.3
 */
public JavaClass[] getImplementedInterfaces() {
  Type[] type = getImplements();
  JavaClass[] result = new JavaClass[type.length];
  for (int i = 0; i < result.length; i++) {
    result[i] = type[i].getJavaClass();
  }
  return result;
}

代码示例来源: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: apache/fop

JavaClass clazz = method.getParentClass();
if (!method.getReturnType().isVoid()) {
  throw new EventConventionException("All methods of interface "
      + clazz.getFullyQualifiedName() + " must have return type 'void'!");
if (firstType.isPrimitive() || !"source".equals(params[0].getName())) {
  throw new EventConventionException("The first parameter of the method " + methodSig
      + " must be: 'Object source'!");
    JavaParameter p = params[j];
    Class<?> type;
    JavaClass pClass = p.getType().getJavaClass();
    if (p.getType().isPrimitive()) {
      type = PRIMITIVE_MAP.get(pClass.getName());
      if (type == null) {
if (exceptions != null && exceptions.length > 0) {
  JavaClass cl = exceptions[0].getJavaClass();
  methodMeta.setExceptionClass(cl.getFullyQualifiedName());

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

/**
 * @since 1.3
 */
public boolean isA(JavaClass javaClass) {
  return asType().isA(javaClass.asType());
}

相关文章