Previous section   Next section
InternationalString javax.xml.registry.infomodel

JAXR 1.0; JWSDP 1.0, J2EE 1.4
public interface InternationalString {
// Public Instance Methods
    public abstract void addLocalizedString(LocalizedString localizedString)
       throws javax.xml.registry.JAXRException;             //L0
    public abstract void addLocalizedStrings(Collection localizedStrings)
       throws javax.xml.registry.JAXRException;             //L0
    public abstract LocalizedString getLocalizedString(Locale locale, 
String charsetName) 
       throws javax.xml.registry.JAXRException;             //L0
    public abstract Collection getLocalizedStrings(  )
       throws javax.xml.registry.JAXRException;             //L0
    public abstract String getValue(  )
       throws javax.xml.registry.JAXRException;             //L0
    public abstract String getValue(Locale locale)
       throws javax.xml.registry.JAXRException;             //L0
    public abstract void removeLocalizedString(LocalizedString localizedString) 
      throws javax.xml.registry.JAXRException;             //L0
    public abstract void removeLocalizedStrings(Collection localizedStrings)
       throws javax.xml.registry.JAXRException;             //L0
    public abstract void setValue(String value)
       throws javax.xml.registry.JAXRException;             //L0
    public abstract void setValue(Locale locale, String value)
       throws javax.xml.registry.JAXRException;             //L0
}

An InternationalString contains a string that has been translated for one or more locales, in which each translation is represented by a LocalizedString object that specifies a locale, the text to be used in that locale and, optionally, the character set that the locale requires. The LifeCycleManager createInternationalString( ) method can be used to create an InternationalString and optionally to add a LocalizedString for a single locale. The name attribute of RegistryObject is of type InternationalString; therefore, all of the factory methods of LifeCycleManager that create objects in the registry either accept a name argument of this type, or allow you to specify the name as a String that is then converted to an InternationalString associated with the current locale.

Once you have an InternationalString object, you can add translations for additional locales by creating the appropriate LocalizedString and using the addLocalizedString( ) or addLocalizedStrings( ) methods. In the unlikely event that you need to remove translations, use the removeLocalizedString( ) or removeLocalizedStrings( ) methods. The getLocalizedStrings( ) method returns a Collection of all of the LocalizedStrings that the InternationalString contains, while getLocalizedString( ) returns the appropriate LocalizedString for a given locale and character set, or null if there isn't one.

If you don't want to deal directly with LocalizedStrings, you can use one of the setValue( ) methods instead. The setValue(Locale locale, String value) method creates and adds a LocalizedString with the given value and locale, using the default character set (which is UTF-8). The setValue(String value) does the same, but defaults to the system's default locale. The getValue(Locale locale) method retrieves the string that is appropriate for the given locale, while getValue( ) returns the value for the system's default locale. These methods return null if there is no value stored for the given locale.

Passed To

javax.xml.registry.LifeCycleManager.{createClassification( ), createClassificationScheme( ), createConcept( ), createExternalIdentifier( ), createExternalLink( ), createOrganization( ), createRegistryPackage( ), createService( )}, RegistryObject.{setDescription( ), setName( )}, SpecificationLink.setUsageDescription( )

Returned By

javax.xml.registry.LifeCycleManager.createInternationalString( ), RegistryObject.{getDescription( ), getName( )}, SpecificationLink.getUsageDescription( )


  Previous section   Next section