Cramfull Compiled Resources v2.00

be.arci.cramfull
Class CompilerEntry

java.lang.Object
  |
  +--be.arci.cramfull.CompilerEntry

public class CompilerEntry
extends java.lang.Object

Definition of a resource file to be encoded by a ClassCompiler. A CompilerEntry contains a path to the resource file, a name for the resource, and the name of the Encoder subclass to encode that resource with. CompilerEntry is the interface between the ClassCompiler and user-written resource compilers like the be.arci.pub.ResourceCompiler example.

See Also:
ClassCompiler,
ResourceCompiler

Constructor Summary
CompilerEntry(java.io.File flPath, java.lang.String sEncoder)
          Creates a CompilerEntry for the resource at flPath, with as resource name flPath.getPath().
CompilerEntry(java.io.File flPath, java.lang.String sResourceName, java.lang.String sEncoder)
          Creates a CompilerEntry for the resource at flPath.
CompilerEntry(java.lang.String sBaseName, java.io.File flPath, java.lang.String sEncoder)
          Creates a CompilerEntry for the resource at flPath, with as resource name sBaseName + flPath.getPath().
 
Method Summary
 java.io.File getCanonicalPath()
          Returns the canonical form of the file path to the resource defined by this CompilerEntry.
 java.lang.String getEncoder()
          Returns the Encoder for the resource defined by this CompilerEntry.
 java.lang.String getResourceName()
          Returns the resource name of the resource defined by this CompilerEntry.
 java.lang.String toString()
          Returns a String representation of this CompilerEntry containing the canonical form of the file path to the resource defined by this CompilerEntry, it's resource name, and the class name of the Encoder subclass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompilerEntry

public CompilerEntry(java.io.File flPath,
                     java.lang.String sEncoder)
Creates a CompilerEntry for the resource at flPath, with as resource name flPath.getPath().

Parameters:
flPath - the path to the resource
sEncoder - qualified class name of the Encoder for the resource
See Also:
CompilerEntry(File flPath, String sResourceName, String sEncoder)

CompilerEntry

public CompilerEntry(java.lang.String sBaseName,
                     java.io.File flPath,
                     java.lang.String sEncoder)
Creates a CompilerEntry for the resource at flPath, with as resource name sBaseName + flPath.getPath().

Parameters:
sBaseName - path prefix to the resource name, ending in a File.separatorChar
flPath - the path to the resource
sEncoder - qualified class name of the Encoder for the resource
See Also:
CompilerEntry(File flPath, String sResourceName, String sEncoder)

CompilerEntry

public CompilerEntry(java.io.File flPath,
                     java.lang.String sResourceName,
                     java.lang.String sEncoder)
Creates a CompilerEntry for the resource at flPath.

Parameters:
flPath - the path to the resource
sResourceName - name for the resource; in the compiled Cramfull subclass this name will be replaced by the equal-length suffix of the canonical form of the file path to the resource, with the separator char (File.separatorChar) replaced by '/'.
sEncoder - qualified class name of the Encoder for the resource
See Also:
"java.io.File.separatorChar"
Method Detail

getCanonicalPath

public java.io.File getCanonicalPath()
Returns the canonical form of the file path to the resource defined by this CompilerEntry. Although Resorcer allows adding a resource file under different name, this method allows user interfaces to ClassCompiler like be.arci.pub.ResourceCompiler to check for duplicates.
Returns:
the canonical form of the file path to this resource

getResourceName

public java.lang.String getResourceName()
Returns the resource name of the resource defined by this CompilerEntry.
Returns:
the resource name of this resource

getEncoder

public java.lang.String getEncoder()
Returns the Encoder for the resource defined by this CompilerEntry.
Returns:
the qualified class name of the Encoder for this resource

toString

public java.lang.String toString()
Returns a String representation of this CompilerEntry containing the canonical form of the file path to the resource defined by this CompilerEntry, it's resource name, and the class name of the Encoder subclass.
Overrides:
toString in class java.lang.Object
Returns:
a String representation of this CompilerEntry

Cramfull Compiled Resources v2.00