Update of /var/cvs/applications/richtext/src/org/mmbase/richtext/transformers
In directory
james.mmbase.org:/tmp/cvs-serv27533/src/org/mmbase/richtext/transformers
Modified Files:
XmlField.java
Log Message:
constants must be final an identified by fully uppercased identifiers
See also:
http://cvs.mmbase.org/viewcvs/applications/richtext/src/org/mmbase/richtext/transformers
Index: XmlField.java
===================================================================
RCS file:
/var/cvs/applications/richtext/src/org/mmbase/richtext/transformers/XmlField.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- XmlField.java 22 Apr 2008 11:16:59 -0000 1.6
+++ XmlField.java 3 Jun 2008 11:26:22 -0000 1.7
@@ -34,7 +34,7 @@
* Like [EMAIL PROTECTED] org.mmbase.util.transformers.XmlField} but adds
everything related to the MMXF doctype. This means basicly that it knows how to
surround <mmxf />
*
* @author Michiel Meeuwissen
- * @version $Id: XmlField.java,v 1.6 2008/04/22 11:16:59 michiel Exp $
+ * @version $Id: XmlField.java,v 1.7 2008/06/03 11:26:22 michiel Exp $
* @todo THIS CLASS NEEDS A CONCEPT! It gets a bit messy.
*/
@@ -71,15 +71,13 @@
org.mmbase.util.Encode.register(XmlField.class.getName());
}
-
-
- private static Pattern wikiWrappingAnchor =
Pattern.compile("\\[(\\w+):(.*?)\\]");
- private static Pattern wikiP = Pattern.compile("<p>\\[(\\w+)\\]");
- private static Pattern wikiSection =
Pattern.compile("<section><h>\\[(\\w+)\\]");
- private static Pattern wikiAnchor = Pattern.compile("\\[(\\w+)\\]");
+ private static final Pattern WIKI_WRAPPING_ANCHOR =
Pattern.compile("\\[(\\w+):(.*?)\\]");
+ private static final Pattern WIKI_P =
Pattern.compile("<p>\\[(\\w+)\\]");
+ private static final Pattern WIKI_SECTION =
Pattern.compile("<section><h>\\[(\\w+)\\]");
+ private static final Pattern WIKI_ANCHOR =
Pattern.compile("\\[(\\w+)\\]");
public static String wikiToXML(String data, boolean leaveExtraNewLines,
boolean placeListsInsideP) {
- Matcher wrappingAnchors =
wikiWrappingAnchor.matcher(prepareDataString(data));
+ Matcher wrappingAnchors =
WIKI_WRAPPING_ANCHOR.matcher(prepareDataString(data));
data = wrappingAnchors.replaceAll("<a id=\"$1\">$2</a>");
StringObject obj = new StringObject(data);
handleRich(obj, true, leaveExtraNewLines, true, placeListsInsideP);
@@ -88,11 +86,11 @@
}
handleFormat(obj, false);
String string = obj.toString();
- Matcher ps = wikiP.matcher(string);
+ Matcher ps = WIKI_P.matcher(string);
string = ps.replaceAll("<p id=\"$1\">");
- Matcher sections = wikiSection.matcher(string);
+ Matcher sections = WIKI_SECTION.matcher(string);
string = sections.replaceAll("<section id=\"$1\"><h>");
- Matcher anchors = wikiAnchor.matcher(string);
+ Matcher anchors = WIKI_ANCHOR.matcher(string);
string = anchors.replaceAll("<a id=\"$1\" />");
return string;
}
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs