Examples of IRestrictionFactory


Examples of net.sf.logsaw.core.query.IRestrictionFactory

        IMemento[] clauses = filterElem.getChildren(ELEM_CLAUSE);
        for (final IMemento clauseElem : clauses) {
          ALogEntryField<?, ?> fld = log.getDialect().getFieldProvider().findField(
              clauseElem.getString(ATTRIB_FIELD));
          final Operator op = Operators.getOperator(clauseElem.getInteger(ATTRIB_OPERATOR));
          final IRestrictionFactory rf = CorePlugin.getDefault().getRestrictionFactory();
          fld.visit(new ILogEntryFieldVisitor() {
            /* (non-Javadoc)
             * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.StringLogEntryField)
             */
            @Override
            public void visit(StringLogEntryField fld) {
              String val = fld.fromInputValue(clauseElem.getTextData(), log);
              restrictions.add(rf.newRestriction(fld, op, val));
            }

            /* (non-Javadoc)
             * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.LevelLogEntryField)
             */
            @Override
            public void visit(LevelLogEntryField fld) {
              Level val = fld.fromInputValue(clauseElem.getTextData(), log);
              restrictions.add(rf.newRestriction(fld, op, val));
            }

            /* (non-Javadoc)
             * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.DateLogEntryField)
             */
            @Override
            public void visit(DateLogEntryField fld) {
              Date val = fld.fromInputValue(clauseElem.getTextData(), log);
              restrictions.add(rf.newRestriction(fld, op, val));
            }
          });
        }
        NamedFilter flt = new NamedFilter();
        flt.setName(name);
View Full Code Here

Examples of net.sf.logsaw.core.query.IRestrictionFactory

    Assert.isNotNull(fldKey, "fldKey"); //$NON-NLS-1$
    Assert.isNotNull(opId, "opId"); //$NON-NLS-1$
    Assert.isNotNull(strVal, "strVal"); //$NON-NLS-1$
    ALogEntryField<?, ?> fld = log.getDialect().getFieldProvider().findField(fldKey);
    final Operator op = Operators.getOperator(opId);
    final IRestrictionFactory rf = CorePlugin.getDefault().getRestrictionFactory();
    final ARestriction<?>[] ret = new ARestriction<?>[1];
    fld.visit(new ILogEntryFieldVisitor() {
      /* (non-Javadoc)
       * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.StringLogEntryField)
       */
      @Override
      public void visit(StringLogEntryField fld) {
        String val = fld.fromInputValue(strVal, log);
        ret[0] = rf.newRestriction(fld, op, val);
      }

      /* (non-Javadoc)
       * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.LevelLogEntryField)
       */
      @Override
      public void visit(LevelLogEntryField fld) {
        Level val = fld.fromInputValue(strVal, log);
        ret[0] = rf.newRestriction(fld, op, val);
      }

      /* (non-Javadoc)
       * @see net.sf.logsaw.core.model.ILogEntryFieldVisitor#visit(net.sf.logsaw.core.model.DateLogEntryField)
       */
      @Override
      public void visit(DateLogEntryField fld) {
        Date val = fld.fromInputValue(strVal, log);
        ret[0] = rf.newRestriction(fld, op, val);
      }
    });
    return ret[0];
  }
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.