Arch4J generator 1.1

org.arch4j.generator
Class JavaObjectDefinition

java.lang.Object
  |
  +--org.arch4j.generator.JavaDefinition
        |
        +--org.arch4j.generator.JavaObjectDefinition
All Implemented Interfaces:
JavaKeywordConstants, JavaPrimitiveConstants
Direct Known Subclasses:
JavaClassDefinition, JavaInterfaceDefinition

public abstract class JavaObjectDefinition
extends JavaDefinition
implements JavaKeywordConstants

This class defines the common attributes of an object definition. Subclasses further define the settings, keywords, and values that make up a valid Java class or interface definition.

Comments and parameters that use the word object are collectively referring to either a Java class or interface.

Version:
1.0
Author:
Ross E. Greinke

Field Summary
protected  List implementedInterfaces
          A list of implemented interfaces, expressed as JavaType objects.
protected  boolean isStrict
          Does the object need to guarantee strictfp? Default = false.
protected  JavaType objectName
          The object, defined as a Java type.
 
Fields inherited from class org.arch4j.generator.JavaDefinition
accessModifier, comment
 
Fields inherited from interface org.arch4j.generator.JavaKeywordConstants
ABSTRACT, CATCH, CLASS, DEFAULT_ACCESS, EXTENDS, FALSE, FINAL, FINALLY, IMPLEMENTS, IMPORT, INTERFACE, NATIVE, NEW, NULL, PACKAGE, PRIVATE, PROTECTED, PUBLIC, RETURN, STATIC, STRICTFP, SUPER, SYNCHRONIZED, THIS, THROW, THROWS, TRANSIENT, TRUE, TRY, VOID, VOLATILE
 
Fields inherited from interface org.arch4j.generator.JavaPrimitiveConstants
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT
 
Constructor Summary
JavaObjectDefinition(String comment, JavaAccessModifier accessModifier, boolean isStrict, JavaType objectName, List implementedInterfaces)
          Constructs a JavaObjectDefinition with the specified comment, access control modifier, whether the object needs strictfp floating-point calculations, the Java object type, and list of implemented interfaces.
JavaObjectDefinition(String comment, JavaAccessModifier accessModifier, JavaType objectName, List implementedInterfaces)
          Constructs a JavaObjectDefinition with the specified comment, access control modifier, Java object type, and list of implemented interfaces.
JavaObjectDefinition(String comment, String accessModifier, boolean isStrict, String objectName, List implementedInterfaces)
          Constructs a JavaObjectDefinition with the specified comment, access control modifier, whether the object needs strictfp floating-point calculations, the object name, and list of implemented interfaces.
JavaObjectDefinition(String comment, String accessModifier, String objectName, List implementedInterfaces)
          Constructs a JavaObjectDefinition with the specified comment, access control modifier, object name, and list of implemented interfaces.
 
Method Summary
 void addImplementedInterface(JavaType interfaceType)
          Add an interface that is implemented by the object.
 void addImplementedInterface(String interfaceName)
          Add an interface that is implemented by the object.
 void addImplementedInterfaces(List interfaces)
          Add a list of interfaces that are implemented by the object.
 List getImplementedInterfaces()
          Returns a List of interfaces implemented by the object.
 List getImports()
          Returns a list of potential import types for the object.
abstract  String getObjectKeyword()
          Returns the object keyword for the object.
 JavaType getObjectName()
          Returns the Java type that represents the object.
abstract  boolean isAbstract()
          Returns whether the object is abstract or not.
 boolean isClassDefinition()
          Returns whether or not this object defines a class or not.
 boolean isInterfaceDefinition()
          Returns whether or not this object defines an interface or not.
 boolean isStrict()
          Returns whether the object needs strictfp or not.
protected  void setImplementedInterfaces(List interfaces)
          Set the list of interfaces that are implemented by the object.
 void setStrict(boolean value)
          Set whether the object needs strictfp or not.
 
Methods inherited from class org.arch4j.generator.JavaDefinition
getAccessModifier, getComment, getDefinition, hasComment, setAccessModifier, setComment, writeDefinitionTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isStrict

protected boolean isStrict
Does the object need to guarantee strictfp? Default = false.


objectName

protected JavaType objectName
The object, defined as a Java type.


implementedInterfaces

protected List implementedInterfaces
A list of implemented interfaces, expressed as JavaType objects.

Constructor Detail

JavaObjectDefinition

