001/*
002 * Sonar, open source software quality management tool.
003 * Copyright (C) 2008-2012 SonarSource
004 * mailto:contact AT sonarsource DOT com
005 *
006 * Sonar is free software; you can redistribute it and/or
007 * modify it under the terms of the GNU Lesser General Public
008 * License as published by the Free Software Foundation; either
009 * version 3 of the License, or (at your option) any later version.
010 *
011 * Sonar is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014 * Lesser General Public License for more details.
015 *
016 * You should have received a copy of the GNU Lesser General Public
017 * License along with Sonar; if not, write to the Free Software
018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019 */
020package org.sonar.plugins.findbugs.xml;
021
022import java.util.List;
023
024import com.thoughtworks.xstream.annotations.XStreamAlias;
025import com.thoughtworks.xstream.annotations.XStreamImplicit;
026
027@XStreamAlias("Match")
028public class Match {
029
030  @XStreamAlias("Bug")
031  private Bug bug;
032
033  @XStreamAlias("Priority")
034  private Priority priority;
035
036  @XStreamAlias("Package")
037  private PackageFilter particularPackage;
038
039  @XStreamAlias("Class")
040  private ClassFilter particularClass;
041
042  @XStreamAlias("Method")
043  private MethodFilter particularMethod;
044
045  @XStreamAlias("Field")
046  private FieldFilter particularField;
047
048  @XStreamAlias("Local")
049  private LocalFilter particularLocal;
050
051  @XStreamImplicit(itemFieldName = "Or")
052  private List<OrFilter> ors;
053
054  public Match() {
055  }
056
057  public Match(Bug bug, Priority priority) {
058    this.bug = bug;
059    this.priority = priority;
060  }
061
062  public Match(Bug bug) {
063    this.bug = bug;
064  }
065
066  public Match(ClassFilter particularClass) {
067    this.particularClass = particularClass;
068  }
069
070  public Bug getBug() {
071    return bug;
072  }
073
074  public void setBug(Bug bug) {
075    this.bug = bug;
076  }
077
078  public Priority getPriority() {
079    return priority;
080  }
081
082  public void setPriority(Priority priority) {
083    this.priority = priority;
084  }
085
086  public PackageFilter getParticularPackage() {
087    return particularPackage;
088  }
089
090  public void setParticularPackage(PackageFilter particularPackage) {
091    this.particularPackage = particularPackage;
092  }
093
094  public ClassFilter getParticularClass() {
095    return particularClass;
096  }
097
098  public void setParticularClass(ClassFilter particularClass) {
099    this.particularClass = particularClass;
100  }
101
102  public MethodFilter getParticularMethod() {
103    return particularMethod;
104  }
105
106  public void setParticularMethod(MethodFilter particularMethod) {
107    this.particularMethod = particularMethod;
108  }
109
110  public FieldFilter getParticularField() {
111    return particularField;
112  }
113
114  public void setParticularField(FieldFilter particularField) {
115    this.particularField = particularField;
116  }
117
118  public LocalFilter getParticularLocal() {
119    return particularLocal;
120  }
121
122  public void setParticularLocal(LocalFilter particularLocal) {
123    this.particularLocal = particularLocal;
124  }
125
126  public List<OrFilter> getOrs() {
127    return ors;
128  }
129
130  public void setOrs(List<OrFilter> ors) {
131    this.ors = ors;
132  }
133
134  public void addDisjunctCombine(OrFilter child) {
135    ors.add(child);
136  }
137}