Examples of Directive


Examples of com.google.dart.engine.ast.Directive

    NodeList<Directive> directives = node.getDirectives();
    int count = directives.size();
    if (count > 0) {
      HashMap<PrefixElement, ArrayList<ImportDirective>> prefixToDirectivesMap = new HashMap<PrefixElement, ArrayList<ImportDirective>>();
      for (int i = 0; i < count; i++) {
        Directive directive = directives.get(i);
        if (directive instanceof ImportDirective) {
          ImportDirective importDirective = (ImportDirective) directive;
          SimpleIdentifier prefix = importDirective.getPrefix();
          if (prefix != null) {
            Element element = prefix.getStaticElement();
View Full Code Here

Examples of com.google.devtools.moe.client.directives.Directive

    if (args.length < 1) {
      System.err.println("Usage: moe <directive>");
      System.exit(1);
    }

    Directive d = DirectiveFactory.makeDirective(args[0]);
    if (d == null) {
      // DirectiveFactory.makeDirective has failed and reported the error.
      System.exit(1);
    }

    MoeOptions flags = d.getFlags();
    CmdLineParser parser = new CmdLineParser(flags);
    boolean parseError = false;
    try {
      List<String> nextArgs = Lists.newArrayList(args);
      nextArgs.remove(0); // Remove the directive.
      parser.parseArgument(
          processArgs(nextArgs).toArray(new String[] {}));
    } catch (CmdLineException e) {
      logger.log(Level.SEVERE, "Failure", e);
      parseError = true;
    }

    if (flags.shouldDisplayHelp() || parseError) {
      parser.printUsage(System.err);
      System.exit(parseError ? 1 : 0);
    }

    try {
      int result = d.perform();
      Ui.Task terminateTask = AppContext.RUN.ui.pushTask(
          Ui.MOE_TERMINATION_TASK_NAME, "Final clean-up");
      AppContext.RUN.fileSystem.cleanUpTempDirs();
      AppContext.RUN.ui.popTask(terminateTask, "");
      System.exit(result);
View Full Code Here

Examples of org.apache.felix.utils.manifest.Directive

      Attribute[] attribute = new Attribute[0];
        Clause clause = new Clause("org.apache.karaf.test", directive, attribute);
        assertFalse(ManifestUtils.isOptional(clause));

        directive = new Directive[1];
        directive[0] = new Directive("resolution", "mandatory");
        clause = new Clause("org.apache.karaf.test", directive, attribute);
       
        assertFalse(ManifestUtils.isOptional(clause));

        directive[0] = new Directive("resolution", "optional");
        clause = new Clause("org.apache.karaf.test", directive, attribute);
        assertTrue(ManifestUtils.isOptional(clause));
    }
View Full Code Here

Examples of org.apache.felix.utils.manifest.Directive

      Attribute[] attribute = new Attribute[0];
        Clause clause = new Clause("org.apache.karaf.test", directive, attribute);
        assertFalse(ManifestUtils.isOptional(clause));

        directive = new Directive[1];
        directive[0] = new Directive("resolution", "mandatory");
        clause = new Clause("org.apache.karaf.test", directive, attribute);
       
        assertFalse(ManifestUtils.isOptional(clause));

        directive[0] = new Directive("resolution", "optional");
        clause = new Clause("org.apache.karaf.test", directive, attribute);
        assertTrue(ManifestUtils.isOptional(clause));
    }
View Full Code Here

Examples of org.apache.flex.forks.velocity.runtime.directive.Directive

    ASTDirective jjtn000 = new ASTDirective(this, JJTDIRECTIVE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);Token t = null;
    int argType;
    int argPos = 0;
    Directive d;
    int directiveType;
    boolean isVM = false;
    boolean doItNow = false;
    try {
      /*
           * note that if we were escaped, that is now handled by
           * EscapedDirective()
           */
          t = jj_consume_token(WORD);
        String directiveName = t.image.substring(1);

        d = (Directive) directives.get(directiveName);

        /*
         *  Velocimacro support : if the directive is macro directive
         *   then set the flag so after the block parsing, we add the VM
         *   right then. (So available if used w/in the current template )
         */

        if (directiveName.equals("macro"))
        {
             doItNow = true;
        }

        /*
         * set the directive name from here.  No reason for the thing to know
         * about parser tokens
         */

        jjtn000.setDirectiveName(directiveName);

        if ( d == null)
        {         
            /*
             *  if null, then not a real directive, but maybe a Velocimacro

            isVM = rsvc.isVelocimacro(directiveName, currentTemplateName);

            if (!isVM)
            {
                token_source.stateStackPop();
                token_source.inDirective = false;
                {if (true) return jjtn000;}
            }

             */

            /*
             *  Currently, all VMs are LINE directives
             */

            directiveType = Directive.LINE;
        }
        else
        {
            directiveType = d.getType();
        }

        /*
         *  now, switch us out of PRE_DIRECTIVE
         */
 
View Full Code Here

Examples of org.apache.flex.forks.velocity.runtime.directive.Directive

    ASTDirective jjtn000 = new ASTDirective(this, JJTDIRECTIVE);
    boolean jjtc000 = true;
    jjtree.openNodeScope(jjtn000);Token t = null;
    int argType;
    int argPos = 0;
    Directive d;
    int directiveType;
    boolean isVM = false;
    boolean doItNow = false;
    try {
      /*
           * note that if we were escaped, that is now handled by
           * EscapedDirective()
           */
          t = jj_consume_token(WORD);
        String directiveName = t.image.substring(1);

        d = (Directive) directives.get(directiveName);

        /*
         *  Velocimacro support : if the directive is macro directive
         *   then set the flag so after the block parsing, we add the VM
         *   right then. (So available if used w/in the current template )
         */

        if (directiveName.equals("macro"))
        {
             doItNow = true;
        }

        /*
         * set the directive name from here.  No reason for the thing to know
         * about parser tokens
         */

        jjtn000.setDirectiveName(directiveName);

        if ( d == null)
        {         
            /*
             *  if null, then not a real directive, but maybe a Velocimacro

            isVM = rsvc.isVelocimacro(directiveName, currentTemplateName);

            if (!isVM)
            {
                token_source.stateStackPop();
                token_source.inDirective = false;
                {if (true) return jjtn000;}
            }

             */

            /*
             *  Currently, all VMs are LINE directives
             */

            directiveType = Directive.LINE;
        }
        else
        {
            directiveType = d.getType();
        }

        /*
         *  now, switch us out of PRE_DIRECTIVE
         */
 
View Full Code Here

Examples of org.apache.flex.forks.velocity.runtime.directive.Directive

        {
            Object o = Class.forName( directiveClass ).newInstance();
           
            if ( o instanceof Directive )
            {
                Directive directive = (Directive) o;
                runtimeDirectives.put(directive.getName(), directive);
                   
                info("Loaded " + caption + " Directive: "
                    + directiveClass);
            }
            else
View Full Code Here

Examples of org.apache.james.jspf.core.Directive

                    Object mech = lookupAndCreateTerm(termMatcher,
                            TERM_STEP_REGEX_MECHANISM_POS);

                    result.getDirectives().add(
                            new Directive(qualifier, (Mechanism) mech, log.getChildLogger(qualifier+"directive")));

                }

            }
        }
View Full Code Here

Examples of org.apache.james.jspf.core.Directive

                    public synchronized IncludeMechanism setHost(String host) {
                        this.host = host;
                        return this;
                    }
                }.setHost(TRUSTED_FORWARDER_HOST);
                spfRecord.getDirectives().add(spfRecord.getDirectives().size()-1, new Directive(null, trusted, log.getChildLogger("trustedforwarder")));
            } catch (PermErrorException e) {
                // will never happen
            }
        }
        return spfRecord;
View Full Code Here

Examples of org.apache.james.jspf.terms.Directive

                    Object mech = lookupAndCreateTerm(termMatcher,
                            TERM_STEP_REGEX_MECHANISM_POS);

                    result.getDirectives().add(
                            new Directive(qualifier, (Mechanism) mech, log.getChildLogger(qualifier+"directive")));

                }

            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.