Package com.gwtplatform.mvp.client.annotations

Examples of com.gwtplatform.mvp.client.annotations.NameToken


    private void handleRuntimeExtensions(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(RuntimeExtension.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                RuntimeExtension extension = element.getAnnotation(RuntimeExtension.class);
                if (nameToken != null) {
                    System.out.println("Runtime Extension: " + extension.name() + " -> " + nameToken.value());
                    RuntimeExtensionMetaData declared = new RuntimeExtensionMetaData(
                            extension.name(), nameToken.value(),
                            extension.group(), extension.key()
                    );
                    runtimeExtensions.add(declared);
                }
            }
View Full Code Here


    private void handleSubsystemElement(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(SubsystemExtension.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                SubsystemExtension subsystem = element.getAnnotation(SubsystemExtension.class);
                if (nameToken != null) {
                    System.out.println("Subsystem: " + subsystem.name() + " -> " + nameToken.value());
                    SubsystemExtensionMetaData declared = new SubsystemExtensionMetaData(
                            subsystem.name(), nameToken.value(),
                            subsystem.group(), subsystem.key()
                    );

                    subsystemDeclararions.add(declared);
                    if (!nameTokens.add(nameToken.value())) {
                        throw new RuntimeException("Duplicate name token '" + nameToken.value() + "' declared on '"
                                + element.asType());
                    }
                }
            }
        }
View Full Code Here

        {
            final String annotationType = mirror.getAnnotationType().toString();

            if ( annotationType.equals(NameToken.class.getName()) )
            {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                AccessControl accessControl = element.getAnnotation(AccessControl.class);

                if(accessControl!=null)   {

                    for(String resourceAddress : accessControl.resources())
                    {
                        AccessControlMetaData declared = new AccessControlMetaData(
                                nameToken.value(), resourceAddress
                        );

                        declared.setRecursive(accessControl.recursive());

                        accessControlDeclararions.add(declared);
                    }

                    for(String opString : accessControl.operations())
                    {

                        if(!opString.contains("#"))
                            throw new IllegalArgumentException("Invalid operation string:"+ opString);

                        BootstrapOperation op = new BootstrapOperation(
                                nameToken.value(), opString
                        );
                        bootstrapOperations.add(op);
                    }


                }
                else if(element.getAnnotation(NoGatekeeper.class)==null)
                {
                    Name simpleName = element.getEnclosingElement()!=null ? element.getEnclosingElement().getSimpleName() : element.getSimpleName();
                    System.out.println(simpleName +"(#"+nameToken.value()+")" +" is missing @AccessControl annotation!");
                }
            }
        }
    }
View Full Code Here

    private void handleRuntimeExtensions(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(RuntimeExtension.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                RuntimeExtension extension = element.getAnnotation(RuntimeExtension.class);
                if (nameToken != null) {
                    System.out.println("Runtime Extension: " + extension.name() + " -> " + nameToken.value());
                    RuntimeExtensionMetaData declared = new RuntimeExtensionMetaData(
                            extension.name(), nameToken.value(),
                            extension.group(), extension.key()
                    );
                    runtimeExtensions.add(declared);
                }
            }
View Full Code Here

    private void handleSubsystemElement(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(SubsystemExtension.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                SubsystemExtension subsystem = element.getAnnotation(SubsystemExtension.class);
                if (nameToken != null) {
                    System.out.println("Subsystem: " + subsystem.name() + " -> " + nameToken.value());
                    SubsystemExtensionMetaData declared = new SubsystemExtensionMetaData(
                            subsystem.name(), nameToken.value(),
                            subsystem.group(), subsystem.key()
                    );

                    subsystemDeclararions.add(declared);
                    if (!nameTokens.add(nameToken.value())) {
                        throw new RuntimeException("Duplicate name token '" + nameToken.value() + "' declared on '"
                                + element.asType());
                    }
                }
            }
        }
View Full Code Here

        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();

            if (annotationType.equals(NameToken.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                AccessControl accessControl = element.getAnnotation(AccessControl.class);

                if (accessControl != null) {

                    for (String resourceAddress : accessControl.resources()) {
                        AccessControlMetaData declared = new AccessControlMetaData(
                                nameToken.value(), resourceAddress
                        );

                        declared.setRecursive(accessControl.recursive());

                        accessControlDeclararions.add(declared);
                    }

                    for (String opString : accessControl.operations()) {

                        if (!opString.contains("#")) {
                            throw new IllegalArgumentException("Invalid operation string:" + opString);
                        }

                        BootstrapOperation op = new BootstrapOperation(
                                nameToken.value(), opString
                        );
                        bootstrapOperations.add(op);
                    }


                } else if (element.getAnnotation(NoGatekeeper.class) == null) {
                    Name simpleName = element.getEnclosingElement() != null ? element.getEnclosingElement()
                            .getSimpleName() : element.getSimpleName();
                    System.out.println(
                            simpleName + "(#" + nameToken.value() + ")" + " is missing @AccessControl annotation!");
                }
            }
        }
    }
