Package org.sonar.core.persistence.migration.v45

Examples of org.sonar.core.persistence.migration.v45.Rule


            String segment = currTextSegment.toString();
            List<Rule> parentMatches = getMatches().peek();
            int len = parentMatches.size();
            for ( int i = 0; i < len; ++i )
            {
                Rule r = parentMatches.get( i );
                if ( r instanceof TextSegmentHandler )
                {
                    TextSegmentHandler h = (TextSegmentHandler) r;
                    try
                    {
View Full Code Here


    {

        @Override
        protected void configure()
        {
            forPattern( "bar" ).addRule( new Rule()
            {

                @Override
                public void body( String namespace, String name, String text )
                    throws Exception
View Full Code Here

            Log log = getDigester().getLogger();
            boolean debug = log.isDebugEnabled();
            for ( int i = 0; i < rules.size(); i++ )
            {
                int j = ( rules.size() - i ) - 1;
                Rule rule = rules.get( j );
                if ( debug )
                {
                    log.debug( "  Fire end() for " + rule );
                }
                try
                {
                    rule.end( namespaceURI, name );
                }
                catch ( Exception e )
                {
                    throw getDigester().createSAXException( e );
                }
View Full Code Here

    Timer timer = new Timer("Db Migration Progress");
    timer.schedule(progressTask, MassUpdate.ProgressTask.PERIOD_MS, MassUpdate.ProgressTask.PERIOD_MS);

    DbSession session = db.openSession(false);
    try {
      Migration45Mapper mapper = session.getMapper(Migration45Mapper.class);

      List<RuleParameter> templateRuleParams = mapper.selectAllTemplateRuleParameters();
      Multimap<Integer, RuleParameter> templateRuleParamsByRuleId = ArrayListMultimap.create();
      for (RuleParameter templateRuleParam : templateRuleParams) {
        templateRuleParamsByRuleId.put(templateRuleParam.getRuleId(), templateRuleParam);
      }

      List<Rule> customRules = mapper.selectAllCustomRules();
      Multimap<Integer, Integer> customRuleIdsByTemplateRuleId = HashMultimap.create();
      for (Rule customRule : customRules) {
        customRuleIdsByTemplateRuleId.put(customRule.getTemplateId(), customRule.getId());
      }

      List<RuleParameter> customRuleParams = mapper.selectAllCustomRuleParameters();
      Multimap<Integer, RuleParameter> customRuleParamsByRuleId = ArrayListMultimap.create();
      for (RuleParameter customRuleParam : customRuleParams) {
        customRuleParamsByRuleId.put(customRuleParam.getRuleId(), customRuleParam);
      }
View Full Code Here

    Multimap<Integer, RuleParameter> customRuleParamsByRuleId,
    DbSession session) {
    for (Integer customRuleId : customRuleIdsByTemplateRuleId.get(templateRuleId)) {
      if (!hasParameter(templateRuleParam.getName(), customRuleParamsByRuleId.get(customRuleId))) {
        // Insert new custom rule parameter
        session.getMapper(Migration45Mapper.class).insertRuleParameter(new RuleParameter()
          .setRuleId(customRuleId)
          .setRuleTemplateId(templateRuleId)
          .setName(templateRuleParam.getName())
          .setDescription(templateRuleParam.getDescription())
          .setType(templateRuleParam.getType())
View Full Code Here

   */
  public String graph() throws Exception {
    StringBuffer text = new StringBuffer();
   
    text.append("digraph M5Tree {\n");
    Rule temp = (Rule)m_ruleSet.elementAt(0);
    temp.topOfTree().graph(text);
    text.append("}\n");
    return text.toString();
  }
View Full Code Here

TOP

Related Classes of org.sonar.core.persistence.migration.v45.Rule

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.