-
package org.apache.fop.datatypes;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertyConsts;
import org.apache.fop.fo.properties.*;
-import org.apache.fop.configuration.Configuration;
import org.apache.fop.datatypes.PropertyValue;
/*
{
super(property, countryCode, PropertyValue.COUNTRY);
// Validate the code
- if (Configuration.getHashMapEntry("countriesMap", countryCode)
- == null) throw new PropertyException
+ String code;
+ if ((code = CountryLanguageScript.canonicalCountryCode(countryCode))
+ == null)
+ throw new PropertyException
("Invalid country code: " + countryCode);
+ setString(code);
}
public CountryType(String propertyName, String countryCode)
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertyConsts;
import org.apache.fop.fo.properties.*;
-import org.apache.fop.configuration.Configuration;
import org.apache.fop.datatypes.PropertyValue;
/*
{
super(property, languageCode, PropertyValue.LANGUAGE);
// Validate the code
- if (Configuration.getHashMapEntry("languagesMap", languageCode)
- == null) throw new PropertyException
+ String code;
+ if ((code = CountryLanguageScript.canonicalLangCode(languageCode))
+ == null)
+ throw new PropertyException
("Invalid language code: " + languageCode);
+ setString(code);
}
public LanguageType(String propertyName, String languageCode)
-
package org.apache.fop.datatypes;
import org.apache.fop.fo.expr.PropertyException;
import org.apache.fop.fo.PropNames;
import org.apache.fop.fo.PropertyConsts;
import org.apache.fop.fo.properties.*;
-import org.apache.fop.configuration.Configuration;
import org.apache.fop.datatypes.PropertyValue;
/*
{
super(property, scriptCode, PropertyValue.SCRIPT);
// Validate the code
- if (Configuration.getHashMapEntry("scriptsMap", scriptCode)
- == null) throw new PropertyException
+ String code;
+ if ((code = CountryLanguageScript.canonicalScriptCode(scriptCode))
+ == null)
+ throw new PropertyException
("Invalid script code: " + scriptCode);
+ setString(code);
}
public ScriptType(String propertyName, String scriptCode)
}
/**
+ * Set the string value.
+ * @param string - the <tt>String</tt> value.
+ */
+ protected void setString(String string) {
+ this.string = string;
+ }
+
+ /**
+ * Get the string value.
* @return the String.
*/
public String getString() {