static List<IConstructorInfo> generateAnnotationConstructors( IRelativeTypeInfo backingClass ) { AnnotationConstructorGenerator gen = new AnnotationConstructorGenerator( backingClass ); List<? extends IMethodInfo> declaredMethods = backingClass.getDeclaredMethods(); IMethodInfo[] methods = declaredMethods.toArray( new IMethodInfo[declaredMethods.size()] ); sortMethods( methods ); ArrayList<IConstructorInfo> constructorInfoArrayList = new ArrayList<IConstructorInfo>(); //## todo: Are the "legacy" ctors needed? gen.addLegacyConstructors( methods, constructorInfoArrayList ); constructorInfoArrayList.add( gen.makeStandardAnnotationConstructor( methods ) ); return constructorInfoArrayList; }
private static String[] getNamesForJavaAnnotation( IType type ) { IRelativeTypeInfo rTypeInfo = (IRelativeTypeInfo)type.getTypeInfo(); List<IMethodInfo> methodInfos = new ArrayList<IMethodInfo>( rTypeInfo.getDeclaredMethods() ); Collections.sort( methodInfos, new Comparator<IMethodInfo>() { @Override public int compare( IMethodInfo o1, IMethodInfo o2 ) { return o1.getName().compareTo( o2.getName() ); } } ); String[] strings = new String[methodInfos.size()]; for( int i = 0; i < methodInfos.size(); i++ ) { IMethodInfo methodInfo = methodInfos.get( i ); strings[i] = methodInfo.getDisplayName(); } return strings; }
private void compileAnnotationInfo( IRAnnotation anno ) { IAnnotationInfo gai = anno.getValue(); if( gai != null ) { IType classInfo = gai.getType(); List<? extends IMethodInfo> methods = ((IRelativeTypeInfo)classInfo.getTypeInfo()).getDeclaredMethods(); for( IMethodInfo method : methods ) { if( method.getParameters().length == 0 ) { String fieldName = method.getDisplayName(); if( !fieldName.equals( "hashCode" ) && !fieldName.equals( "toString" ) && !fieldName.equals( "annotationType" ) ) { IRType returnIRType = AbstractElementTransformer.getDescriptor( method.getReturnType() ); Object value = gai.getFieldValue( fieldName ); visitAnnotationField( _visitor, method.getReturnType(), fieldName, returnIRType, value ); } } } } _visitor.visitEnd(); }
mergeMethods(privateMethods, convertType( getSuperType() ), true); List<? extends IMethodInfo> declaredMethods = _typeInfo.getDeclaredMethods(); for (IMethodInfo methodInfo : declaredMethods) { mergeMethod(privateMethods, methodInfo, true);
mergeMethods(privateMethods, convertType( _typeInfo.getOwnersType().getSupertype()), true); List<? extends IMethodInfo> declaredMethods = _typeInfo.getDeclaredMethods(); for (IMethodInfo methodInfo : declaredMethods) { mergeMethod(privateMethods, methodInfo, true);
List<? extends IMethodInfo> declaredMethods = ((IRelativeTypeInfo)type.getTypeInfo()).getDeclaredMethods(); for( IMethodInfo mi : declaredMethods )
ITypeInfo ti = type.getTypeInfo(); if( ti instanceof IRelativeTypeInfo ) { for( IMethodInfo csr : ((IRelativeTypeInfo)ti).getDeclaredMethods() ) { if( "compareTo".equals( csr.getDisplayName() ) ) { IParameterInfo[] params = csr.getParameters();
for( IMethodInfo methodInfo : gosuClass.getTypeInfo().getDeclaredMethods() )
AnnotationVisitor nestedVisitor = annotationVisitor.visitAnnotation( name, IRTypeFactory.get( ai.getType() ).getDescriptor() ); for( IMethodInfo mi: ((IRelativeTypeInfo)ai.getType().getTypeInfo()).getDeclaredMethods() )