org.apache.ws.jaxme.js.pattern
Class InterfaceDescription

java.lang.Object
  extended by org.apache.ws.jaxme.js.pattern.InterfaceDescription

public class InterfaceDescription
extends java.lang.Object

The InterfaceDescription is used by the ProxyGenerator as information storage about the interfaces being implemented.
The main purporse of an intermediate class is to encapsulate the way, how information about these classes is gathered:

  1. If the interface being implemented is a compiled class, then Java reflection is used.
  2. Otherwise, if the interface being implemented is present as a Java source file, then the JavaParser is used.


Constructor Summary
InterfaceDescription()
           
 
Method Summary
 java.lang.String getInterface()
          Returns the name of the interface being implemented.
 JavaSource getJavaSource()
          Returns an instance of JavaSource, matching the interface getInterface().
 java.lang.String getType()
          Returns, how to gather information about the interface.
 boolean isMandatory()
          Returns whether this interface is mandatory.
 void setInterface(java.lang.String pName)
          Sets the name of the interface being implemented.
 void setMandatory(boolean pMandatory)
          Sets whether this interface is mandatory.
 void setType(java.lang.String pType)
          Sets, how to gather information about the interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InterfaceDescription

public InterfaceDescription()
Method Detail

setInterface

public void setInterface(java.lang.String pName)
Sets the name of the interface being implemented.


getInterface

public java.lang.String getInterface()
Returns the name of the interface being implemented.


setType

public void setType(java.lang.String pType)
Sets, how to gather information about the interface. Supported values are "Reflection" (Java reflection), or "Source" (JavaParser). The default is null, in which case "Reflection" and "Source" are tried, in that order.


getType

public java.lang.String getType()
Returns, how to gather information about the interface. Supported values are "Reflection" (Java reflection), or "Source" (JavaParser). The default is null, in which case "Reflection" and "Source" are tried, in that order.


setMandatory

public void setMandatory(boolean pMandatory)
Sets whether this interface is mandatory. By default interfaces are mandatory and the backing objects must implement this interface. If an interface isn't mandatory, then a Proxy instance can be created even for objects which don't implement the interface. However, in that case it may happen that a ClassCastException is thrown while invoking a method declared by the interface.


isMandatory

public boolean isMandatory()
Returns whether this interface is mandatory. By default interfaces are mandatory and the backing objects must implement this interface. If an interface isn't mandatory, then a Proxy instance can be created even for objects which don't implement the interface. However, in that case it may happen that a ClassCastException is thrown while invoking a method declared by the interface.


getJavaSource

public JavaSource getJavaSource()
                         throws java.lang.Exception
Returns an instance of JavaSource, matching the interface getInterface().

Throws:
java.lang.Exception