|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.arch4j.generator.JavaDefinition | +--org.arch4j.generator.JavaObjectDefinition | +--org.arch4j.generator.JavaInterfaceDefinition
This class is used to define the attributes of a Java interface. The attributes can then be used to generate a valid Java interface definition string.
The number of constructors are meant to make it easy to define an interface with as few statements as possible. Once constructed, additional methods can be sent to further define the interface.
Field Summary | |
protected List |
superInterfaces
A list of superinterfaces, expressed as JavaType objects. |
Fields inherited from class org.arch4j.generator.JavaObjectDefinition |
implementedInterfaces, isStrict, objectName |
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 | |
JavaInterfaceDefinition(JavaType interfaceName)
Constructs a JavaInterfaceDefinition with the specified
Java interface type. |
|
JavaInterfaceDefinition(JavaType interfaceName,
JavaType superInterfaceName)
Constructs a JavaInterfaceDefinition with the specified
Java interface type and superinterface type. |
|
JavaInterfaceDefinition(String interfaceName)
Constructs a JavaInterfaceDefinition with the specified
interface name. |
|
JavaInterfaceDefinition(String comment,
JavaAccessModifier accessModifier,
boolean isStrict,
JavaType interfaceName,
List superInterfaces,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier,
whether the object needs strictfp floating-point calculations,
the Java interface type,
list of superinterfaces, and list of implemented interfaces. |
|
JavaInterfaceDefinition(String comment,
JavaAccessModifier accessModifier,
JavaType interfaceName)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, and Java interface type. |
|
JavaInterfaceDefinition(String comment,
JavaAccessModifier accessModifier,
JavaType interfaceName,
JavaType superInterfaceName)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, Java interface type,
and superinterface type. |
|
JavaInterfaceDefinition(String comment,
JavaAccessModifier accessModifier,
JavaType interfaceName,
JavaType superInterfaceName,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, Java interface type,
superinterface type, and list of implemented interfaces. |
|
JavaInterfaceDefinition(String comment,
JavaAccessModifier accessModifier,
JavaType interfaceName,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, Java interface type,
and list of implemented interfaces. |
|
JavaInterfaceDefinition(String comment,
JavaAccessModifier accessModifier,
JavaType interfaceName,
List superInterfaces,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, Java interface type,
list of superinterfaces, and list of implemented interfaces. |
|
JavaInterfaceDefinition(String interfaceName,
String superInterfaceName)
Constructs a JavaInterfaceDefinition with the specified
interface name and superinterface name. |
|
JavaInterfaceDefinition(String comment,
String accessModifier,
boolean isStrict,
String interfaceName,
List superInterfaces,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier,
whether the object needs strictfp floating-point calculations,
the interface name,
list of superinterfaces, and list of implemented interfaces. |
|
JavaInterfaceDefinition(String comment,
String accessModifier,
String interfaceName)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, and interface name. |
|
JavaInterfaceDefinition(String comment,
String accessModifier,
String interfaceName,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, interface name,
and list of implemented interfaces. |
|
JavaInterfaceDefinition(String comment,
String accessModifier,
String interfaceName,
List superInterfaces,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, interface name,
list of superinterfaces, and list of implemented interfaces. |
|
JavaInterfaceDefinition(String comment,
String accessModifier,
String interfaceName,
String superInterfaceName)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, interface name,
and superinterface name. |
|
JavaInterfaceDefinition(String comment,
String accessModifier,
String interfaceName,
String superInterfaceName,
List implementedInterfaces)
Constructs a JavaInterfaceDefinition with the specified
comment, access control modifier, interface name,
superinterface name, and list of implemented interfaces. |
Method Summary | |
void |
addSuperInterface(JavaType interfaceType)
Add an interface that this interface extends. |
void |
addSuperInterface(String interfaceName)
Add an interface that this interface extends. |
void |
addSuperInterfaces(List interfaces)
Add a list of interfaces that this interface extends. |
List |
getImports()
Returns a list of potential import types for the object. |
String |
getName()
Returns the name of this interface. |
String |
getObjectKeyword()
Returns the object keyword for the object. |
String |
getPackageName()
Returns the package within which this interface is defined. |
List |
getSuperInterfaces()
Returns a List of interfaces that this interface extends. |
boolean |
isAbstract()
Returns true, because interfaces are always abstract. |
boolean |
isInterfaceDefinition()
Returns that this class is an interface definition. |
protected void |
setSuperInterfaces(List superInterfaces)
Set the list of superinterfaces that the interface extends. |
void |
writeDefinitionTo(CodeBuffer buffer)
Write the Java source representation of the definition to the CodeBuffer . |
Methods inherited from class org.arch4j.generator.JavaObjectDefinition |
addImplementedInterface, addImplementedInterface, addImplementedInterfaces, getImplementedInterfaces, getObjectName, isClassDefinition, isStrict, setImplementedInterfaces, setStrict |
Methods inherited from class org.arch4j.generator.JavaDefinition |
getAccessModifier, getComment, getDefinition, hasComment, setAccessModifier, setComment |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected List superInterfaces
Constructor Detail |
public JavaInterfaceDefinition(String interfaceName)
JavaInterfaceDefinition
with the specified
interface name.
The access control modifier defaults to public access.
interfaceName
- The interface name.public JavaInterfaceDefinition(JavaType interfaceName)
JavaInterfaceDefinition
with the specified
Java interface type.
The access control modifier defaults to public access.
interfaceName
- The interface's Java type specification.public JavaInterfaceDefinition(String interfaceName, String superInterfaceName)
JavaInterfaceDefinition
with the specified
interface name and superinterface name.
A superinterface is an interface that this interface extends.
The access control modifier defaults to public access.
interfaceName
- The interface name.superInterfaceName
- The superinterface name.public JavaInterfaceDefinition(JavaType interfaceName, JavaType superInterfaceName)
JavaInterfaceDefinition
with the specified
Java interface type and superinterface type.
A superinterface is an interface that this interface extends.
The access control modifier defaults to public access.
interfaceName
- The interface's Java type specification.superInterfaceName
- The superinterface Java type specification.public JavaInterfaceDefinition(String comment, String accessModifier, String interfaceName)
JavaInterfaceDefinition
with the specified
comment, access control modifier, and interface name.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface name.public JavaInterfaceDefinition(String comment, JavaAccessModifier accessModifier, JavaType interfaceName)
JavaInterfaceDefinition
with the specified
comment, access control modifier, and Java interface type.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface's Java type specification.public JavaInterfaceDefinition(String comment, String accessModifier, String interfaceName, String superInterfaceName)
JavaInterfaceDefinition
with the specified
comment, access control modifier, interface name,
and superinterface name.
A superinterface is an interface that this interface extends.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface name.superInterfaceName
- The superinterface name.public JavaInterfaceDefinition(String comment, JavaAccessModifier accessModifier, JavaType interfaceName, JavaType superInterfaceName)
JavaInterfaceDefinition
with the specified
comment, access control modifier, Java interface type,
and superinterface type.
A superinterface is an interface that this interface extends.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface's Java type specification.superInterfaceName
- The superinterface Java type specification.public JavaInterfaceDefinition(String comment, String accessModifier, String interfaceName, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier, interface name,
and list of implemented interfaces.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface name.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, JavaAccessModifier accessModifier, JavaType interfaceName, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier, Java interface type,
and list of implemented interfaces.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface's Java type specification.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, String accessModifier, String interfaceName, String superInterfaceName, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier, interface name,
superinterface name, and list of implemented interfaces.
A superinterface is an interface that this interface extends.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface name.superInterfaceName
- The superinterface name.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, JavaAccessModifier accessModifier, JavaType interfaceName, JavaType superInterfaceName, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier, Java interface type,
superinterface type, and list of implemented interfaces.
A superinterface is an interface that this interface extends.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface's Java type specification.superInterfaceName
- The superinterface Java type specification.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, String accessModifier, String interfaceName, List superInterfaces, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier, interface name,
list of superinterfaces, and list of implemented interfaces.
A superinterface is an interface that this interface extends.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface name.superInterfaces
- The list of superinterfaces.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, JavaAccessModifier accessModifier, JavaType interfaceName, List superInterfaces, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier, Java interface type,
list of superinterfaces, and list of implemented interfaces.
A superinterface is an interface that this interface extends.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface's Java type specification.superInterfaces
- The list of superinterfaces.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, String accessModifier, boolean isStrict, String interfaceName, List superInterfaces, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier,
whether the object needs strictfp floating-point calculations,
the interface name,
list of superinterfaces, and list of implemented interfaces.
A superinterface is an interface that this interface extends.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface name.superInterfaces
- The list of superinterfaces.implementedInterfaces
- The list of implemented interfaces.public JavaInterfaceDefinition(String comment, JavaAccessModifier accessModifier, boolean isStrict, JavaType interfaceName, List superInterfaces, List implementedInterfaces)
JavaInterfaceDefinition
with the specified
comment, access control modifier,
whether the object needs strictfp floating-point calculations,
the Java interface type,
list of superinterfaces, and list of implemented interfaces.
A superinterface is an interface that this interface extends.
The list should contain JavaType
objects representing each
interface that this interface implements.
Strings will be converted, though, if it is more convenient to use Strings.
comment
- The interface's descriptive comment.accessModifier
- The interface's access control modifier.interfaceName
- The interface's Java type specification.superInterfaces
- The list of superinterfaces.implementedInterfaces
- The list of implemented interfaces.Method Detail |
public String getPackageName()
public String getName()
public List getSuperInterfaces()
public void addSuperInterface(String interfaceName)
interfaceName
- The interface name.public void addSuperInterface(JavaType interfaceType)
interfaceType
- The interface type.public void addSuperInterfaces(List interfaces)
interfaces
- The list of interface names or types to add.public boolean isInterfaceDefinition()
isInterfaceDefinition
in class JavaObjectDefinition
public String getObjectKeyword()
JavaObjectDefinition
getObjectKeyword
in class JavaObjectDefinition
public boolean isAbstract()
isAbstract
in class JavaObjectDefinition
public List getImports()
JavaObjectDefinition
getImports
in class JavaObjectDefinition
public void writeDefinitionTo(CodeBuffer buffer)
JavaDefinition
CodeBuffer
.
writeDefinitionTo
in class JavaDefinition
buffer
- The CodeBuffer with which to append the data.CodeBuffer
protected void setSuperInterfaces(List superInterfaces)
superInterfaces
- The list of superinterfaces.
|
Arch4J 1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |