com.ptc.windchill.instassm
Class InstalledLocale

java.lang.Object
  extended bycom.ptc.windchill.instassm.XmlFragment
      extended bycom.ptc.windchill.instassm.InstalledLocale

public final class InstalledLocale
extends XmlFragment

A class for reading the locale files for individual installed assemblies.

Supported API: false

Extendable: false


Field Summary
private  String localeCode_
           
private  String name_
           
 
Constructor Summary
(package private) InstalledLocale(Element element)
           
  InstalledLocale(File file)
          Read the installed locale file from the given file.
  InstalledLocale(InputStream input_stream)
          Read the installed locale file from the given file.
  InstalledLocale(String locale_code)
           
  InstalledLocale(String locale_code, String locale_name)
           
 
Method Summary
(package private) static InstalledLocale[] findInstalledLocales()
           
 String getLocaleCode()
          The code for the installed locale.
 String getName()
          The name of the installed locale.
protected  String getRootElementName()
           
protected  String getSaveToFileName()
           
protected  void initFrom(Element element)
           
static void main(String[] args)
           
 void saveToDir(File dir)
          Save the fragment as a file into a specified directory.
 void saveToRegistryDir()
          Save the fragment as a file into the registry dir that IAConstants has been initialized with.
protected  void setAttributesOn(Element element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name_

private String name_

localeCode_

private String localeCode_
Constructor Detail

InstalledLocale

public InstalledLocale(File file)
                throws IAException
Read the installed locale file from the given file.

Parameters:
file -
Throws:
IAException - if the file is not found, if the contents of the file are malformed, or if the rel id in the file is inconsistent with the name fo the file

InstalledLocale

public InstalledLocale(InputStream input_stream)
                throws IAException
Read the installed locale file from the given file.

Parameters:
input_stream - InputStream containing just the .ia content. The stream will not be closed when reading is complete.
Throws:
IAException - if the file is not found, if the contents of the file are malformed

InstalledLocale

InstalledLocale(Element element)
          throws IAException

InstalledLocale

public InstalledLocale(String locale_code)
                throws IAException

InstalledLocale

public InstalledLocale(String locale_code,
                       String locale_name)
                throws IAException
Method Detail

initFrom

protected void initFrom(Element element)
                 throws IAException
Specified by:
initFrom in class XmlFragment
Throws:
IAException

setAttributesOn

protected void setAttributesOn(Element element)
Specified by:
setAttributesOn in class XmlFragment

getLocaleCode

public String getLocaleCode()
The code for the installed locale.

Supported API: false

Extendable: false

Returns:
a non-null release identifier

getName

public String getName()
The name of the installed locale.

Supported API: false

Extendable: false

Returns:
a non-null, possibly empty string

getSaveToFileName

protected String getSaveToFileName()
Specified by:
getSaveToFileName in class XmlFragment

getRootElementName

protected String getRootElementName()
Specified by:
getRootElementName in class XmlFragment

findInstalledLocales

static InstalledLocale[] findInstalledLocales()
                                       throws IAException
Throws:
IAException

main

public static void main(String[] args)
                 throws IAException
Throws:
IAException

saveToRegistryDir

public void saveToRegistryDir()
                       throws IAException
Save the fragment as a file into the registry dir that IAConstants has been initialized with.

Throws:
IAException
See Also:
IAConstants

saveToDir

public void saveToDir(File dir)
               throws IAException
Save the fragment as a file into a specified directory.

Throws:
IAException