org.apache.ws.jaxme.js.pattern

Class InterfaceDescription

public class InterfaceDescription extends 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.
Method Summary
StringgetInterface()
Returns the name of the interface being implemented.
JavaSourcegetJavaSource()
Returns an instance of JavaSource, matching the interface getInterface.
StringgetType()
Returns, how to gather information about the interface.
booleanisMandatory()
Returns whether this interface is mandatory.
voidsetInterface(String pName)
Sets the name of the interface being implemented.
voidsetMandatory(boolean pMandatory)
Sets whether this interface is mandatory.
voidsetType(String pType)
Sets, how to gather information about the interface.

Method Detail

getInterface

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

getJavaSource

public JavaSource getJavaSource()
Returns an instance of JavaSource, matching the interface getInterface.

getType

public 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.

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.

setInterface

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

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.

setType

public void setType(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.