Matches an AST node if its type is a subtype of the given type.

@param clazz a class representation of the type, e.g., Action.class.
191632
public static <T extends Tree> Matcher<T> isSubtypeOf(Class<?> clazz) {
    return new IsSubtypeOf<>(typeFromClass(clazz));
  }
720554
public static Predicate<Field> inClass(Class<?> clazz) {
        return field -> field.getDeclaringClass().equals(clazz);
    }
1246289
public boolean matches( Class<?> clazz ) {
        // fully qualified import?
        if( this.target.equals( clazz.getName() ) ) {
            return true;
        }

        // wild card imports
        if( this.target.endsWith( ".*" ) ) {
            String prefix = this.target.substring( 0, this.target.indexOf( ".*" ) );

            // package import: import my.package.*
            if( prefix.equals( clazz.getPackage().getName() ) ) {
                return true;
            }

            // inner class imports with wild card?
            // by looking at the ClassTypeResolver class, it seems we do not support
            // the usage of wild cards when importing static inner classes like the
            // java static imports allow
        }
        return false;
    }
569616
public static boolean isProperClass(Class<?> clazz) {
		int mods = clazz.getModifiers();
		return !(Modifier.isAbstract(mods) || Modifier.isInterface(mods) || Modifier.isNative(mods));
	}
194968
public boolean matches(final Node node) {
        if (node.getNodeType() == Node.ELEMENT_NODE) {
            return matches(((Element) node).getAttribute(ATTRIBUTE_NAME_CLASS));
        }
        return false;
    }
306578
private static void registerSimpleTypeSilence(String clazz) {
        try {
            SIMPLE_TYPE_SET.add(Class.forName(clazz));
        } catch (ClassNotFoundException e) {
            //ignore
        }
    }
948337
public static boolean annotationTypeMatches(Class<? extends Annotation> type, JavacNode node) {
		if (node.getKind() != Kind.ANNOTATION) return false;
		return typeMatches(type, node, ((JCAnnotation) node.get()).annotationType);
	}
306402
public static String getTypeName(Class<?> clazz) {
		Type typeAnnotation = clazz.getAnnotation(Type.class);
		return typeAnnotation != null ? typeAnnotation.value() : null;
	}
668889
public static List<Class<?>> getAllClasses(Class<?> clazz) {
        List<Class<?>> types = new ArrayList<>();
        while (clazz != null) {
            types.add(clazz);
            clazz = clazz.getSuperclass();
        }
        return types;
    }
1072476
public ResultMatcher matches(final Matcher<?> matcher) {
        return new AbstractResultMatcher(path, configuration) {
            public void doMatch(Object actual) {
                isPresent(actual);
                Node node = getNode(actual);
                assertThat("Node \"" + path + "\" does not match.", node.getValue(), (Matcher<? super Object>) matcher);
            }
        };

    }
923360
public static Matcher<Class<?>> subclassOf(final Class<?> klazz) {
    return new Matcher<Class<?>>() {

      @Override
      protected boolean matchesSafely(Class<?> t) {
        return klazz.isAssignableFrom(t);
      }

      @Override
      public String toString() {
        return "a subtype of " + klazz;
      }
    };
  }
210654
public String getTypeName(Class<?> clazz) {
		Type type = typeAnnotations.get(clazz);

		if (type != null) {
			return type.value();
		}
		return null;
	}
278701
public static final void registerNodeDataInstance(
			Class<? extends NodeData> clazz) {
		try {
			@SuppressWarnings("unused")
			NodeData test = clazz.newInstance();
			ndImpl = clazz;
		} catch (InstantiationException e) {
			throw new RuntimeException("NodeData implemenation ("
					+ clazz.getName() + ") doesn't provide sole constructor", e);
		} catch (IllegalAccessException e) {
			throw new RuntimeException("NodeData implementation ("
					+ clazz.getName() + ") is not accesible", e);
		}

	}
1255447
public static boolean matchesTypeName(Class<?> clazz, String typeName) {
		return (typeName != null &&
				(typeName.equals(clazz.getName()) || typeName.equals(clazz.getSimpleName()) ||
				(clazz.isArray() && typeName.equals(getQualifiedNameForArray(clazz)))));
	}
304405
public static <S, T> DecomposableMatchBuilder1<S, T> typeOf(Class<T> clazz) {
    List<Matcher<Object>> matchers = new ArrayList<>();
    matchers.add(any()); // The extractor takes care of the matching

    return new DecomposableMatchBuilder1<>(matchers, 0, new TypeOfFieldExtractor<>(clazz));
  }
268828
public <T> Clazz<T> FindClazz( Class<T> clazz )
	{
		if( clazzz == null )
			return null;

		for( Clazz<?> c : clazzz.values() )
			if( c.getReflectedClass() == clazz )
			{
				@SuppressWarnings( "unchecked" )
				Clazz<T> result = (Clazz<T>) c;
				return result;
			}

		return null;
	}
442680
public void setClazz(Class<? extends ElementBase> clazz) {
        this.clazz = clazz;

        try {
            // Force execution of static initializers
            Class.forName(clazz.getName());
        } catch (ClassNotFoundException e) {
            MiscUtil.toUnchecked(e);
        }
    }