com.bigllc.retsiq.metadata
Class MetadataModel

java.lang.Object
  extended by com.bigllc.retsiq.metadata.MetadataModel

public class MetadataModel
extends java.lang.Object

Utility wrapper for metadata. This can also be used as a singleton although it now encouraged that it isn't.

Author:
Marc G. Smith

Constructor Summary
MetadataModel()
           
 
Method Summary
 void addChangeListener(MetadataChangeListener l)
           
static MetadataModel getInstance()
          Get the singleton instance of MetadataModel
 boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type, java.lang.String id, com.bigllc.retsiq.api.RETSConstants.MetadataFormat format, java.io.OutputStream out)
          Deprecated. 
 boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type, java.lang.String id, com.bigllc.retsiq.api.RETSConstants.MetadataFormat format, java.io.OutputStream out, MetadataFilter filter)
          Deprecated. 
 boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type, java.lang.String id, com.bigllc.retsiq.api.RETSConstants.MetadataFormat format, com.bigllc.retsiq.api.RETSConstants.Version version, boolean strict, MetadataFilter filter, java.io.OutputStream out)
          Output the metadata to a stream.
 boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type, java.lang.String id, com.bigllc.retsiq.api.RETSConstants.MetadataFormat format, com.bigllc.retsiq.api.RETSConstants.Version version, java.io.OutputStream out)
          Output the metadata to a stream.
 MetadataSystem getSystem()
           
 boolean isValidId(com.bigllc.retsiq.api.RETSConstants.MetadataType type, java.lang.String id)
           
 void load(java.io.File source)
           
 void load(MetadataSource source)
           
 void removeChangeListener(MetadataChangeListener l)
           
static void resetInstance()
          Change the singleton instance to a new instance of MetadataModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetadataModel

public MetadataModel()
Method Detail

getInstance

public static MetadataModel getInstance()
Get the singleton instance of MetadataModel


resetInstance

public static void resetInstance()
Change the singleton instance to a new instance of MetadataModel. This method will also garbage collect.


getSystem

public MetadataSystem getSystem()

addChangeListener

public void addChangeListener(MetadataChangeListener l)

removeChangeListener

public void removeChangeListener(MetadataChangeListener l)

load

public void load(MetadataSource source)

load

public void load(java.io.File source)

getMetadata

@Deprecated
public boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type,
                                      java.lang.String id,
                                      com.bigllc.retsiq.api.RETSConstants.MetadataFormat format,
                                      java.io.OutputStream out)
Deprecated. 

Output the metadata to a stream. Defaults to version Version.getDefault()

Parameters:
type - the metadata type as the root node
id - the identifier for the metadata node
format - the format to output as
out - the output stream to write to
Returns:
true if successful, false otherwise

getMetadata

@Deprecated
public boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type,
                                      java.lang.String id,
                                      com.bigllc.retsiq.api.RETSConstants.MetadataFormat format,
                                      java.io.OutputStream out,
                                      MetadataFilter filter)
Deprecated. 

Output the metadata to a stream. Defaults to version Version.getDefault()

Parameters:
type - the metadata type as the root node
id - the identifier for the metadata node
format - the format to output as
out - the output stream to write to
filter - a filter to be applied to the metadata or null
Returns:
true if successful, false otherwise

getMetadata

public boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type,
                           java.lang.String id,
                           com.bigllc.retsiq.api.RETSConstants.MetadataFormat format,
                           com.bigllc.retsiq.api.RETSConstants.Version version,
                           java.io.OutputStream out)
Output the metadata to a stream.

Parameters:
type - the metadata type as the root node
id - the identifier for the metadata node
format - the format to output as
version - the version of metadata to write
out - the output stream to write to
Returns:
true if successful, false otherwise

getMetadata

public boolean getMetadata(com.bigllc.retsiq.api.RETSConstants.MetadataType type,
                           java.lang.String id,
                           com.bigllc.retsiq.api.RETSConstants.MetadataFormat format,
                           com.bigllc.retsiq.api.RETSConstants.Version version,
                           boolean strict,
                           MetadataFilter filter,
                           java.io.OutputStream out)
Output the metadata to a stream.

Parameters:
type - the metadata type as the root node
id - the identifier for the metadata node
format - the format to output as
version - the version of metadata to write
filter - a filter to be applied to the metadata or null
out - the output stream to write to
Returns:
true if successful, false otherwise

isValidId

public boolean isValidId(com.bigllc.retsiq.api.RETSConstants.MetadataType type,
                         java.lang.String id)