RADIUS Client API (V3)

com.theorem.radius3.dictionary.util
Class GenerateJava

Object
  extended byGenerateJava

public class GenerateJava
extends Object

Class to generate an AXL Radius Vendor dictionary .java file from a dictionary file. This generates a .java file similar to that found in the AXL RADIUS Ascend.java file.

The generated classes can be used to assist debugging by simply running the constructor like new Ascend(). This hooks the definitions into the VendorSpecific class which is better able to display new Vendor-Specific information.

Example:

public static void main(String a[])
{

        String dictFile = "U:\\etc\\raddb\\dictionary";
        try {
                FreeRadius fr = new FreeRadius(dictFile);
                fr.read();
                GenerateJava g = 
                        new GenerateJavaDictionary(fr, fr.getVendorId("Redback"));
                g.setPackageName("com.theorem.radius3");
                        System.out.println(g.generateJava());
                } catch (Exception e) {
                e.printStackTrace();
        }
}

Since:
3.34

Constructor Summary
GenerateJava(RADIUSDictionary dictionary, int vendorId)
          Constructor.
 
Method Summary
 String generateJava()
          Generate the .java file contents for the vendor.
static void main(String[] a)
          Create a Java file containing the dictionary values from a Livingston style dictionary.
 void setPackageName(String packageName)
          Set the packet name for the file.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenerateJava

public GenerateJava(RADIUSDictionary dictionary,
                    int vendorId)
Constructor. Generate the java code from the given dictionary information.

Parameters:
dictionary - Existing dictionary containing the necessary vendor information.
vendorId - Vendor Id.
Method Detail

setPackageName

public void setPackageName(String packageName)
Set the packet name for the file. If no package name is set the code will be generated for the anonymous package.

Parameters:
packageName - Package name.

generateJava

public String generateJava()
Generate the .java file contents for the vendor. The resulting file looks like the Ascend.java file but for whatever vendor you choose.

Returns:
File contents or null if the vendor doesn't exist.

main

public static void main(String[] a)
Create a Java file containing the dictionary values from a Livingston style dictionary. The output is written to stdout. The resulting source must be edited to set the package and proper imports.

The first command line argument is the source of the particular Livingston style vendor dictionary or a dictionary that includes the particular vendor dictionary. The second argument is the vendor's name as it appears in the dictionary.

For example GenerateJava ./dict/dictionary Lucent or GenerateJava ./dict/dictionary.lucent Lucent


RADIUS Client API (V3)

Submit a bug report or feature request

Copyright 1998-2008 AXL Software. PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.