001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.him.editors.report.rqom;
020:
021: import org.openharmonise.him.harmonise.*;
022:
023: /**
024: * Metadata object for report query object model.
025: *
026: * @author Matthew Large
027: * @version $Revision: 1.1 $
028: *
029: */
030: public class Metadata {
031:
032: private ReportQuery m_reportQuery = null;
033:
034: /**
035: * Property path.
036: */
037: private String m_sPath = null;
038:
039: /**
040: * Value.
041: */
042: private String m_sValue = null;
043:
044: /**
045: * Operator
046: */
047: private String m_sOperator = "=";
048:
049: /**
050: * Constructs a new metadata object.
051: *
052: * @param sPath Property path
053: */
054: public Metadata(String sPath, ReportQuery reportQuery) {
055: super ();
056: this .m_sPath = sPath;
057: this .m_reportQuery = reportQuery;
058: }
059:
060: /**
061: * Returns the property path.
062: *
063: * @return Property path
064: */
065: public String getPath() {
066: return this .m_sPath;
067: }
068:
069: /**
070: *
071: * @param sPath
072: */
073: public String getName() {
074: int index = m_sPath.lastIndexOf("/");
075: String temp = m_sPath;
076: if (index > 0) {
077: temp = m_sPath.substring(index + 1);
078: }
079: return temp;
080: }
081:
082: /**
083: * Sets the property path.
084: *
085: * @param sPath Property path
086: */
087: public void setPath(String sPath) {
088: if (sPath.equals("")) {
089: this .m_sPath = null;
090: } else {
091: this .m_sPath = sPath;
092: }
093: this .m_reportQuery.fireDataChangedMessage();
094: }
095:
096: /**
097: * Returns the value.
098: *
099: * @return Value
100: */
101: public String getValue() {
102: return this .m_sValue;
103: }
104:
105: /**
106: * Sets the value.
107: *
108: * @param sValue Value
109: */
110: public void setValue(String sValue) {
111: this .m_sValue = sValue;
112: this .m_reportQuery.fireDataChangedMessage();
113: }
114:
115: /**
116: * @return Returns the m_sOperator.
117: */
118: public String getOperator() {
119: return m_sOperator;
120: }
121:
122: /**
123: * @param operator The m_sOperator to set.
124: */
125: public void setOperator(String operator) {
126: m_sOperator = operator;
127: this .m_reportQuery.fireDataChangedMessage();
128: }
129:
130: /**
131: * @return
132: */
133: public boolean isSystemProperty() {
134: if (this .m_sPath.indexOf(HarmonisePaths.PATH_SYSTEM_PROPS) >= 0) {
135: return true;
136: } else {
137: return false;
138: }
139: }
140: }
|