Examples of Rule


Examples of org.opengis.style.Rule

        assertNotNull("parsed xml", parsed);
        assertTrue("parsed xml into style", parsed.length > 0);

        Style style = parsed[0];
        assertNotNull(style);
        Rule rule = style.featureTypeStyles().get(0).rules().get(0);
        LineSymbolizer lineSymbolize = (LineSymbolizer) rule.symbolizers().get(0);
        Stroke stroke = lineSymbolize.getStroke();

        Expression color = stroke.getColor();
        Color value = color.evaluate(null, Color.class);
        assertNotNull("color", value);
View Full Code Here

Examples of org.openhab.model.rule.rules.Rule

   
    if(modelRepository!=null && scriptEngine!=null) {
      EObject model = modelRepository.getModel(modelName);
      if (model instanceof RuleModel) {
        RuleModel ruleModel = (RuleModel) model;
        Rule rule = getRule(ruleModel, ruleName);
        if(rule!=null) {
          Script script = scriptEngine.newScriptFromXExpression(rule.getScript());
          logger.debug("Executing scheduled rule '{}'", rule.getName());
          try {
            script.execute(RuleContextHelper.getContext(rule));
          } catch (ScriptExecutionException e) {
            logger.error("Error during the execution of rule {}", rule.getName(), e.getCause());
          }
        } else {
          logger.debug("Scheduled rule '{}' does not exist", ruleName);
        }
      } else {
View Full Code Here

Examples of org.openxri.xri3.impl.parser.Rule

public class PrintTest {

  public static void main(String[] args) {
   
    Parser parser = new Parser();
    Rule rule = parser.parse("xri", "@cordance/documentation/xri?page=overview#introduction");
    new TreeDisplayer(System.out).visit(rule);
  }
View Full Code Here

Examples of org.openxri.xri3.impl.parser.Rule$xri

public class PrintTest {

  public static void main(String[] args) throws IllegalArgumentException, ParserException {

    Rule$xri rule = (Rule$xri) Parser.parse("xri", "@cordance/documentation/xri?page=overview#introduction");
    new XmlDisplayer().visit(rule);
  }
View Full Code Here

Examples of org.parboiled.Rule

            anotherProxy.arm(this);
            return anotherProxy;
        }

        // we already have a target to which we can directly apply the label
        Rule inner = unwrap(target);
        target = (Matcher) inner.label(label); // since relabelling might change the instance we have to update it
        setLabel(null);
        return target;
    }
View Full Code Here

Examples of org.pdf4j.saxon.trans.Rule

                while (tc != null) {
                    tc = tc.processLeavingTail();
                }

                // find the template rule for this node
                Rule rule = controller.getRuleManager().getTemplateRule(node, mode, context);

                if (rule==null) {             // Use the default action for the node
                                              // No need to open a new stack frame!
                    defaultAction(node, parameters, tunnelParameters, context, backwardsCompatible, locationId);

                } else {
                    Template template = (Template)rule.getAction();
                    TraceListener traceListener = controller.getTraceListener();
                    context.setLocalParameters(parameters);
                    context.setTunnelParameters(tunnelParameters);
                    context.openStackFrame(template.getStackFrameMap());
                    traceListener.startCurrentItem(node);
                    tc = template.applyLeavingTail(context, rule);
                    traceListener.endCurrentItem(node);
                }
            }

        } else {    // not tracing

            context.setCurrentIterator(iterator);
            context.setCurrentMode(mode);
            boolean lookahead = (iterator.getProperties() & SequenceIterator.LOOKAHEAD) != 0;
            Template previousTemplate = null;
            while(true) {

                // process any tail calls returned from previous nodes. We need to do this before changing
                // the context. If we have a LookaheadIterator, we can tell whether we're positioned at the
                // end without changing the current position, and we can then return the last tail call to
                // the caller and execute it further down the stack, reducing the risk of running out of stack
                // space. In other cases, we need to execute the outstanding tail calls before moving the iterator

                if (tc != null) {
                    if (lookahead && !((LookaheadIterator)iterator).hasNext()) {
                        break;
                    }
                    do {
                        tc = tc.processLeavingTail();
                    } while (tc != null);
                }

                NodeInfo node = (NodeInfo)iterator.next();
                        // We can assume it's a node - we did static type checking
                if (node == null) {
                    break;
                }

                // find the template rule for this node

                Rule rule = controller.getRuleManager().getTemplateRule(node, mode, context);

                if (rule==null) {             // Use the default action for the node
                                            // No need to open a new stack frame!
                    defaultAction(node, parameters, tunnelParameters, context, backwardsCompatible, locationId);

                } else {
                    Template template = (Template)rule.getAction();
                    if (template != previousTemplate) {
                        // Reuse the previous stackframe unless it's a different template rule
                        previousTemplate = template;
                        context.openStackFrame(template.getStackFrameMap());
                        context.setLocalParameters(parameters);
View Full Code Here

Examples of org.roolie.Rule

    new InstanceFactory<Rule>();

  public Rule getRule(RuleImplElmt ruleImplConfig)
  {
    final String ruleName = ruleImplConfig.getRuleName();
    Rule rule = ruleInstances.get(ruleName);
    if (null == rule)
    {
      final String ruleClass = ruleImplConfig.getRuleClass();
      rule = ruleInstanceFactory.newInstance(ruleClass);
      setProperties(rule, ruleImplConfig);
View Full Code Here

Examples of org.sbml.jsbml.Rule

    assertTrue(M.getReactionCount() == 1);
  }

  @Test
  public void test_Model_addRules() throws ParseException {
    Rule r1 = new AlgebraicRule(2, 4);
    AssignmentRule r2 = new AssignmentRule(2, 4);
    RateRule r3 = new RateRule(2, 4);
    r2.setVariable("r2");
    r3.setVariable("r3");
    r1.setMath(ASTNode.parseFormula("2"));
    r2.setMath(ASTNode.parseFormula("2"));
    r3.setMath(ASTNode.parseFormula("2"));
    M.addRule(r1);
    M.addRule(r2);
    M.addRule(r3);
View Full Code Here

Examples of org.sonar.api.batch.rule.Rule

      .build();
  }

  private boolean initAndAddIssue(DefaultIssue issue, @Nullable Violation violation) {
    RuleKey ruleKey = issue.ruleKey();
    Rule rule = rules.find(ruleKey);
    validateRule(issue, rule);
    ActiveRule activeRule = activeRules.find(ruleKey);
    if (activeRule == null) {
      // rule does not exist or is not enabled -> ignore the issue
      return false;
View Full Code Here

Examples of org.sonar.api.rules.Rule

      }
    });
    return Multimaps.index(newIssues, new Function<Issue, RulePriority>() {
      @Override
      public RulePriority apply(Issue issue) {
        Rule rule = ruleFinder.findByKey(issue.ruleKey());
        return rule.getSeverity();
      }
    });
  }
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.