JAnnotatedElement
public final class JInterface extends JStructure
Constructor | Description |
---|---|
JInterface(java.lang.String name) |
Creates a new JInterface with the given name.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addField(JField jField) |
Adds the given JField to this Jinterface.
|
void |
addImport(java.lang.String className) |
Adds the given import to this JStructure.
|
void |
addMember(JMember jMember) |
Adds the given JMember to this Jinterface.
|
void |
addMethod(JMethodSignature jMethodSig) |
Adds the given JMethodSignature to this Jinterface.
|
JField |
getField(java.lang.String name) |
Returns the field with the given name, or null if no field was found with
the given name.
|
JField[] |
getFields() |
Returns an array of all the JFields of this Jinterface.
|
JMethodSignature |
getMethod(int index) |
Returns the JMethodSignature at the given index.
|
JMethodSignature |
getMethod(java.lang.String name,
int startIndex) |
Returns the JMethodSignature with the given name and occuring at or
after the given starting index.
|
JMethodSignature[] |
getMethods() |
Returns an array of all the JMethodSignatures of this JInterface.
|
void |
print(JSourceWriter jsw) |
Deprecated.
Please use the Velocity-template based approach instead.
|
void |
print(JSourceWriter jsw,
boolean classOnly) |
Deprecated.
Please use the Velocity-template based approach instead.
|
addAnnotation, addImport, addImport, addImportInternal, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImportCount, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, print, printHeader, printImportDeclarations, printPackageDeclaration, removeAnnotation, removeImport, removeInterface, setHeader, toString
getLocalName, getName, isArray, isPrimitive, setName
public JInterface(java.lang.String name)
name
- The name of the JInterface.public void addImport(java.lang.String className)
addImport
in class JStructure
className
- Name of the class to import.public void addMember(JMember jMember)
This method is implemented by subclasses and should only accept the proper types for the subclass otherwise an IllegalArgumentException will be thrown.
addMember
in class JStructure
jMember
- The JMember to add to this JStructure.public JField[] getFields()
getFields
in class JStructure
public JField getField(java.lang.String name)
getField
in class JStructure
name
- The name of the field to return.public void addField(JField jField)
This method is implemented by subclasses and should only accept the proper fields for the subclass otherwise an IllegalArgumentException will be thrown. For example a JInterface will only accept static fields.
addField
in class JStructure
jField
- The JField to add.public JMethodSignature[] getMethods()
public JMethodSignature getMethod(java.lang.String name, int startIndex)
name
- The name of the JMethodSignature to return.startIndex
- The starting index to begin searching from.public JMethodSignature getMethod(int index)
index
- The index of the JMethodSignature to return.public void addMethod(JMethodSignature jMethodSig)
jMethodSig
- The JMethodSignature to add.public void print(JSourceWriter jsw)
print
in class JStructure
jsw
- The JSourceWriter to print to.SourceGenerator#setJClassPrinterType(String)
public void print(JSourceWriter jsw, boolean classOnly)
jsw
- The JSourceWriter to print to. Must not be null.classOnly
- If true, generates the class body without the class
header, package declaration, or imports.SourceGenerator#setJClassPrinterType(String)
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com