KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > services > htmlparser > MarkupDefinition


1 package org.jahia.services.htmlparser;
2
3 import java.util.Properties JavaDoc;
4
5 /**
6  *
7  * <p>Title: Markup Definition</p>
8  * <p>Description: A narkup definition</p>
9  * <p>Copyright: Copyright (c) 2002</p>
10  * <p>Company: </p>
11  * @author Khue Nguyen
12  * @version 1.0
13  */

14 public class MarkupDefinition {
15
16     protected int id = -1;
17
18     protected String JavaDoc name = "";
19
20     protected boolean isCaseSensitive = false;
21
22     protected Properties JavaDoc properties;
23
24     public MarkupDefinition(String JavaDoc name){
25         this.name = name;
26         this.properties = new Properties JavaDoc();
27     }
28
29     /**
30      * Return the unique identifier
31      *
32      * @return
33      */

34     public int getId(){
35         return this.id;
36     }
37
38     /**
39      * Set the id
40      * @return
41      */

42     public void setId(int value){
43         this.id = value;
44     }
45
46     /**
47      * Return the markup name
48      * @return
49      */

50     public String JavaDoc getName(){
51         return this.name;
52     }
53
54     public void setName(String JavaDoc name){
55         this.name = name;
56     }
57
58     /**
59      *
60      * @return
61      */

62     public boolean isCaseSensitive(){
63         return this.isCaseSensitive;
64     }
65
66     public void setIsCaseSensitive(boolean value){
67         this.isCaseSensitive = value;
68     }
69
70     /**
71      * Return a property
72      *
73      * @param name
74      * @param value
75      */

76     public String JavaDoc getProperty(String JavaDoc name){
77         if ( name == null ){
78             return null;
79         }
80         return this.properties.getProperty(name);
81     }
82
83     /**
84      * Set a property
85      */

86     public void setProperty(String JavaDoc name, String JavaDoc value){
87         if ( name != null ){
88             this.properties.setProperty(name,value);
89         }
90     }
91
92
93     public Properties JavaDoc getProperties(){
94         return this.properties;
95     }
96
97     /**
98      * Set the properties
99      */

100     public void setProperties(Properties JavaDoc properties){
101         if ( properties != null ){
102             this.properties = properties;
103         }
104     }
105
106     public boolean equals(Object JavaDoc 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