|
Cramfull Compiled Resources v2.00 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--be.arci.cramfull.ClassCompiler
Encodes resource files and serializable Objects, and compiles them into a Java .class file that is a subclass of Cramfull.
A ClassCompiler instance should be created and invoked through user interfaces like be.arci.pub.ResourceCompiler. Such user interface defines the Cramfull subclass name as well as the collection of resources to be encoded and compiled into that class. The procedure that a user interface to ClassCompiler must follow is simple:
ClassCompiler adheres strictly to Java's class-file format specification: Cramfull subclasses compiled by ClassCompiler pass the strict class-file format checks of JDK13's -Xfuture flag.
Evaluation version
Cramfull
ResourceCompiler| Field Summary | |
static char |
JOKER
Matches many char in a filename pattern (the character '*') |
static java.lang.String |
sCopy
Copyright notice; none of the Cramfull Compiled Resources license types allows you to change this. |
static char |
WILDCARD
Matches any char in a filename pattern (the character '?') |
| Constructor Summary | |
ClassCompiler(java.io.File flBaseDir,
java.lang.String sOutputClass,
boolean swNestedData,
boolean swReplace,
boolean swVerbose)
Opens a Cramfull subclass's .class file for writing resources in to. |
|
| Method Summary | |
void |
addResource(CompilerEntry ce)
Encodes a resource defined by a CompilerEntry object into the Cramfull subclass. |
void |
addSerialized(java.lang.String sResourceName,
java.lang.String sEncoder,
java.lang.Object oSerializable)
Encodes a serializable object into the Cramfull subclass. |
void |
compile()
Compiles the Java methods needed to decode the resources added to the Cramfull subclass, and closes that subclass's .class file. |
static boolean |
matchesWildcardPattern(java.lang.String sFile,
java.lang.String sPattern,
boolean swIgnoreCase)
Utility method that performs wildcard filename matches on behalf of user interfaces to ClassCompiler. |
void |
setVerbose(boolean swVerbose)
Sets verbose mode on or off |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
public static final java.lang.String sCopy
public static final char WILDCARD
matchesWildcardPattern(java.lang.String, java.lang.String, boolean)public static final char JOKER
matchesWildcardPattern(java.lang.String, java.lang.String, boolean)| Constructor Detail |
public ClassCompiler(java.io.File flBaseDir,
java.lang.String sOutputClass,
boolean swNestedData,
boolean swReplace,
boolean swVerbose)
throws java.io.IOException
flBaseDir - base directory to write the compiled class file in; this
directory and a subdirectory tree for the class's package will be created
as necessary.sOutputClass - qualified Java class name for the Cramfull subclass to compile
with the resources encoded in itswNestedData - encode the resource data into a nested class sOutputClass + "$Data"
of sOutputClass; this nested class can be garbage collected immediately after
sOutputClass is successfully instantiated. This option has no effect in the
evaluation version of the Cramfull Compiled Resources library.swReplace - if the output class exists, it will only be overwritten if this parameter is true.swVerbose - give a verbose report of the progress of the class file compilation
on System.errCramfull| Method Detail |
public static boolean matchesWildcardPattern(java.lang.String sFile,
java.lang.String sPattern,
boolean swIgnoreCase)
sFile - the filename to testsPattern - the sPattern to match againstswIgnoreCase - if true case is ignored when comparing charactersWILDCARD,
JOKER
public void addResource(CompilerEntry ce)
throws java.io.IOException
ce - resource to encode into the Cramfull subclass file. In
the evaluation version a maximum of about 100 resources can be encoded
in 1 class file, each resource being limited to some 300kB (depending on
the encoding and the type of data).addSerialized(java.lang.String, java.lang.String, java.lang.Object),
CompilerEntry
public void addSerialized(java.lang.String sResourceName,
java.lang.String sEncoder,
java.lang.Object oSerializable)
throws java.io.IOException
Objects that are serialized to a file in advance, can also be compiled into a Cramfull subclass just as any other resource file with the addResource(CompilerEntry) method.
sResourceName - name for the resourcesEncoder - qualified class name of the Encoder for the resourceoSerializable - object to serialize and encode into the Cramfull
subclass file. In the evaluation version a maximum of about 100 resources or
objects can be encoded in 1 class file, each resource or serialized object
being limited to some 300kB (depending on the encoding and the type of data).Cramfull.getDeserialized(String sResource),
addResource(CompilerEntry ce),
SerializingResourceCompiler example
public void compile()
throws java.io.IOException
addResource(CompilerEntry ce)public void setVerbose(boolean swVerbose)
|
Cramfull Compiled Resources v2.00 | |||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||