]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Added getNCName(PropertyValue)
authorPeter Bernard West <pbwest@apache.org>
Sun, 30 May 2004 06:34:41 +0000 (06:34 +0000)
committerPeter Bernard West <pbwest@apache.org>
Sun, 30 May 2004 06:34:41 +0000 (06:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197671 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/datatypes/NCName.java

index 6390ad63275e817f76ea0391f8f6a03609217086..d2832e3f648333eaac135ff5aa5cb850ec868764 100644 (file)
@@ -103,6 +103,21 @@ public class NCName extends StringType {
         return string;
     }
 
+    /**
+     * Return the NCName value from a PropertyValue. 
+     * @param pv
+     * @return the NCName string value
+     * @exception PropertyException if the <code>PropertyValue</code> is not
+     * an <code>NCName</code>
+     */
+    public static String getNCName(PropertyValue pv)
+    throws PropertyException {
+        if (pv.getType() == PropertyValue.NCNAME) {
+            return ((NCName)pv).getNCName();
+        }
+        throw new PropertyException("PropertyValue not an NCNAME type");
+    }
+
     /**
      * validate the <i>NCName</i> against the associated property.
      */