Package com.gwtplatform.mvp.client.annotations

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


     */
    private static Map<String, JClassType> findPlaceTokens(final GeneratorContext generatorContext) {
        Map<String, JClassType> placeTokens = new HashMap<String, JClassType>();

        for (JClassType type : generatorContext.getTypeOracle().getTypes()) {
            NameToken nameTokenAnnotation = type.getAnnotation(NameToken.class);
            if (nameTokenAnnotation != null) {
                placeTokens.put(nameTokenAnnotation.value(), type);
            }
        }

        return placeTokens;
    }
View Full Code Here


        }
    }

    private void findNameToken(JClassType proxyInterface)
            throws UnableToCompleteException {
        NameToken nameTokenAnnotation = proxyInterface.getAnnotation(NameToken.class);
        if (nameTokenAnnotation == null) {
            logger.log(TreeLogger.ERROR,
                    "The proxy for '" + presenterInspector.getPresenterClassName()
                            + "' is a Place, but is not annotated with @' +"
                            + NameToken.class.getSimpleName() + ".", null);
            throw new UnableToCompleteException();
        }
        nameToken = nameTokenAnnotation.value();
    }
View Full Code Here

        {
            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

        {
            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

    }
  }

  private void findNameToken(JClassType proxyInterface)
      throws UnableToCompleteException {
    NameToken nameTokenAnnotation = proxyInterface.getAnnotation(NameToken.class);
    if (nameTokenAnnotation == null) {
      logger.log(TreeLogger.ERROR,
          "The proxy for '" + presenterInspector.getPresenterClassName()
              + "' is a Place, but is not annotated with @' +"
              + NameToken.class.getSimpleName() + ".", null);
      throw new UnableToCompleteException();
    }
    nameToken = nameTokenAnnotation.value();
  }
View Full Code Here

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

            if ( annotationType.equals(Subsystem.class.getName()) )
            {
                NameToken nameToken = element.getAnnotation(NameToken.class);
                Subsystem subsystem = element.getAnnotation(Subsystem.class);

                if(nameToken!=null)   {
                    System.out.println("Subsystem: " + subsystem.name() +" -> "+nameToken.value());

                    SubsystemExtension declared = new SubsystemExtension(
                            subsystem.name(), nameToken.value(),
                            subsystem.group(), subsystem.key()
                    );

                    declararions.add(declared);
                }
View Full Code Here

        {
            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

        {
            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

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.