com.metamatrix.metadata.runtime.impl
Class FileRecordImpl

java.lang.Object
  extended by com.metamatrix.metadata.runtime.impl.AbstractMetadataRecord
      extended by com.metamatrix.metadata.runtime.impl.FileRecordImpl
All Implemented Interfaces:
VDBFile, FileRecord, MetadataRecord, java.io.Serializable

public class FileRecordImpl
extends AbstractMetadataRecord
implements FileRecord

Since:
4.2
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.metamatrix.modeler.core.metadata.runtime.FileRecord
FileRecord.MetadataFieldNames, FileRecord.MetadataMethodNames
 
Nested classes/interfaces inherited from interface com.metamatrix.modeler.core.metadata.runtime.MetadataRecord
MetadataRecord.MetadataRecordProperties
 
Field Summary
 
Fields inherited from class com.metamatrix.metadata.runtime.impl.AbstractMetadataRecord
delegate, eObject
 
Constructor Summary
FileRecordImpl()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare two records for equality.
 boolean getBinary()
          Return true if this is a binary file else false.
 java.io.InputStream getContent()
          Get the contents of the file in the VDB.
 long getFileLength()
          Get the length of the file this record represents
 FileRecord getFileRecord()
          Get the instance of this class back
 java.lang.String getModelName()
          Return the name of the model in which this entity exists.
 java.lang.String getPathInVdb()
          Get the path to the file represented by this record in the vdb.
 java.lang.String[] getTokenReplacements()
          The strings used to replace tokens in the file in the vdb
 java.lang.String[] getTokens()
          The strings representing tokens in the file in the vdb
 int hashCode()
          Get hashcode for From.
 boolean isIndexFile()
          Check if the record represents a index file record.
 boolean isModelFile()
          Check if the record represents a model file record.
 void setIndexSelector(IndexSelector selector)
          Set the indexSelector on this record.
 void setPathInVdb(java.lang.String pathInVdb)
           
 void setTokenReplacements(java.lang.String[] tokenReplacements)
          Set the strings used to replace a tokens in the file in the vdb
 void setTokens(java.lang.String[] tokens)
          Set the strings that tokens in the file that need to be replaced.
 java.lang.String toString()
           
 
Methods inherited from class com.metamatrix.metadata.runtime.impl.AbstractMetadataRecord
getEObject, getFullName, getIndexVersion, getName, getNameInSource, getParentFullName, getParentPathString, getParentUUID, getPath, getPathString, getPropertyValue, getRecordType, getResourcePath, getUUID, setEObjectFinder, setFullName, setIndexVersion, setName, setNameInSource, setParentUUID, setPropertyValue, setRecordType, setResourcePath, setUUID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.metamatrix.modeler.core.metadata.runtime.MetadataRecord
getEObject, getFullName, getName, getNameInSource, getParentFullName, getParentPathString, getParentUUID, getPath, getPathString, getPropertyValue, getRecordType, getResourcePath, getUUID, setPropertyValue
 

Constructor Detail

FileRecordImpl

public FileRecordImpl()
Method Detail

getPathInVdb

public java.lang.String getPathInVdb()
Description copied from interface: VDBFile
Get the path to the file represented by this record in the vdb.

Specified by:
getPathInVdb in interface VDBFile
Returns:
The path to the file in the vdb
Since:
4.2
See Also:
VDBFile.getPathInVdb()

getBinary

public boolean getBinary()
Description copied from interface: FileRecord
Return true if this is a binary file else false.

Specified by:
getBinary in interface FileRecord
Returns:
true if this is a binary file else false.
Since:
4.2
See Also:
com.metamatrix.modeler.core.metadata.runtime.FileRecord#isBinary()

getContent

public java.io.InputStream getContent()
Description copied from interface: VDBFile
Get the contents of the file in the VDB.

Specified by:
getContent in interface VDBFile
Returns:
A inputstream as the vdb resource content.
Since:
4.2
See Also:
VDBFile.getContent()

getFileLength

