1 8 9 package net.sourceforge.chaperon.model.pattern; 10 11 import net.sourceforge.chaperon.model.Violations; 12 13 import java.io.Serializable ; 14 15 21 public abstract class Pattern implements Serializable , Cloneable 22 { 23 24 private int minOccurs = 1; 25 26 27 private int maxOccurs = 1; 28 private String location = null; 29 30 35 public void setMinOccurs(int minOccurs) 36 { 37 if (minOccurs>=0) 38 this.minOccurs = minOccurs; 39 } 40 41 46 public int getMinOccurs() 47 { 48 return minOccurs; 49 } 50 51 56 public void setMaxOccurs(int maxOccurs) 57 { 58 if (maxOccurs>=this.minOccurs) 59 this.maxOccurs = maxOccurs; 60 } 61 62 67 public int getMaxOccurs() 68 { 69 return this.maxOccurs; 70 } 71 72 79 public abstract Object clone() throws CloneNotSupportedException ; 80 81 86 public void setLocation(String location) 87 { 88 this.location = location; 89 } 90 91 96 public String getLocation() 97 { 98 return location; 99 } 100 101 106 public abstract Violations validate(); 107 } 108 | Popular Tags |