Package org.apache.commons.weaver.model

Examples of org.apache.commons.weaver.model.ScanRequest


    @Override
    public boolean clean(WeaveEnvironment environment, Scanner scanner) {
        boolean result = false;

        final ScanRequest scanRequest =
            new ScanRequest().add(WeaveInterest.of(TestAnnotation.class, ElementType.TYPE)).add(
                WeaveInterest.of(TestAnnotation.class, ElementType.METHOD));

        for (WeavableClass<?> weavableClass : scanner.scan(scanRequest).getClasses()) {
            if (environment.deleteClassfile(weavableClass.getTarget())) {
                result = true;
View Full Code Here


        String configValue = environment.config.getProperty("configKey");

        Assert.assertEquals("configValue", configValue);
        boolean result = false;

        final ScanRequest scanRequest =
            new ScanRequest().add(WeaveInterest.of(TestAnnotation.class, ElementType.TYPE))
                .add(WeaveInterest.of(TestAnnotation.class, ElementType.METHOD))
                .addSupertypes(AbstractTestBean.class, TestBeanInterface.class);

        final ScanResult scanResult = scanner.scan(scanRequest);
View Full Code Here

    public boolean clean(final WeaveEnvironment environment, final Scanner scanner) {
        final Privilizer privilizer = new Privilizer(environment);

        final List<String> toDelete = new ArrayList<String>();

        final ScanRequest scanRequest = new ScanRequest().add(WeaveInterest.of(Privilized.class, ElementType.TYPE));

        environment.debug("Cleaning classes privilized with policy other than %s", privilizer.policy);
        for (final WeavableClass<?> weavableClass : scanner.scan(scanRequest).getClasses().with(Privilized.class)) {
            final Policy privilizedPolicy = Policy.valueOf(weavableClass.getAnnotation(Privilized.class).value());
            if (privilizedPolicy == privilizer.policy) {
View Full Code Here

        final Set<Class<?>> privilizedTypes = new LinkedHashSet<Class<?>>();

        // handle blueprints:
        for (final WeavableClass<?> type : scanner.scan(
            new ScanRequest().add(WeaveInterest.of(Privilizing.class, ElementType.TYPE))).getClasses()) {

            final Class<?> target = type.getTarget();
            if (privilizedTypes.add(target) && validateRequest(privilizer, type)) {
                privilizer.blueprint(target, type.getAnnotation(Privilizing.class));
            }
        }

        // handle remaining classes declaring @Privileged methods:

        for (final WeavableClass<?> type : scanner.scan(
            new ScanRequest().add(WeaveInterest.of(Privileged.class, ElementType.METHOD))).getClasses()) {
            final Class<?> target = type.getTarget();
            if (privilizedTypes.add(target) && validateRequest(privilizer, type)) {
                privilizer.privilize(target);
            }
        }
View Full Code Here

     * @param scanner to use
     * @return {@link Set} of {@link Class}
     * @see #segregate(Iterable)
     */
    private Set<Class<?>> getBroadlyEligibleSubclasses(final Class<?> supertype, final Scanner scanner) {
        final ScanResult scanResult = scanner.scan(new ScanRequest().addSupertypes(supertype));
        final Set<Class<?>> result = new LinkedHashSet<Class<?>>();
        for (final WeavableClass<?> cls : scanResult.getClasses()) {
            final Class<?> subtype = cls.getTarget();
            final IneligibilityReason reason;
            if (!subtype.isAnonymousClass()) {
View Full Code Here

TOP

Related Classes of org.apache.commons.weaver.model.ScanRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.