diff options
author | Peter Bernard West <pbwest@apache.org> | 2004-05-30 06:34:41 +0000 |
---|---|---|
committer | Peter Bernard West <pbwest@apache.org> | 2004-05-30 06:34:41 +0000 |
commit | cd692ef1664491d26bee2a28150268730c7c3fbc (patch) | |
tree | eb6176111875a7eebe55f51fd2224e61a6bd205a /src | |
parent | 3ae3b81343a83c34c97d2e5f5e0d46f1f8509b39 (diff) | |
download | xmlgraphics-fop-cd692ef1664491d26bee2a28150268730c7c3fbc.tar.gz xmlgraphics-fop-cd692ef1664491d26bee2a28150268730c7c3fbc.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/datatypes/NCName.java | 15 |
1 files changed, 15 insertions, 0 deletions
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 @@ -104,6 +104,21 @@ public class NCName extends StringType { } /** + * 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. */ public void validate() throws PropertyException { |