ResourceWriter Class

ResourceWriter Class

This Package | All Packages

public final class ResourceWriter
implements IResourceWriter

The ResourceWriter is responsible for persisting resource data to disk. This can either be done by persisting out data from an existing ResourceManager or creating a new ResourceWriter and using the setXXX methods.

Constructors
Name Description
ResourceWriter() Creates a ResourceWriter.
ResourceWriter(ResourceManager manager) Creates a ResourceWriter.

Methods
Name Description
persistProperties() Forces all properties to be written to disk.
setBoolean(Locale locale, String name, boolean value) Sets the root directory and baseName for the files.
setByte(Locale locale, String name, byte value) Sets the root directory and baseName for the files.
setChar(Locale locale, String name, char value) Sets the root directory and baseName for the files.
setDouble(Locale locale, String name, double value) Sets the root directory and baseName for the files.
setFileLocation(String rootDirectory, String baseName) Sets the root directory and baseName for the files.
setFloat(Locale locale, String name, float value) Sets the root directory and baseName for the files.
setInt(Locale locale, String name, int value) Sets the root directory and baseName for the files.
setLong(Locale locale, String name, long value) Sets the root directory and baseName for the files.
setObject(Locale locale, String name, Object value) Sets the root directory and baseName for the files.
setShort(Locale locale, String name, short value) Sets the root directory and baseName for the files.
setString(Locale locale, String name, String value) Sets the root directory and baseName for the files.

Constructors

ResourceWriter.ResourceWriter

Syntax 1
public ResourceWriter();
Description

Creates a ResourceWriter.



Syntax 2
public ResourceWriter( ResourceManager manager );
Parameters
manager
The ResourceManager to get data from.
Description

Creates a ResourceWriter. The created writer gets data from the specified ResourceManager.

Methods

ResourceWriter.persistProperties

Syntax
public void persistProperties();
Description

Forces all properties to be written to disk.

ResourceWriter.setBoolean

Syntax
public void setBoolean( Locale locale, String name, boolean value );
Parameters
rootDirectory
he directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setByte

Syntax
public void setByte( Locale locale, String name, byte value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setChar

Syntax
public void setChar( Locale locale, String name, char value );
Parameters
rootDirectory
he directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setDouble

Syntax
public void setDouble( Locale locale, String name, double value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setFileLocation

Syntax
public void setFileLocation( String rootDirectory, String baseName );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setFloat

Syntax
public void setFloat( Locale locale, String name, float value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setInt

Syntax
public void setInt( Locale locale, String name, int value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setLong

Syntax
public void setLong( Locale locale, String name, long value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setObject

Syntax
public void setObject( Locale locale, String name, Object value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setShort

Syntax
public void setShort( Locale locale, String name, short value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.

ResourceWriter.setString

Syntax
public void setString( Locale locale, String name, String value );
Parameters
rootDirectory
The directory to create resource files in.
baseName
Base file name. The locale information and resource extension will be postpended onto this name.
Description

Sets the root directory and baseName for the files.