From: Peter Bernard West Date: Sun, 30 May 2004 06:34:41 +0000 (+0000) Subject: Added getNCName(PropertyValue) X-Git-Tag: Defoe_export~108 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd692ef1664491d26bee2a28150268730c7c3fbc;p=xmlgraphics-fop.git Added getNCName(PropertyValue) git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/FOP_0-20-0_Alt-Design@197671 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/datatypes/NCName.java b/src/java/org/apache/fop/datatypes/NCName.java index 6390ad632..d2832e3f6 100644 --- a/src/java/org/apache/fop/datatypes/NCName.java +++ b/src/java/org/apache/fop/datatypes/NCName.java @@ -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 PropertyValue is not + * an NCName + */ + 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 NCName against the associated property. */