Public Member Functions

org.exolab.javasource.JInterface Class Reference

Inheritance diagram for org.exolab.javasource.JInterface:
org.exolab.javasource.JStructure org.exolab.javasource.JType org.exolab.javasource.JAnnotatedElement

List of all members.

Public Member Functions

 JInterface (String name) throws IllegalArgumentException
void addField (JField jField) throws IllegalArgumentException
void addMember (JMember jMember) throws IllegalArgumentException
void addMethod (JMethodSignature jMethodSig) throws IllegalArgumentException
JField getField (String name)
JField[] getFields ()
JMethodSignature[] getMethods ()
JMethodSignature getMethod (String name, int startIndex)
JMethodSignature getMethod (int index)
void print (JSourceWriter jsw)
void print (JSourceWriter jsw, boolean classOnly)

Detailed Description

A representation of the Java Source code for a Java Interface. This is a useful utility when creating in memory source code. The code in this package was modelled after the Java Reflection API as much as possible to reduce the learning curve.

Author:
Martin Skopp
Keith Visco
Version:
Revision:
1.3
Date:
2004/12/03 18:44:47

Constructor & Destructor Documentation

org.exolab.javasource.JInterface.JInterface ( String  name  )  throws IllegalArgumentException

Creates a new JInterface with the given name.

Parameters:
name the name of the JInterface.
Exceptions:
IllegalArgumentException when the given name is not a valid Class name.

References org.exolab.javasource.JDocComment.appendComment(), org.exolab.javasource.JStructure.getJDocComment(), and org.exolab.javasource.JType.getLocalName().


Member Function Documentation

void org.exolab.javasource.JInterface.addField ( JField  jField  )  throws IllegalArgumentException [virtual]

Adds the given JField to this JStructure.

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.

Parameters:
jField,the JField to add
Exceptions:
IllegalArgumentException when the given JField has a name of an existing JField

Implements org.exolab.javasource.JStructure.

References org.exolab.javasource.JStructure.addImport(), org.exolab.javasource.JNamedMap.get(), org.exolab.javasource.JType.getComponentType(), org.exolab.javasource.JType.isArray(), org.exolab.javasource.JType.isPrimitive(), org.exolab.javasource.JModifiers.isPrivate(), and org.exolab.javasource.JNamedMap.put().

Referenced by org.exolab.javasource.JInterface.addMember().

void org.exolab.javasource.JInterface.addMember ( JMember  jMember  )  throws IllegalArgumentException [virtual]

Adds the given JMember to this JStructure.

This method is implemented by subclasses and should only accept the proper types for the subclass otherwise an IllegalArgumentException will be thrown.

Parameters:
jMember the JMember to add to this JStructure.
Exceptions:
IllegalArgumentException when the given JMember has the same name of an existing JField or JMethod respectively.

Implements org.exolab.javasource.JStructure.

References org.exolab.javasource.JInterface.addField().

JField org.exolab.javasource.JInterface.getField ( String  name  )  [virtual]

Returns the field with the given name, or null if no field was found with the given name.

Parameters:
name the name of the field to return.
Returns:
the field with the given name, or null if no field was found with the given name.

Implements org.exolab.javasource.JStructure.

References org.exolab.javasource.JNamedMap.get().

JField [] org.exolab.javasource.JInterface.getFields (  )  [virtual]

Returns an array of all the JFields of this JStructure

Returns:
an array of all the JFields of this JStructure

Implements org.exolab.javasource.JStructure.

References org.exolab.javasource.JNamedMap.get(), and org.exolab.javasource.JNamedMap.size().

JMethodSignature org.exolab.javasource.JInterface.getMethod ( int  index  ) 

Returns the JMethodSignature at the given index.

Parameters:
index the index of the JMethodSignature to return.
Returns:
the JMethodSignature at the given index.
JMethodSignature org.exolab.javasource.JInterface.getMethod ( String  name,
int  startIndex 
)

Returns the JMethodSignature with the given name, and occuring at or after the given starting index.

Parameters:
name the name of the JMethodSignature to return.
startIndex the starting index to begin searching from.
Returns:
the JMethodSignature, or null if not found.

References org.exolab.javasource.JMethodSignature.getName().

JMethodSignature [] org.exolab.javasource.JInterface.getMethods (  ) 

Returns an array of all the JMethodSignatures of this JInterface.

Returns:
an array of all the JMethodSignatures of this JInterface.
void org.exolab.javasource.JInterface.print ( JSourceWriter  jsw,
boolean  classOnly 
)
void org.exolab.javasource.JInterface.print ( JSourceWriter  jsw  )  [virtual]

Prints the source code for this JInterface to the given JSourceWriter

Parameters:
jsw the JSourceWriter to print to. [May not be null]

Implements org.exolab.javasource.JStructure.

References org.exolab.javasource.JStructure.print().

Referenced by org.exolab.javasource.JCompUnit.printStructures().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties