From cd692ef1664491d26bee2a28150268730c7c3fbc Mon Sep 17 00:00:00 2001 From: Peter Bernard West Date: Sun, 30 May 2004 06:34:41 +0000 Subject: [PATCH] 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 --- src/java/org/apache/fop/datatypes/NCName.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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. */ -- 2.39.5