KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > editors > report > rqom > Metadata


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.him.editors.report.rqom;
20
21 import org.openharmonise.him.harmonise.*;
22
23 /**
24  * Metadata object for report query object model.
25  *
26  * @author Matthew Large
27  * @version $Revision: 1.1 $
28  *
29  */

30 public class Metadata {
31     
32     private ReportQuery m_reportQuery = null;
33
34     /**
35      * Property path.
36      */

37     private String JavaDoc m_sPath = null;
38     
39     /**
40      * Value.
41      */

42     private String JavaDoc m_sValue = null;
43     
44     /**
45      * Operator
46      */

47     private String JavaDoc m_sOperator = "=";
48
49     /**
50      * Constructs a new metadata object.
51      *
52      * @param sPath Property path
53      */

54     public Metadata(String JavaDoc sPath, ReportQuery reportQuery) {
55         super();
56         this.m_sPath = sPath;
57         this.m_reportQuery = reportQuery;
58     }
59     
60     /**
61      * Returns the property path.
62      *
63      * @return Property path
64      */

65     public String JavaDoc getPath() {
66         return this.m_sPath;
67     }
68     
69     /**
70      *
71      * @param sPath
72      */

73     public String JavaDoc getName() {
74         int index = m_sPath.lastIndexOf("/");
75         String JavaDoc temp = m_sPath;
76         if(index>0){
77             temp = m_sPath.substring(index + 1);
78         }
79         return temp;
80     }
81     /**
82      * Sets the property path.
83      *
84      * @param sPath Property path
85      */

86     public void setPath(String JavaDoc sPath) {
87         if(sPath.equals("")) {
88             this.m_sPath = null;
89         } else {
90             this.m_sPath = sPath;
91         }
92         this.m_reportQuery.fireDataChangedMessage();
93     }
94     
95     /**
96      * Returns the value.
97      *
98      * @return Value
99      */

100     public String JavaDoc getValue() {
101         return this.m_sValue;
102     }
103     
104     /**
105      * Sets the value.
106      *
107      * @param sValue Value
108      */

109     public void setValue(String JavaDoc sValue) {
110         this.m_sValue = sValue;
111         this.m_reportQuery.fireDataChangedMessage();
112     }
113
114     /**
115      * @return Returns the m_sOperator.
116      */

117     public String JavaDoc getOperator() {
118         return m_sOperator;
119     }
120     /**
121      * @param operator The m_sOperator to set.
122      */

123     public void setOperator(String JavaDoc operator) {
124         m_sOperator = operator;
125         this.m_reportQuery.fireDataChangedMessage();
126     }
127
128     /**
129      * @return
130      */

131     public boolean isSystemProperty() {
132         if(this.m_sPath.indexOf(HarmonisePaths.PATH_SYSTEM_PROPS)>=0){
133             return true;
134         } else {
135             return false;
136         }
137     }
138 }
139
Popular Tags