|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.daileon.ResourcesFactory
public class ResourcesFactory
The ResourcesFactory
class is a static factory that retrieves a
particular Strategy
implementation, or a
particular AbstractAnnotationsReplacer
implementation.
One can define how the annotations that correspond to the domain annotations
are organized. If they are organized in annotations, then it is possible to
use the default implementation of the Strategy
interface, which
is the AnnotationsStrategy
class. If no
values are indicated in the <strategy-class>
element of
the XML configuration file, then the default implementation is used. However,
if they are organized in other forms, such as XML files, or even database
tables, then the fully-qualified name of this implementation has to be
indicated in the XML configuration file.
The user can also define if the domain annotations will be either kept or not
in the final bytecode. The framework provides two implementations for each
situation, which are the
DomainAnnotationsKeeper
and the
DomainAnnotationsDiscarder
classes.
However, the user may define situations where the domain annotations should
be kept in the final bytecode. To do so, a class that extends the
AbstractAnnotationsReplacer
has to be built and indicated in the
XML configuration file. If no values are indicated in the
<domain-annotations-replacer>
element of the XML
configuration file, then the default implementation is used.
Field Summary | |
---|---|
private static String |
DEFAULT_REPLACER
The default class that extends the AbstractAnnotationsReplacer class. |
private static String |
DEFAULT_STRATEGY
The default implementation of the net.sf.daileon.notsupported.Strategy interface. |
private static AbstractAnnotationsReplacer |
replacer
A reference to the AbstractAnnotationsReplacer object,
indicated in the XML configuration file |
private static Strategy |
strategy
A reference to the Strategy object,
indicated in the XML configuration file |
Constructor Summary | |
---|---|
private |
ResourcesFactory()
Default class constructor. |
Method Summary | |
---|---|
static AbstractAnnotationsReplacer |
getAnnotationsReplacer(org.objectweb.asm.ClassVisitor visitor)
Returns the implementation that extends the AbstractAnnotationsReplacer . |
static Strategy |
getAnnotationsTranslator()
Returns the Strategy object,
indicated in the XML configuration file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String DEFAULT_STRATEGY
net.sf.daileon.notsupported.Strategy interface. If no values
are indicated in the <strategy-class>
of the XML
configuration file, this value is used by the
getAnnotationsTranslator()
method.
- See Also:
- Constant Field Values
private static final String DEFAULT_REPLACER
AbstractAnnotationsReplacer
class. If
no values are indicated in the
<domain-annotations-replacer>
of the XML configuration
file, this value is used by the
#getAnnotationsReplacer(ClassVisitor)
method.
private static Strategy strategy
Strategy
object,
indicated in the XML configuration file
private static AbstractAnnotationsReplacer replacer
AbstractAnnotationsReplacer
object,
indicated in the XML configuration file
Constructor Detail |
---|
private ResourcesFactory()
private
constructor,
since the ResourcesFactory
class is a static factory, and
only its static methods should be used.
Method Detail |
---|
public static Strategy getAnnotationsTranslator()
Strategy
object,
indicated in the XML configuration file. This object identifies how to
translate the domain annotations to their corresponding annotations. If
no values are indicated in the XML configuration file, then the default
implementation is returned.
Strategy
implementation.
RuntimeException
- If the class provided in the XML configuration file cannot be
instantiated.public static AbstractAnnotationsReplacer getAnnotationsReplacer(org.objectweb.asm.ClassVisitor visitor)
AbstractAnnotationsReplacer
. This
object defines whether the domain annotations should be kept or not in
the code. If no values are indicated in the XML configuration file, then
the default implementation is returned.
visitor
- The ClassVisitor object, provided by the
ClassTransformer.transform(String, String)
method.
AbstractAnnotationsReplacer
class.
RuntimeException
- If the class provided in the XML configuration file cannot be
instantiated.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |