aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/util')
-rw-r--r--src/java/org/apache/fop/util/CharUtilities.java24
-rw-r--r--src/java/org/apache/fop/util/XMLizable.java35
2 files changed, 19 insertions, 40 deletions
diff --git a/src/java/org/apache/fop/util/CharUtilities.java b/src/java/org/apache/fop/util/CharUtilities.java
index 6baa5c0fd..eb56cd331 100644
--- a/src/java/org/apache/fop/util/CharUtilities.java
+++ b/src/java/org/apache/fop/util/CharUtilities.java
@@ -54,10 +54,14 @@ public class CharUtilities {
public static final int XMLWHITESPACE = 4;
+ /** null char */
+ public static final char NULL_CHAR = '\u0000';
/** linefeed character */
public static final char LINEFEED_CHAR = '\n';
/** carriage return */
public static final char CARRIAGE_RETURN = '\r';
+ /** normal tab */
+ public static final char TAB = '\t';
/** normal space */
public static final char SPACE = '\u0020';
/** non-breaking space */
@@ -80,9 +84,12 @@ public class CharUtilities {
public static final char PARAGRAPH_SEPARATOR = '\u2029';
/** missing ideograph */
public static final char MISSING_IDEOGRAPH = '\u25A1';
+ /** Ideogreaphic space */
+ public static final char IDEOGRAPHIC_SPACE = '\u3000';
/** Unicode value indicating the the character is "not a character". */
public static final char NOT_A_CHARACTER = '\uFFFF';
+
/**
* Utility class: Constructor prevents instantiating when subclassed.
*/
@@ -97,11 +104,18 @@ public class CharUtilities {
* @return the determined character class
*/
public static int classOf(char c) {
- if (c == CODE_EOT) { return EOT; }
- if (c == '\n') { return LINEFEED; }
- if (c == ' ' || c == '\r' || c == '\t') { return XMLWHITESPACE; }
- if (isAnySpace(c)) { return UCWHITESPACE; }
- return NONWHITESPACE;
+ switch (c) {
+ case CODE_EOT:
+ return EOT;
+ case LINEFEED_CHAR:
+ return LINEFEED;
+ case SPACE:
+ case CARRIAGE_RETURN:
+ case TAB:
+ return XMLWHITESPACE;
+ default:
+ return isAnySpace(c) ? UCWHITESPACE : NONWHITESPACE;
+ }
}
diff --git a/src/java/org/apache/fop/util/XMLizable.java b/src/java/org/apache/fop/util/XMLizable.java
deleted file mode 100644
index a16131989..000000000
--- a/src/java/org/apache/fop/util/XMLizable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* $Id$ */
-
-package org.apache.fop.util;
-
-/*
- * Copied from Apache Excalibur:
- * https://svn.apache.org/repos/asf/excalibur/trunk/components/xmlutil/
- * src/java/org/apache/excalibur/xml/sax/XMLizable.java
- */
-
-/**
- * This interface can be implemented by classes willing to provide an XML representation
- * of their current state as SAX events.
- * @deprecated Use the interface in Apache XML Graphics Commons instead.
- */
-public interface XMLizable extends org.apache.xmlgraphics.util.XMLizable {
-
-}