KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opencms > htmlconverter > CmsHtmlConverterObjectReplaceBlocks


1 /*
2 * File : $Source: /usr/local/cvs/opencms/src-modules/com/opencms/htmlconverter/CmsHtmlConverterObjectReplaceBlocks.java,v $
3 * Date : $Date: 2005/05/17 13:47:32 $
4 * Version: $Revision: 1.1 $
5 *
6 * This library is part of OpenCms -
7 * the Open Source Content Mananagement System
8 *
9 * Copyright (C) 2001 The OpenCms Group
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation; either
14 * version 2.1 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
20 *
21 * For further information about OpenCms, please see the
22 * OpenCms Website: http://www.opencms.org
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 */

28
29 package com.opencms.htmlconverter;
30
31 /**
32  * Object for replacing blocks of HTML code.
33  * @author Andreas Zahner
34  * @version 1.0
35  *
36  * @deprecated Will not be supported past the OpenCms 6 release.
37  */

38 final class CmsHtmlConverterObjectReplaceBlocks {
39
40     /** the prefix will be placed in front of every replaced block. */
41     private String JavaDoc m_prefix;
42     /** name of tag which will be replaced. */
43     private String JavaDoc m_tagName;
44     /** Attribute of tag which will be replaced (optional). */
45     private String JavaDoc m_tagAttrib;
46     /** value of tag attribute which will be replaced (optional). */
47     private String JavaDoc m_tagAttribValue;
48     /** String which replaces the block. */
49     private String JavaDoc m_replaceString;
50     /** the suffix will be placed behind every replaced block. */
51     private String JavaDoc m_suffix;
52     /** if true, individual replaceString will be read from tag attribute. */
53     private boolean m_getReplaceFromAttrs;
54     /** tag attribute where the replaceString is stored. */
55     private String JavaDoc m_replaceAttribute;
56     /** tag attribute where the parameter String is stored. */
57     private String JavaDoc m_parameter;
58
59     /**
60      * default constructor creates object with empty Strings.<p>
61      */

62     protected CmsHtmlConverterObjectReplaceBlocks () {
63         m_prefix = "";
64         m_tagName = "";
65         m_tagAttrib = "";
66         m_tagAttribValue = "";
67         m_replaceString = "";
68         m_suffix = "";
69         m_getReplaceFromAttrs = false;
70         m_replaceAttribute = "";
71         m_parameter = "";
72     }
73
74     /**
75      * constructor creates object with parameters.<p>
76      * @param p String prefix
77      * @param tN String tagName
78      * @param tA String tagAttribute
79      * @param tAV String tagAttributeValue
80      * @param rS String replaceString
81      * @param s String suffix
82      * @param gRFA boolean getReplaceFromAttrs
83      * @param rA String replaceAttribute
84      * @param param String parameter
85      */

86     protected CmsHtmlConverterObjectReplaceBlocks (String JavaDoc p, String JavaDoc tN, String JavaDoc tA, String JavaDoc tAV, String JavaDoc rS, String JavaDoc s, boolean gRFA, String JavaDoc rA, String JavaDoc param) {
87         m_prefix = p;
88         m_tagName = tN;
89         m_tagAttrib = tA;
90         m_tagAttribValue = tAV;
91         m_replaceString = rS;
92         m_suffix = s;
93         m_getReplaceFromAttrs = gRFA;
94         m_replaceAttribute = rA;
95         m_parameter = param;
96     }
97
98     /**
99      * returns prefix of actual object.<p>
100      * @return String with prefix
101      */

102     protected String JavaDoc getPrefix() {
103         return m_prefix;
104     }
105
106     /**
107      * returns suffix of actual object.<p>
108      * @return String with suffix
109      */

110     protected String JavaDoc getSuffix() {
111         return m_suffix;
112     }
113
114     /**
115      * returns tag name of tag which will be replaced.<p>
116      * @return String with tag name
117      */

118     protected String JavaDoc getTagName() {
119         return m_tagName;
120     }
121
122     /**
123      * returns attribute of tag which will be replaced.<p>
124      * @return String with attribute name
125      */

126     protected String JavaDoc getTagAttrib() {
127         return m_tagAttrib;
128     }
129
130     /**
131      * returns attribute value of tag which will be replaced.<p>
132      * @return String with attribute value
133      */

134     protected String JavaDoc getTagAttribValue() {
135         return m_tagAttribValue;
136     }
137
138     /**
139      * returns String which replaces the content between start and end tag.<p>
140      * @return String with prefix, content and suffix
141      */

142     protected String JavaDoc getReplaceString() {
143         return m_prefix + m_replaceString + m_suffix;
144     }
145
146     /**
147      * checks if replacecontents are encoded in html code attributes.<p>
148      * @return true if replacecontents are encoded, otherwise false
149      */

150     protected boolean getReplaceFromAttrs() {
151         return m_getReplaceFromAttrs;
152     }
153
154     /**
155      * returns name of attribute of encoded replacecontent.<p>
156      * @return String with attribute name
157      */

158     protected String JavaDoc getReplaceAttribute() {
159         return m_replaceAttribute;
160     }
161
162     /**
163      * returns attribute name of parameter.<p>
164      * @return String with attribute name
165      */

166     protected String JavaDoc getParameter() {
167         return m_parameter;
168     }
169
170 }
Popular Tags