public long getFileLength()
Description copied from interface: VDBFile
Get the length of the file this record represents

Specified by:
getFileLength in interface VDBFile
Returns:
Lenth of the file
Since:
4.2
See Also:
VDBFile.getFileLength()

setPathInVdb

public void setPathInVdb(java.lang.String pathInVdb)
Parameters:
pathInVdb - The pathInVdb to set.
Since:
4.2

getTokens

public java.lang.String[] getTokens()
Description copied from interface: FileRecord
The strings representing tokens in the file in the vdb

Specified by:
getTokens in interface FileRecord
Returns:
An array of strings that are tokens in the file that need to be replaced.
Since:
4.2
See Also:
com.metamatrix.modeler.core.metadata.runtime.FileRecord#getTokenReplacementString1()

getTokenReplacements

public java.lang.String[] getTokenReplacements()
Description copied from interface: FileRecord
The strings used to replace tokens in the file in the vdb

Specified by:
getTokenReplacements in interface FileRecord
Returns:
The token replacement strings
Since:
4.2
See Also:
FileRecord.getTokenReplacements()

setTokens

public void setTokens(java.lang.String[] tokens)
Description copied from interface: FileRecord
Set the strings that tokens in the file that need to be replaced.

Specified by:
setTokens in interface FileRecord
Parameters:
tokens - The tokens in the file that need to be replaced
Since:
4.2
See Also:
FileRecord.setTokens(java.lang.String[])

setTokenReplacements

public void setTokenReplacements(java.lang.String[] tokenReplacements)
Description copied from interface: FileRecord
Set the strings used to replace a tokens in the file in the vdb

Specified by:
setTokenReplacements in interface FileRecord
Parameters:
tokenReplacements - The token replacement strings
Since:
4.2
See Also:
com.metamatrix.modeler.core.metadata.runtime.FileRecord#setTokenReplacementString2(java.lang.String[])

setIndexSelector

public void setIndexSelector(IndexSelector selector)
Description copied from interface: FileRecord
Set the indexSelector on this record.

Specified by:
setIndexSelector in interface FileRecord
Parameters:
selector - The indexSelector used to look up file contents
Since:
4.2
See Also:
FileRecord.setIndexSelector(com.metamatrix.modeler.core.index.IndexSelector)

getFileRecord

public FileRecord getFileRecord()
Description copied from interface: FileRecord
Get the instance of this class back

Specified by:
getFileRecord in interface FileRecord
Returns:
The instance of this calss
Since:
4.2
See Also:
FileRecord.getFileRecord()

getModelName

public java.lang.String getModelName()
Description copied from interface: MetadataRecord
Return the name of the model in which this entity exists.

Specified by:
getModelName in interface FileRecord
Specified by:
getModelName in interface MetadataRecord
Overrides:
getModelName in class AbstractMetadataRecord
Returns:
name of the containing model
Since:
4.2
See Also:
MetadataRecord.getModelName()

isIndexFile

public boolean isIndexFile()
Description copied from interface: FileRecord
Check if the record represents a index file record.

Specified by:
isIndexFile in interface FileRecord
Returns:
true if the record is a index file
Since:
4.2
See Also:
FileRecord.isIndexFile()

isModelFile

public boolean isModelFile()
Description copied from interface: FileRecord
Check if the record represents a model file record.

Specified by:
isModelFile in interface FileRecord
Returns:
true if the record is a model or xsd file
Since:
4.2
See Also:
FileRecord.getModelName()

equals

public boolean equals(java.lang.Object obj)
Compare two records for equality.

Overrides:
equals in class AbstractMetadataRecord

hashCode

public int hashCode()
Get hashcode for From. WARNING: The hash code relies on the variables in the record, so changing the variables will change the hash code, causing a select to be lost in a hash structure. Do not hash a record if you plan to change it.

Overrides:
hashCode in class AbstractMetadataRecord

toString

public java.lang.String toString()
Overrides:
toString in class AbstractMetadataRecord


Copyright © 2009. All Rights Reserved.