001: /*
002: * ChainBuilder ESB
003: * Visual Enterprise Integration
004: *
005: * Copyright (C) 2006 Bostech Corporation
006: *
007: * This program is free software; you can redistribute it and/or modify
008: * it under the terms of the GNU General Public License as published by
009: * the Free Software Foundation; either version 2 of the License, or
010: * (at your option) any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * General Public License for more details.
016: *
017: * You should have received a copy of the GNU General Public License
018: * along with this program; if not, write to the Free Software
019: * Foundation, Inc.,59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: *
023: * $Id: PropertyImpl.java 6328 2007-03-26 15:47:34Z mpreston $
024: */
025: package com.bostechcorp.cbesb.common.mdl.impl;
026:
027: import org.jdom.Attribute;
028: import org.jdom.Element;
029:
030: import com.bostechcorp.cbesb.common.mdl.IProperty;
031: import com.bostechcorp.cbesb.common.mdl.MDLDocConstants;
032:
033: /**
034: * The implement class for IProperty
035: *
036: */
037: public class PropertyImpl implements IProperty {
038:
039: /**
040: * The name of the property
041: */
042: private String name;
043:
044: /**
045: * The namespace URI.
046: */
047: private String namespaceURI;
048:
049: /**
050: * The value of the property
051: */
052: private String value;
053:
054: /* (non-Javadoc)
055: * @see com.bostechcorp.cbesb.common.mdl.IProperty#getName()
056: */
057: public String getName() {
058: return name;
059: }
060:
061: /* (non-Javadoc)
062: * @see com.bostechcorp.cbesb.common.mdl.IProperty#setName(java.lang.String)
063: */
064: public void setName(String name) {
065: this .name = name;
066: }
067:
068: /**
069: * @return the namespaceURI
070: */
071: public String getNamespaceURI() {
072: return namespaceURI;
073: }
074:
075: /**
076: * @param namespaceURI the namespaceURI to set
077: */
078: public void setNamespaceURI(String namespaceURI) {
079: this .namespaceURI = namespaceURI;
080: }
081:
082: /* (non-Javadoc)
083: * @see com.bostechcorp.cbesb.common.mdl.IProperty#getValue()
084: */
085: public String getValue() {
086: return value;
087: }
088:
089: /* (non-Javadoc)
090: * @see com.bostechcorp.cbesb.common.mdl.IProperty#setValue(java.lang.String)
091: */
092: public void setValue(String value) {
093: this .value = value;
094: }
095:
096: public void serializeToJDom(MDLSerializerUtil serializerUtil,
097: Element mdlRoot) {
098: Element elemProperty = serializerUtil
099: .createElement(MDLDocConstants.MDL_PROPERTY);
100:
101: Attribute attrName = serializerUtil.createAttribute(
102: MDLDocConstants.MDL_NAME, name);
103: elemProperty.setAttribute(attrName);
104:
105: Attribute attrValue = serializerUtil.createAttribute(
106: MDLDocConstants.MDL_PROPERTY_VALUE, serializerUtil
107: .handleEscapedProperties(value));
108: elemProperty.setAttribute(attrValue);
109:
110: mdlRoot.addContent(elemProperty);
111: }
112: }
|