From eb1ad60936a14f46c93fd97e64fc62a8c3d9d4e2 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 18 May 2006 12:44:15 +0000 Subject: Extended PageViewport to carry foreign attributes. Foreign attributes from simple-page-master are transferred to the PageViewport. Added foreign attributes handling in AreaTreeParser. Fixed proper generation of foreign attributes in XMLRenderer. EvalCheck extended so it can use namespace prefix mappings in its context. Test case for foreign attributes. Paper source/tray support for PCL (pcl:paper-source="" on s-p-m) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@407541 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/util/QName.java | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/java/org/apache/fop/util') diff --git a/src/java/org/apache/fop/util/QName.java b/src/java/org/apache/fop/util/QName.java index ccfe05638..91c9ab812 100644 --- a/src/java/org/apache/fop/util/QName.java +++ b/src/java/org/apache/fop/util/QName.java @@ -54,6 +54,30 @@ public class QName implements Serializable { this.hashCode = toHashString().hashCode(); } + /** + * Main constructor. + * @param namespaceURI the namespace URI + * @param qName the qualified name + */ + public QName(String namespaceURI, String qName) { + if (qName == null) { + throw new NullPointerException("Parameter localName must not be null"); + } + if (qName.length() == 0) { + throw new IllegalArgumentException("Parameter localName must not be empty"); + } + this.namespaceURI = namespaceURI; + int p = qName.indexOf(':'); + if (p > 0) { + this.prefix = qName.substring(0, p); + this.localName = qName.substring(p + 1); + } else { + this.prefix = null; + this.localName = qName; + } + this.hashCode = toHashString().hashCode(); + } + /** @return the namespace URI */ public String getNamespaceURI() { return this.namespaceURI; -- cgit v1.2.3