import org.apache.fop.util.ContentHandlerFactory; | import org.apache.fop.util.ContentHandlerFactory; | ||||
import org.apache.fop.util.ContentHandlerFactoryRegistry; | import org.apache.fop.util.ContentHandlerFactoryRegistry; | ||||
import org.apache.fop.util.ConversionUtils; | import org.apache.fop.util.ConversionUtils; | ||||
import org.apache.fop.util.DefaultErrorListener; | |||||
import org.apache.fop.util.LanguageTags; | import org.apache.fop.util.LanguageTags; | ||||
import org.apache.fop.util.XMLConstants; | import org.apache.fop.util.XMLConstants; | ||||
import org.apache.fop.util.XMLUtil; | import org.apache.fop.util.XMLUtil; | ||||
import org.apache.fop.utils.DefaultErrorListener; | |||||
import static org.apache.fop.fo.Constants.FO_REGION_AFTER; | import static org.apache.fop.fo.Constants.FO_REGION_AFTER; | ||||
import static org.apache.fop.fo.Constants.FO_REGION_BEFORE; | import static org.apache.fop.fo.Constants.FO_REGION_BEFORE; |
import org.apache.fop.fo.pagination.Root; | import org.apache.fop.fo.pagination.Root; | ||||
import org.apache.fop.util.CharUtilities; | import org.apache.fop.util.CharUtilities; | ||||
import org.apache.fop.util.ContentHandlerFactory; | import org.apache.fop.util.ContentHandlerFactory; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.Function; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Function; | |||||
/** | /** | ||||
* Base class for nodes in the XML tree | * Base class for nodes in the XML tree |
import org.apache.fop.util.ContentHandlerFactory; | import org.apache.fop.util.ContentHandlerFactory; | ||||
import org.apache.fop.util.ContentHandlerFactoryRegistry; | import org.apache.fop.util.ContentHandlerFactoryRegistry; | ||||
import org.apache.fop.util.DOMBuilderContentHandlerFactory; | import org.apache.fop.util.DOMBuilderContentHandlerFactory; | ||||
import org.apache.fop.util.DefaultErrorListener; | |||||
import org.apache.fop.util.LanguageTags; | import org.apache.fop.util.LanguageTags; | ||||
import org.apache.fop.util.XMLUtil; | import org.apache.fop.util.XMLUtil; | ||||
import org.apache.fop.utils.DefaultErrorListener; | |||||
/** | /** | ||||
* This is a parser for the intermediate format XML which converts the intermediate file into | * This is a parser for the intermediate format XML which converts the intermediate file into |
import java.util.regex.Matcher; | import java.util.regex.Matcher; | ||||
import java.util.regex.Pattern; | import java.util.regex.Pattern; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.PartFactory; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.PartFactory; | |||||
/** | /** | ||||
* Defines a "choice" field part that works like {@link ChoiceFormat}. | * Defines a "choice" field part that works like {@link ChoiceFormat}. |
import java.util.Map; | import java.util.Map; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.PartFactory; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.PartFactory; | |||||
/** | /** | ||||
* Defines an "equals" field part that can compare a field's string value against another string. | * Defines an "equals" field part that can compare a field's string value against another string. |
import org.apache.xmlgraphics.fonts.Glyphs; | import org.apache.xmlgraphics.fonts.Glyphs; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.PartFactory; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.PartFactory; | |||||
/** | /** | ||||
* Function formatting a character to a glyph name. | * Function formatting a character to a glyph name. |
import java.util.Map; | import java.util.Map; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.PartFactory; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.PartFactory; | |||||
/** | /** | ||||
* Function formatting a number or character to a hex value. | * Function formatting a number or character to a hex value. |
import java.util.Map; | import java.util.Map; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.PartFactory; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.PartFactory; | |||||
/** | /** | ||||
* Defines an "if" field part that checks if field's value is true or false. | * Defines an "if" field part that checks if field's value is true or false. |
import org.xml.sax.Locator; | import org.xml.sax.Locator; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat.ObjectFormatter; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.ObjectFormatter; | |||||
/** | /** | ||||
* Object formatter for the SAX Locator object. | * Object formatter for the SAX Locator object. |
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import org.apache.fop.events.model.EventSeverity; | import org.apache.fop.events.model.EventSeverity; | ||||
import org.apache.fop.util.text.AdvancedMessageFormat; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat; | |||||
/** | /** | ||||
* Tests for EventFormatter. | * Tests for EventFormatter. |
import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
import static org.junit.Assert.fail; | import static org.junit.Assert.fail; | ||||
import org.apache.fop.utils.XMLResourceBundle; | |||||
/** | /** | ||||
* Tests for XMLResourceBundle. | * Tests for XMLResourceBundle. | ||||
*/ | */ |
import org.apache.fop.configuration.Configurable; | import org.apache.fop.configuration.Configurable; | ||||
import org.apache.fop.configuration.Configuration; | import org.apache.fop.configuration.Configuration; | ||||
import org.apache.fop.configuration.ConfigurationException; | import org.apache.fop.configuration.ConfigurationException; | ||||
import org.apache.fop.util.DefaultErrorListener; | |||||
import org.apache.fop.utils.DefaultErrorListener; | |||||
/** | /** | ||||
* BitmapProducer implementation that uses the PS or PDF renderer and an external converter | * BitmapProducer implementation that uses the PS or PDF renderer and an external converter |
import org.apache.fop.configuration.Configurable; | import org.apache.fop.configuration.Configurable; | ||||
import org.apache.fop.configuration.Configuration; | import org.apache.fop.configuration.Configuration; | ||||
import org.apache.fop.configuration.ConfigurationException; | import org.apache.fop.configuration.ConfigurationException; | ||||
import org.apache.fop.util.DefaultErrorListener; | |||||
import org.apache.fop.utils.DefaultErrorListener; | |||||
/** | /** | ||||
* BitmapProducer implementation that uses the Java2DRenderer to create bitmaps. | * BitmapProducer implementation that uses the Java2DRenderer to create bitmaps. |
import org.apache.commons.logging.Log; | import org.apache.commons.logging.Log; | ||||
import org.apache.commons.logging.LogFactory; | import org.apache.commons.logging.LogFactory; | ||||
import org.apache.fop.util.XMLResourceBundle; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.util.text.AdvancedMessageFormat.PartFactory; | |||||
import org.apache.fop.utils.XMLResourceBundle; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.Part; | |||||
import org.apache.fop.utils.text.AdvancedMessageFormat.PartFactory; | |||||
/** | /** | ||||
* Converts events into human-readable, localized messages. | * Converts events into human-readable, localized messages. |
import org.apache.commons.logging.Log; | import org.apache.commons.logging.Log; | ||||
import org.apache.commons.logging.LogFactory; | import org.apache.commons.logging.LogFactory; | ||||
import org.apache.fop.util.DefaultErrorListener; | |||||
import org.apache.fop.utils.DefaultErrorListener; | |||||
/** | /** | ||||
* This is a parser for the event model XML. | * This is a parser for the event model XML. |
/* $Id$ */ | /* $Id$ */ | ||||
package org.apache.fop.util; | |||||
package org.apache.fop.utils; | |||||
import javax.xml.transform.ErrorListener; | import javax.xml.transform.ErrorListener; | ||||
import javax.xml.transform.TransformerException; | import javax.xml.transform.TransformerException; |
/* $Id$ */ | /* $Id$ */ | ||||
package org.apache.fop.util; | |||||
package org.apache.fop.utils; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.InputStream; | import java.io.InputStream; |
/* $Id$ */ | /* $Id$ */ | ||||
package org.apache.fop.util.text; | |||||
package org.apache.fop.utils.text; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import java.util.List; | import java.util.List; | ||||
public class AdvancedMessageFormat { | public class AdvancedMessageFormat { | ||||
/** Regex that matches "," but not "\," (escaped comma) */ | /** Regex that matches "," but not "\," (escaped comma) */ | ||||
static final Pattern COMMA_SEPARATOR_REGEX = Pattern.compile("(?<!\\\\),"); | |||||
public static final Pattern COMMA_SEPARATOR_REGEX = Pattern.compile("(?<!\\\\),"); | |||||
private static final Map<String, PartFactory> PART_FACTORIES | private static final Map<String, PartFactory> PART_FACTORIES | ||||
= new java.util.HashMap<String, PartFactory>(); | = new java.util.HashMap<String, PartFactory>(); | ||||
} | } | ||||
static String unescapeComma(String string) { | |||||
public static String unescapeComma(String string) { | |||||
return string.replaceAll("\\\\,", ","); | return string.replaceAll("\\\\,", ","); | ||||
} | } | ||||
} | } |