public JavaObjectDefinition(String comment,
                            String accessModifier,
                            String objectName,
                            List implementedInterfaces)
Constructs a JavaObjectDefinition with the specified comment, access control modifier, object name, and list of implemented interfaces. The list should contain JavaType objects representing each implemented interface, although Strings will be converted if it is more convenient to use Strings.

Parameters:
comment - The object's descriptive comment.
accessModifier - The object's access control modifier.
objectName - The object's name.
implementedInterfaces - The list of implemented interfaces.

JavaObjectDefinition

public JavaObjectDefinition(String comment,
                            JavaAccessModifier accessModifier,
                            JavaType objectName,
                            List implementedInterfaces)
Constructs a JavaObjectDefinition with the specified comment, access control modifier, Java object type, and list of implemented interfaces. The list should contain JavaType objects representing each implemented interface, although Strings will be converted if it is more convenient to use Strings.

Parameters:
comment - The object's descriptive comment.
accessModifier - The object's access control modifier.
objectName - The object's Java type specification.
implementedInterfaces - The list of implemented interfaces.

JavaObjectDefinition

public JavaObjectDefinition(String comment,
                            String accessModifier,
                            boolean isStrict,
                            String objectName,
                            List implementedInterfaces)
Constructs a JavaObjectDefinition with the specified comment, access control modifier, whether the object needs strictfp floating-point calculations, the object name, and list of implemented interfaces. The list should contain JavaType objects representing each implemented interface, although Strings will be converted if it is more convenient to use Strings.

Parameters:
comment - The object's descriptive comment.
accessModifier - The object's access control modifier.
objectName - The object's name.
implementedInterfaces - The list of implemented interfaces.

JavaObjectDefinition

public JavaObjectDefinition(String comment,
                            JavaAccessModifier accessModifier,
                            boolean isStrict,
                            JavaType objectName,
                            List implementedInterfaces)
Constructs a JavaObjectDefinition with the specified comment, access control modifier, whether the object needs strictfp floating-point calculations, the Java object type, and list of implemented interfaces. The list should contain JavaType objects representing each implemented interface, although Strings will be converted if it is more convenient to use Strings.

Parameters:
comment - The object's descriptive comment.
accessModifier - The object's access control modifier.
objectName - The object's Java type specification.
implementedInterfaces - The list of implemented interfaces.
Method Detail

isStrict

public boolean isStrict()
Returns whether the object needs strictfp or not.

Returns:
true if the object needs strictfp for floating-point calculations.

setStrict

public void setStrict(boolean value)
Set whether the object needs strictfp or not.

Parameters:
value - true for strictfp for floating-point calculations.

getObjectName

public JavaType getObjectName()
Returns the Java type that represents the object.

Returns:
The Java type that represents the object.

getImplementedInterfaces

public List getImplementedInterfaces()
Returns a List of interfaces implemented by the object.

Returns:
A List of interfaces implemented by the object.

addImplementedInterface

public void addImplementedInterface(String interfaceName)
Add an interface that is implemented by the object. The interface name may include the package name.

Parameters:
interfaceName - The interface name.

addImplementedInterface

public void addImplementedInterface(JavaType interfaceType)
Add an interface that is implemented by the object. The interface is expressed as a Java type.

Parameters:
interfaceType - The interface type.

addImplementedInterfaces

public void addImplementedInterfaces(List interfaces)
Add a list of interfaces that are implemented by the object.

Parameters:
interfaces - The list of interface names or types to add.

isClassDefinition

public boolean isClassDefinition()
Returns whether or not this object defines a class or not.

Returns:
whether or not this object defines a class or not.

isInterfaceDefinition

public boolean isInterfaceDefinition()
Returns whether or not this object defines an interface or not.

Returns:
whether or not this object defines an interface or not.

getObjectKeyword

public abstract String getObjectKeyword()
Returns the object keyword for the object.

Returns:
The object keyword for the object.

isAbstract

public abstract boolean isAbstract()
Returns whether the object is abstract or not.

Returns:
true if the object is considered abstract.

getImports

public List getImports()
Returns a list of potential import types for the object. It should be a List of JavaType objects.

Specified by:
getImports in class JavaDefinition
Returns:
A list of potential import types for the object.

setImplementedInterfaces

protected void setImplementedInterfaces(List interfaces)
Set the list of interfaces that are implemented by the object.

Parameters:
interfaces - The list of interfaces.

Arch4J generator 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.