xbn.jdlcode
Class SplitLinkCode

java.lang.Object
  |
  +--xbn.XBNObject
        |
        +--xbn.jdlcode.SplitLinkCode

public class SplitLinkCode
extends XBNObject

Example link: <A HREF="~JD~t~EJD~">~JD~t~EJD~</a>  -->  ../template/Template.html (see package description for details).

Source code:  SplitLinkCode.java

SplitLinkCode takes the code of a JavaDoc Link Code, and splits it into it's fundamental parts: Class name, function/constructor name, and parameters. It can then take these pieces and generate the actual link.


Fields inherited from class xbn.XBNObject
bFALSE_IN_PRODUCTION, bTRUE_IN_PRODUCTION, sCNSTR, sES, sLINE_SEP
 
Constructor Summary
SplitLinkCode(String s_linkCode)
          Create a SplitLinkCode.
 
Method Summary
 String getClassName()
          What is the class name in this link?
 String getCnstrFuncName()
          What is the function name in this link?
 int getParameterCount()
          How many parameters exist in this link?
 int getParamIsArrayCount()
          How many parameters are arrays?
 String getParamList(String s_divider)
           
 String getParamName(int i_dx)
          Get the parameter at the requested array index.
 boolean isParamArray(int i_dx)
          Is the parameter at the requested array index an array?
 
Methods inherited from class xbn.XBNObject
getXMsgPrefix, sop, sopl, sopl, throwAX, throwAXIfBadStr, throwAXIfNull, throwAXSpoof
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SplitLinkCode

public SplitLinkCode(String s_linkCode)

Create a SplitLinkCode.

The form of a JavaDoc Link Code is the following:

class_abbrev#function_constructor_abbrev(parameter1[],parameter2[],...)

Parameters:
s_linkCode - The string containing the JavaDoc Link Code. Must conform to the following rules:
  • May not be null or zero characters in length.
  • The first character must be a letter, digit or underscore.
  • The last character must be a letter, digit, underscore or close parethesis (")").
  • May not contain any spaces or other whitespace.
  • May contain zero or one set of parenthesis. If there are parenthesis, the close paren must be the last character.
  • The class and all parameter abbreviations must exist according to JDCArray.doesExist.
  • If there is no class abbreviation, there must be a function/contructor abbreviation. Vice-versa, if there is no function/constructor abbreviation, there must be a class abbreviation.
  • The function abbreviation is not required to exist in JDCArray. If it does exist, then it is assumed to be a constructor (and not function). If it does not exist, it is assumed to be a function (and not constructor).
  • If there is a function/constructor abbreviation, there must be a set of parenthesis following it.
  • If there is both a class abbreviation and function/constructor abbreviation, they must be divided by a single number sign ("#"). A number sign is illegal in all other places. Note that a number sign is illegal when s_linkCode is started with a function/constructor abbreviation. So #x() is illegal, but x#y() is not.
  • There may be zero or more parameters within the parenthesis. Each parameter abbreviation...
    • ...Must exist according to JDCArray.doesExist.
    • ...May be followed by "[]", indicating that it is an array of that object.
    • If more than one parameter exists, each must be separated by a single comma.
  • All abbreviations (class, function/constructor, and parameters) must contain only letters, digits and underscores. In other words, aside from special characters: (), (, #, [, ]), the only legal characetrs are letters, digits and underscores.
  • Note: This constructor does not check if abbreviations do or do not exist according to JDCArray.doesExist. This is checked when getRelUrl is called. All other rules are enforced by the constructor.
  • Legal examples (assuming all abbreviations do exist):
    • functionName(t,s,s)
    • Class
    • functionName(s,optr)
    • Class#functionName(s,optr)
    • Class#functionName()      (Legal in SplitLinkCode, but not ReportBadJDLinkCodes. More information)
    • Class()
    • Class(s)
    • Class(s[])
    • Class(1,2,3,4,5)
    • Class#functionName(1,2,3,4,5)
    • Class#functionName(1[],2,3,4,5)
    • Class#functionName(1,2[],3,4,5)
    • Class#functionName(1,2,3[],4,5)
    • Class#functionName(1,2,3,4[],5)
    • Class#functionName(1,2,3,4,5[])
    • Class#functionName(1[],2[],3,4,5)
    • Class#functionName(1[],2,3[],4,5)
    • Class#functionName(1[],2,3,4[],5)
    • Class#functionName(1,2[],3[],4[],5[])
    • Class#functionName(1[],2,3[],4[],5[])
    • Class#functionName(1[],2[],3,4[],5[])
    • Class#functionName(1[],2[],3[],4,5[])
    • Class#functionName(1[],2[],3[],4[],5)
    • Class#functionName(1,2,3[],4[],5[])
    • Class#functionName(1[],2[],3[],4[],5[])
    • Class#functionName(x,e,e,o,e)
    • functionName(12)
    • setString(t,s,s)
  • Illegal examples:
    • null
    • empty string
    • []
    • ##
    • )(
    • ))
    • ((
    • ()
    • () ()
    • ,()
    • ()#
    • (#)
    • (,)
    • (,,,,)
    • #(,,,,)
    • (,,1,,)
    • #(,,1,,)
    • (1,2,,4,5)
    • #(1,2,,4,5)
    • #functionName(1,2,3,4,5)
    • Class#(1,2,3,4,5)
    • (12)
    • (1,2,3,4,5)
    • Class[](s)
    • Class(s)[]
    • Class([])
    • Class([]s)

 

Method Detail

getClassName

public String getClassName()

What is the class name in this link?

Returns:
The class name if one exists, or
null if none exists.

getCnstrFuncName

public String getCnstrFuncName()

What is the function name in this link?

Returns:
The function name if one exists, or
null if none exists.

getParameterCount

public int getParameterCount()

How many parameters exist in this link?

Returns:
0 or higher, representing the number of parameters..

getParamIsArrayCount

public int getParamIsArrayCount()

How many parameters are arrays?

Returns:
0..[getParameterCount], representing the number of parameters that have "[]" following it.

getParamName

public String getParamName(int i_dx)

Get the parameter at the requested array index.

Parameters:
i_dx - The array index of the parameter. Must range zero..[getParameterCount - 1], inclusive.
Throws:
AssertException - If getParameterCount equals zero.

isParamArray

public boolean isParamArray(int i_dx)

Is the parameter at the requested array index an array?

Parameters:
i_dx - The array index of the parameter. Must range zero..[getParameterCount - 1], inclusive.
Throws:
AssertException - If getParameterCount equals zero.

getParamList

public final String getParamList(String s_divider)



Copyright 1997-2003, Jeff Epstein, All Rights Reserved. See top of source code files for copyright notice.

 

http://sourceforge.net/projects/xbnjava

 

SourceForge.net Logo