|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.squawk.Suite
public final class Suite
A suite is the unit of deployment/compilation in the Squawk system.
Field Summary | |
---|---|
static int |
APPLICATION
Denotes a suite that encapsulates an application. |
static int |
DEBUG
Denotes a suite that is being debugged. |
static int |
EXTENDABLE_LIBRARY
Denotes a suite that encapsulates an open library. |
static String |
FILE_EXTENSION
File name extension that identifies a Suite, includes the '.'. |
static String |
FILE_EXTENSION_API
File name extension that identifies a Suite's api, includes the '.'. |
static String |
FILE_EXTENSION_METADATA
File name extension that identifies a Suite's metadata, includes the '.'. |
static int |
LIBRARY
Denotes a suite that encapsulates a library. |
static int |
METADATA
Denotes a suite that contains all the KlassMetadata for its parent suite. |
static String |
PROPERTIES_MANIFEST_RESOURCE_NAME
Denotes the name of the resource that represents the resource name from which I extract properties from when an installResource(ResourceFile) is done. |
Method Summary | |
---|---|
void |
addNoClassDefFoundErrorClassNames(String[] classNames)
If a Klass.forName(String) is performed and class requested is not found AND
its added to our list of #classesToNoClassDefFoundError then we will throw a
NoClassDefFoundError . |
void |
close()
Closes this suite. |
boolean |
contains(Klass klass)
Returns true if this suite contains the given klass. |
boolean |
equals(Object other)
Compares this suite with another object for equality. |
int |
getClassCount()
Gets the number of classes in this suite. |
String |
getConfiguration()
Gets the configuration of the suite. |
Klass |
getKlass(int suiteID)
Gets the class in this suite corresponding to a given class number. |
String |
getManifestProperty(String name)
Gets the value of an PROPERTIES_MANIFEST_RESOURCE_NAME property embedded in the suite. |
Enumeration |
getManifestPropertyNames()
Gets the names of all manifest properties embedded in this suite. |
String |
getName()
Gets this suite's name. |
int |
getNextAvailableClassNumber()
Gets the next available number for a class that will be installed in this suite. |
Suite |
getParent()
Gets the parent suite of this suite. |
InputStream |
getResourceAsStream(String name,
Klass klass)
Finds a resource with a given name. |
byte[] |
getResourceData(String name)
Gets the contents of a resource file embedded in the suite. |
ResourceFile[] |
getResourceFiles()
Return all of the resource files defined for this suite. |
static Suite |
getSuite(String uri)
Gets the Suite corresponding to a given URI, loading it if necessary. |
static Suite |
getSuite(String uri,
boolean errorOnIOException)
Gets the Suite corresponding to a given URI, loading it if necessary. |
String |
getURI()
Gets the URI identifier of the serialized form of this suite. |
int |
hashCode()
Returns a hashcode for this suite which is derived solely from the suite's name. |
void |
installClass(Klass klass)
Installs a given class into this suite. |
void |
installProperty(ManifestProperty property)
Installs a collection of IMlet property values into this suite. |
void |
installResource(ResourceFile resourceFile)
Installs a collection of resource files into this suite. |
boolean |
isBootstrap()
Determines if this is the bootstrap suite containing the system classes. |
boolean |
isClosed()
Determines if this suite is closed. |
protected void |
loadProperties(byte[] bytes)
Parse properties from jar manifest file. |
Klass |
lookup(String name)
Gets the Klass instance from this suite corresponding
to a specified class name in internal form. |
void |
save(DataOutputStream dos,
String uri)
Serializes the object graph rooted by this suite and writes it to a given stream. |
ObjectMemory |
save(DataOutputStream dos,
String uri,
boolean bigEndian)
Serializes the object graph rooted by this suite and writes it to a given stream. |
void |
saveKlassMetadatas(DataOutputStream dos,
String uri)
Serializes the object graph rooted by this suite and writes it to a given stream. |
void |
saveKlassMetadatas(DataOutputStream dos,
String uri,
boolean bigEndian)
Serializes the object graph rooted by this suite and writes it to a given stream. |
void |
setProperty(String key,
String value)
|
void |
setUnusedClasses(Klass[] klasses)
|
Suite |
strip(int type,
String name,
Suite parent)
Creates a copy of this suite with its symbolic information stripped according to the given parameters. |
String |
toString()
Gets a string representation of this suite. |
static String |
typeToString(int suiteType)
Given one of the defined suite types, return an English string describing the suite type. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int APPLICATION
public static final int LIBRARY
public static final int EXTENDABLE_LIBRARY
public static final int DEBUG
public static final int METADATA
public static final String FILE_EXTENSION
public static final String FILE_EXTENSION_API
public static final String FILE_EXTENSION_METADATA
public static final String PROPERTIES_MANIFEST_RESOURCE_NAME
installResource(ResourceFile)
is done.
Method Detail |
---|
public String getName()
public Suite getParent()
public String getURI()
public int getClassCount()
public boolean isClosed()
public boolean isBootstrap()
public int getNextAvailableClassNumber()
public Klass getKlass(int suiteID)
suiteID
- the class number of the class to retrieve
suiteID
public byte[] getResourceData(String name)
name
- the name of the resource file whose contents is to be retrieved
public ResourceFile[] getResourceFiles()
public Enumeration getManifestPropertyNames()
public String getManifestProperty(String name)
PROPERTIES_MANIFEST_RESOURCE_NAME
property embedded in the suite.
name
- the name of the property whose value is to be retrieved
public final InputStream getResourceAsStream(String name, Klass klass)
name
- name of the desired resourceklass
- Used to get the absolute path to resource if name is not absolute, if null, then assume resource name is absolute
java.io.InputStream
object.public String toString()
toString
in class Object
public void installClass(Klass klass)
klass
- the class to installpublic void setUnusedClasses(Klass[] klasses)
public void addNoClassDefFoundErrorClassNames(String[] classNames)
Klass.forName(String)
is performed and class requested is not found AND
its added to our list of #classesToNoClassDefFoundError
then we will throw a
NoClassDefFoundError
.
classNames
- public void installResource(ResourceFile resourceFile)
resourceFile
- file to installprotected void loadProperties(byte[] bytes)
public void setProperty(String key, String value)
public void installProperty(ManifestProperty property)
property
- IMlet property to installpublic Klass lookup(String name)
Klass
instance from this suite corresponding
to a specified class name in internal form.
name
- the name (in internal form) of the class to lookup
Klass
instance corresponding to
internalName
or null
if there
isn't one.public boolean contains(Klass klass)
klass
- the klass
public final boolean equals(Object other)
other
is a Suite
instance
and its name is equal to this suite's name.
equals
in class Object
other
- the object to compare this suite against
other
is a Suite
instance
and its name is equal to this suite's nameBoolean.hashCode()
,
Hashtable
public final int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
public static Suite getSuite(String uri, boolean errorOnIOException) throws Error
uri
- the URI identifying the object memoryerrorOnIOException
- if true, throw an Error if an IOException occurs, otherwise return null.
uri
Error
- if the suite denoted by URI is not available or there was
a problem while loading itpublic static Suite getSuite(String uri) throws Error
uri
- the URI identifying the object memory
uri
Error
- if the suite denoted by URI is not available or there was
a problem while loading itpublic String getConfiguration()
public void save(DataOutputStream dos, String uri) throws IOException, OutOfMemoryError
dos
- the DataOutputStream to which the serialized suite should be writtenuri
- the URI identifier of the serialized suite
OutOfMemoryError
- if there was insufficient memory to do the save
IOException
- if there was some IO problem while writing the outputpublic ObjectMemory save(DataOutputStream dos, String uri, boolean bigEndian) throws IOException, OutOfMemoryError
dos
- the DataOutputStream to which the serialized suite should be writtenuri
- the URI identifier of the serialized suitebigEndian
- the endianess to be used when serializing this suite
OutOfMemoryError
- if there was insufficient memory to do the save
IOException
- if there was some IO problem while writing the outputpublic void saveKlassMetadatas(DataOutputStream dos, String uri) throws IOException, OutOfMemoryError
dos
- the DataOutputStream to which the serialized suite should be writtenuri
- the URI identifier of the serialized suite
OutOfMemoryError
- if there was insufficient memory to do the save
IOException
- if there was some IO problem while writing the outputpublic void saveKlassMetadatas(DataOutputStream dos, String uri, boolean bigEndian) throws IOException, OutOfMemoryError
dos
- the DataOutputStream to which the serialized suite should be writtenuri
- the URI identifier of the serialized suitebigEndian
- the endianess to be used when serializing this suite
OutOfMemoryError
- if there was insufficient memory to do the save
IOException
- if there was some IO problem while writing the outputpublic static String typeToString(int suiteType)
suiteType
- One of APPLICATION, LIBRARY, EXTENDABLE_LIBRARY, or DEBUG.
public void close()
public Suite strip(int type, String name, Suite parent)
type
- specifies the type of the suite after closing. Must be
APPLICATION
, LIBRARY
, EXTENDABLE_LIBRARY
or DEBUG
.name
- new suite nameparent
-
|
" 2013 FRC Java API " |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |