dpfmanager.conformancechecker.tiff.policy_checker.Rules Maven / Gradle / Ivy
/**
* Rules.java
This program is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any later version; or,
* at your choice, under the terms of the Mozilla Public License, v. 2.0. SPDX GPL-3.0+ or MPL-2.0+.
*
This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License and the Mozilla Public License for more details.
* You should have received a copy of the GNU General Public License and the Mozilla Public
* License along with this program. If not, see http://www.gnu.org/licenses/
* and at http://mozilla.org/MPL/2.0 .
NB: for the
* © statement, include Easy Innova SL or other company/Person contributing the code.
©
* 2015 Easy Innova, SL
*
* @author Víctor Muñoz Solà
* @version 1.0
* @since 23/7/2015
*/
package dpfmanager.conformancechecker.tiff.policy_checker;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.regex.Pattern;
/**
* Created by easy on 06/10/2015.
*/
public class Rules {
private ArrayList rules;
/**
* Instantiates a new Rules.
*/
public Rules() {
rules = new ArrayList();
}
/**
* Gets rules.
*
* @return the rules
*/
public ArrayList getRules() {
return rules;
}
public void set(ArrayList rules) {
this.rules = rules;
}
/**
* Write.
*
* @param pw the pw
*/
public void Write(PrintWriter pw) {
for (Rule rule : rules) {
pw.println("RULE\t" + rule.Txt());
}
}
/**
* Add rule from txt.
*
* @param txt the txt
*/
public void addRuleFromTxt(String txt) {
Rule rule = new Rule();
rule.ReadTxt(txt);
rules.add(rule);
}
/**
* Add rule from parameters.
*
* @param tag the tag
* @param operator the operator
* @param value the value
* @param warning the warning
*/
public void addRule(String tag, String operator, String value, boolean warning) {
Rule rule = new Rule();
rule.setTag(tag);
rule.setOperator(operator);
rule.setValue(value);
rule.setWarning(warning);
rules.add(rule);
}
}