001: /*
002: * JFolder, Copyright 2001-2006 Gary Steinmetz
003: *
004: * Distributable under LGPL license.
005: * See terms of license at gnu.org.
006: */
007:
008: package org.jfolder.common.function;
009:
010: //base classes
011: import java.io.IOException;
012: import java.util.ArrayList;
013: import java.util.HashMap;
014:
015: //project specific classes
016: import org.jfolder.common.UnexpectedSystemException;
017: import org.jfolder.common.tagging.AppraiseConceptTagContext;
018: import org.jfolder.common.tagging.BaseAppraiseConceptTagContext;
019: import org.jfolder.common.tagging.ConceptTagCharacteristic;
020: import org.jfolder.common.tagging.ConceptTagCharacteristicHolder;
021: import org.jfolder.common.tagging.ConceptTagConstraint;
022: import org.jfolder.common.tagging.ConceptTagConstraintHolder;
023: import org.jfolder.common.tagging.ConceptTagPreferences;
024: import org.jfolder.common.utils.misc.MiscHelper;
025: import org.jfolder.common.utils.xml.XMLHelper;
026:
027: //other classes
028:
029: public class WebPageTagInstanceViewContextSubHtmlInfo {
030:
031: private String name = null;
032: private HashMap attrs = null;
033: private HashMap styles = null;
034:
035: private WebPageTagInstanceViewContextSubHtmlInfo(String inName,
036: HashMap inAttrs, HashMap inStyles) {
037: //
038: this .name = inName;
039: this .attrs = new HashMap(inAttrs);
040: this .styles = new HashMap(inStyles);
041: }
042:
043: private WebPageTagInstanceViewContextSubHtmlInfo(String inName,
044: HashMap inAttrs) {
045: //
046: this .name = inName;
047: this .attrs = new HashMap(inAttrs);
048: }
049:
050: private WebPageTagInstanceViewContextSubHtmlInfo(String inName) {
051: this .name = inName;
052: this .attrs = new HashMap();
053: }
054:
055: public final static WebPageTagInstanceViewContextSubHtmlInfo newInstance(
056: String inName) {
057: //
058: WebPageTagInstanceViewContextSubHtmlInfo outValue = null;
059:
060: outValue = new WebPageTagInstanceViewContextSubHtmlInfo(inName);
061:
062: return outValue;
063: }
064:
065: public final static WebPageTagInstanceViewContextSubHtmlInfo newInstance(
066: String inName, HashMap inAttrs) {
067: //
068: WebPageTagInstanceViewContextSubHtmlInfo outValue = null;
069:
070: outValue = new WebPageTagInstanceViewContextSubHtmlInfo(inName,
071: inAttrs);
072:
073: return outValue;
074: }
075:
076: public final static WebPageTagInstanceViewContextSubHtmlInfo newInstance(
077: String inName, HashMap inAttrs, HashMap inStyles) {
078: //
079: WebPageTagInstanceViewContextSubHtmlInfo outValue = null;
080:
081: outValue = new WebPageTagInstanceViewContextSubHtmlInfo(inName,
082: inAttrs, inStyles);
083:
084: return outValue;
085: }
086:
087: //
088: public void registerAttribute(String inName, String inValue) {
089: this .attrs.put(inName, inValue);
090: }
091:
092: public HashMap getAttributes() {
093: return new HashMap(this .attrs);
094: }
095:
096: //
097: public boolean isStylesPresent() {
098: return (this .styles != null);
099: }
100:
101: public HashMap getStyles() {
102: return new HashMap(this .styles);
103: }
104:
105: //
106: public String getName() {
107: return this .name;
108: }
109:
110: //
111: public ArrayList getAttributeNames() {
112: return new ArrayList(this .attrs.keySet());
113: }
114:
115: public String getAttributeValue(String inName) {
116: return ((String) this .attrs.get(inName));
117: }
118:
119: //
120: //
121: public boolean isNotEmpty() {
122:
123: boolean outValue = false;
124:
125: outValue |= (this .name != null && this .name.length() > 0);
126: outValue |= (this .attrs.size() > 0);
127:
128: return outValue;
129: }
130: }
|