View Full Code Here

        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();

            if (annotationType.equals(NameToken.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                AccessControl accessControl = element.getAnnotation(AccessControl.class);
                SearchIndex searchIndex = element.getAnnotation(SearchIndex.class);
                OperationMode operationMode = element.getAnnotation(OperationMode.class);

                if (accessControl != null) {
                    boolean standalone = true;
                    boolean domain = true;
                    String[] keywords = null;
                    boolean include = true;
                    if (searchIndex != null) {
                        keywords = searchIndex.keywords();
                        include = !searchIndex.exclude();
                    }
                    if (operationMode != null) {
                        standalone = operationMode.value() == OperationMode.Mode.STANDALONE;
                        domain = operationMode.value() == OperationMode.Mode.DOMAIN;
                    }
                    if (include) {
                        // excluded presenters are not part of the metadata!
                        SearchIndexMetaData searchIndexMetaData = new SearchIndexMetaData(nameToken.value(), standalone,
                                domain, accessControl.resources(), keywords);
                        searchIndexDeclarations.add(searchIndexMetaData);
                    }
                }
            }
View Full Code Here

    private void handleRuntimeExtensions(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(RuntimeExtension.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                RuntimeExtension extension = element.getAnnotation(RuntimeExtension.class);
                if (nameToken != null) {
                    System.out.println("Runtime Extension: " + extension.name() + " -> " + nameToken.value());
                    RuntimeExtensionMetaData declared = new RuntimeExtensionMetaData(
                            extension.name(), nameToken.value(),
                            extension.group(), extension.key()
                    );
                    runtimeExtensions.add(declared);
                }
            }
View Full Code Here

    private void handleSubsystemElement(Element element) {
        List<? extends AnnotationMirror> annotationMirrors = element.getAnnotationMirrors();
        for (AnnotationMirror mirror : annotationMirrors) {
            final String annotationType = mirror.getAnnotationType().toString();
            if (annotationType.equals(SubsystemExtension.class.getName())) {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                SubsystemExtension subsystem = element.getAnnotation(SubsystemExtension.class);
                if (nameToken != null) {
                    System.out.println("Subsystem: " + subsystem.name() + " -> " + nameToken.value());
                    SubsystemExtensionMetaData declared = new SubsystemExtensionMetaData(
                            subsystem.name(), nameToken.value(),
                            subsystem.group(), subsystem.key()
                    );

                    subsystemDeclararions.add(declared);
                    if (!nameTokens.add(nameToken.value())) {
                        throw new RuntimeException("Duplicate name token '" + nameToken.value() + "' declared on '"
                                + element.asType());
                    }
                }
            }
        }
View Full Code Here

    String nameToken = null;
    String newPlaceCode = null; // TODO Get rid of this when we remove @PlaceInstance
    String getGatekeeperMethod = null;
    String title = null;
    if (proxyInterface.isAssignableTo(basePlaceClass)) {
      NameToken nameTokenAnnotation = proxyInterface.getAnnotation(NameToken.class);
      if (nameTokenAnnotation == null) {
        logger.log(TreeLogger.ERROR,
            "The proxy for '" + presenterClassName
                + "' is a Place, but is not annotated with @' +"
                + NameToken.class.getSimpleName() + ".", null);
        throw new UnableToCompleteException();
      }
      nameToken = nameTokenAnnotation.value();

      UseGatekeeper gatekeeperAnnotation = proxyInterface.getAnnotation(UseGatekeeper.class);
      if (gatekeeperAnnotation != null) {
        String gatekeeperName = gatekeeperAnnotation.value().getCanonicalName();
        JClassType customGatekeeperClass = oracle.findType(gatekeeperName);
View Full Code Here

TOP

Related Classes of com.gwtplatform.mvp.client.annotations.NameToken

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.