1 package org.jahia.services.htmlparser; 2 3 import java.util.Properties ; 4 5 14 public class MarkupDefinition { 15 16 protected int id = -1; 17 18 protected String name = ""; 19 20 protected boolean isCaseSensitive = false; 21 22 protected Properties properties; 23 24 public MarkupDefinition(String name){ 25 this.name = name; 26 this.properties = new Properties (); 27 } 28 29 34 public int getId(){ 35 return this.id; 36 } 37 38 42 public void setId(int value){ 43 this.id = value; 44 } 45 46 50 public String getName(){ 51 return this.name; 52 } 53 54 public void setName(String name){ 55 this.name = name; 56 } 57 58 62 public boolean isCaseSensitive(){ 63 return this.isCaseSensitive; 64 } 65 66 public void setIsCaseSensitive(boolean value){ 67 this.isCaseSensitive = value; 68 } 69 70 76 public String getProperty(String name){ 77 if ( name == null ){ 78 return null; 79 } 80 return this.properties.getProperty(name); 81 } 82 83 86 public void setProperty(String name, String value){ 87 if ( name != null ){ 88 this.properties.setProperty(name,value); 89 } 90 } 91 92 93 public Properties getProperties(){ 94 return this.properties; 95 } 96 97 100 public void setProperties(Properties properties){ 101 if ( properties != null ){ 102 this.properties = properties; 103 } 104 } 105 106 public boolean equals(Object obj) { 107 if ( obj == null || !(obj instanceof MarkupDefinition)) { 108 return false; 109 } 110 MarkupDefinition markupDef = (MarkupDefinition) obj; 111 return ( getId() == markupDef.getId() ); 112 } 113 114 public int hashCode(){ 115 return getId(); 116 } 117 118 } 119 120 | Popular Tags |