org.jibx.custom.classes
Class ClassItemSourceWrapper

java.lang.Object
  extended by org.jibx.binding.model.ClassItemWrapper
      extended by org.jibx.custom.classes.ClassItemSourceWrapper
All Implemented Interfaces:
IClassItem

public class ClassItemSourceWrapper
extends ClassItemWrapper

Wrapper for class field or method item with added source information. This wraps the basic class handling implementation with added support for retrieving information from source files.

Author:
Dennis M. Sosnoski

Field Summary
private  boolean m_checkedSource
           
private  Member m_itemSource
           
 
Constructor Summary
ClassItemSourceWrapper(IClass clas, ClassItem item)
          Constructor
 
Method Summary
private static java.lang.String docText(java.lang.String text)
          Return JavaDoc text only if non-empty.
 java.lang.String getExceptionJavaDoc(int index)
          Get method throws JavaDoc description, if available.
private  Member getItemSource()
          Internal method to get the source code information for this item.
 java.lang.String getJavaDoc()
          Get item JavaDoc description, if available.
 java.lang.String getParameterJavaDoc(int index)
          Get method parameter JavaDoc description, if available.
 java.lang.String getParameterName(int index)
          Get method parameter name, if available.
 java.lang.String getReturnJavaDoc()
          Get return JavaDoc description for method, if available.
private  boolean matchSignature(JavaMethod method)
          Check for source method signature match.
 
Methods inherited from class org.jibx.binding.model.ClassItemWrapper
getAccessFlags, getArgumentCount, getArgumentType, getClassItem, getContainingClass, getExceptions, getGenericsSignature, getName, getOwningClass, getSignature, getTypeName, isInitializer, isMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_checkedSource

private boolean m_checkedSource

m_itemSource

private Member m_itemSource
Constructor Detail

ClassItemSourceWrapper

ClassItemSourceWrapper(IClass clas,
                       ClassItem item)
Constructor

Parameters:
clas -
item -
Method Detail

matchSignature

private boolean matchSignature(JavaMethod method)
Check for source method signature match.

Parameters:
method -
Returns:
true if match to this method, false if not

getItemSource

private Member getItemSource()
Internal method to get the source code information for this item.

Returns:
source information

docText

private static java.lang.String docText(java.lang.String text)
Return JavaDoc text only if non-empty.

Parameters:
text - raw JavaDoc text
Returns:
trimmed text if non-empty, otherwise null

getJavaDoc

public java.lang.String getJavaDoc()
Description copied from interface: IClassItem
Get item JavaDoc description, if available.

Specified by:
getJavaDoc in interface IClassItem
Overrides:
getJavaDoc in class ClassItemWrapper
Returns:
non-empty JavaDoc text (null if not available)

getReturnJavaDoc

public java.lang.String getReturnJavaDoc()
Description copied from interface: IClassItem
Get return JavaDoc description for method, if available.

Specified by:
getReturnJavaDoc in interface IClassItem
Overrides:
getReturnJavaDoc in class ClassItemWrapper
Returns:
non-empty JavaDoc text (null if not available)

getParameterJavaDoc

public java.lang.String getParameterJavaDoc(int index)
Description copied from interface: IClassItem
Get method parameter JavaDoc description, if available. This method will throw a runtime exception if called on a field.

Specified by:
getParameterJavaDoc in interface IClassItem
Overrides:
getParameterJavaDoc in class ClassItemWrapper
Parameters:
index - parameter number
Returns:
non-empty JavaDoc text (null if not available)

getParameterName

public java.lang.String getParameterName(int index)
Description copied from interface: IClassItem
Get method parameter name, if available. This method will throw a runtime exception if called on a field.

Specified by:
getParameterName in interface IClassItem
Overrides:
getParameterName in class ClassItemWrapper
Parameters:
index - parameter number
Returns:
parameter name (null if not available)

getExceptionJavaDoc

public java.lang.String getExceptionJavaDoc(int index)
Description copied from interface: IClassItem
Get method throws JavaDoc description, if available. This method will throw a runtime exception if called on a field.

Specified by:
getExceptionJavaDoc in interface IClassItem
Overrides:
getExceptionJavaDoc in class ClassItemWrapper
Parameters:
index - exception index (into array returned by IClassItem.getExceptions()
Returns:
non-empty JavaDoc text (null if not available)


Project Web Site