public final class JInterface extends JStructure
| Constructor and Description |
|---|
JInterface(java.lang.String name)
Creates a new JInterface with the given name..
|
| Modifier and Type | Method and Description |
|---|---|
void |
addField(JField jField)
Adds the given JField to this Jinterface.
|
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)
Prints the source code for this JInterface to the given JSourceWriter.
|
void |
print(JSourceWriter jsw,
boolean classOnly)
Prints the source code for this JInterface to the given JSourceWriter.
|
addAnnotation, addImport, addImport, addImport, addInterface, addInterface, getAnnotatedElementHelper, getAnnotation, getAnnotations, getFilename, getHeader, getImports, getInterfaceCount, getInterfaces, getJDocComment, getModifiers, getName, getPackageFromClassName, getPackageName, hasAnnotations, hasImport, isAnnotationPresent, isValidClassName, print, print, printHeader, printImportDeclarations, printlnWithPrefix, printPackageDeclaration, removeAnnotation, removeImport, setHeader, setPackageNamechangePackage, getLocalName, getName, getWrapperName, isArray, isPrimitive, toStringpublic JInterface(java.lang.String name)
name - the name of the JInterface.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 JStructurejField - the JField to addpublic 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 JStructurejMember - the JMember to add to this JStructure.public void addMethod(JMethodSignature jMethodSig)
jMethodSig - the JMethodSignature to add.public JField getField(java.lang.String name)
getField in class JStructurename - the name of the field to return.public JField[] getFields()
getFields in class JStructurepublic JMethodSignature[] getMethods()
public JMethodSignature getMethod(java.lang.String name, int startIndex)
name - the name of the JMethodSignature to returnstartIndex - the starting index to begin searching frompublic JMethodSignature getMethod(int index)
index - the index of the JMethodSignature to returnpublic void print(JSourceWriter jsw)
print in class JStructurejsw - the JSourceWriter to print to. Must not be null.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.Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com