pbwest      2004/05/29 23:33:51

  Modified:    src/java/org/apache/fop/datatypes Tag: FOP_0-20-0_Alt-Design
                        LanguageType.java
  Log:
  Added getISO639_1Language(PropertyValue)
  and getLanguage(PropertyValue)
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.1.2.4   +37 -3     
xml-fop/src/java/org/apache/fop/datatypes/Attic/LanguageType.java
  
  Index: LanguageType.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/datatypes/Attic/LanguageType.java,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -r1.1.2.3 -r1.1.2.4
  --- LanguageType.java 29 May 2004 19:25:59 -0000      1.1.2.3
  +++ LanguageType.java 30 May 2004 06:33:51 -0000      1.1.2.4
  @@ -76,7 +76,41 @@
           return string;
       }
   
  +    /**
  +     * Gets the ISO 639-2T language code from a PropertyValue
  +     * @param pv
  +     * @return the language code
  +     * @exception PropertyException if the <code>PropertyValue</code> is not
  +     * a <code>LanguageType</code>
  +     */
  +    public static String getLanguage(PropertyValue pv)
  +    throws PropertyException {
  +        if (pv.getType() == PropertyValue.LANGUAGE) {
  +            return ((LanguageType)pv).getLanguage();
  +        }
  +        throw new PropertyException("PropertyValue not an LANGUAGE type");
  +    }
  +
  +    /**
  +     * Gets the ISO 639-1 language code
  +     * @return the language code
  +     */
       public String getISO639_1Language() {
           return iso639_1Code;
  +    }
  +
  +    /**
  +     * Gets the ISO 639-1 language code from a PropertyValue
  +     * @param pv
  +     * @return the language code
  +     * @exception PropertyException if the <code>PropertyValue</code> is not
  +     * a <code>LanguageType</code>
  +     */
  +    public static String getISO639_1Language(PropertyValue pv)
  +    throws PropertyException {
  +        if (pv.getType() == PropertyValue.LANGUAGE) {
  +            return ((LanguageType)pv).getISO639_1Language();
  +        }
  +        throw new PropertyException("PropertyValue not an LANGUAGE type");
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to