Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package net.sf.alchim.codeplus.spoonchecker;
 
 import java.util.Set;
 
public class TypeReferenceProcessor extends AbstractProcessor<CtType<?>> {
    public void process(CtType<?> type) {
        Set<CtTypeReference<?>> typeRefs = type.getUsedTypes(true);
/*		for (CtTypeReference<?> typeRef : Query
                .getReferences(type, new ReferenceTypeFilter<CtTypeReference>(
                        CtTypeReference.class))) {
            if (!(typeRef.isPrimitive()
                    || (typeRef instanceof CtArrayTypeReference)
                    || typeRef.toString().equals(CtTypeReference.NULL_TYPE_NAME) || (typeRef
                    .getPackage() != null && "java.lang".equals(typeRef
                    .getPackage().toString())))
                    && !typeRef.getPackage().equals(
                            type.getPackage().getReference())) {
                typeRefs.add(typeRef);
            }
        }
*/		if (typeRefs.size() > 0) {
            "type " + type.getReference() + " uses " + typeRefs);
    }
    public static Set<CtTypeReference<?>> getTypeReferences(CtType type) {
        ..print(type.getReference() + " => ");
        Set<CtTypeReference<?>> typeRefs = new HashSet<CtTypeReference<?>>();
        for (CtTypeReference<?> typeRef : Query
                .getReferences(typenew ReferenceTypeFilter<CtTypeReference>(
                        CtTypeReference.class))) {
            if (!(typeRef.isPrimitive()
                    || (typeRef instanceof CtArrayTypeReference)
                    || typeRef.toString().equals(.) || ((typeRef
                    .getPackage() != null) && "java.lang".equals(typeRef
                    .getPackage().toString())))
                    && !typeRef.getPackage().equals(
                            type.getPackage().getReference())) {
                typeRefs.add(typeRef);
            }
        }
        ..println(typeRefs);
        return typeRefs;
    }
New to GrepCode? Check out our FAQ X