Back to index

im-sdk  12.3.91
Public Member Functions | Package Functions | Private Member Functions | Private Attributes | Static Private Attributes
sun.awt.im.iiimp.ManageRule Class Reference
Collaboration diagram for sun.awt.im.iiimp.ManageRule:
Collaboration graph
[legend]

List of all members.

Public Member Functions

String toString ()
String toString ()

Package Functions

 ManageRule (String rule)
 ManageRule (InputStreamReader reader)
int size ()
boolean contains (Object o)
IIIMListener get (int i)
void setCCDEF (String ccdef)
 ManageRule (String rule)
 ManageRule (InputStreamReader reader)
int size ()
boolean contains (Object o)
IIIMListener get (int i)
void setCCDEF (String ccdef)

Private Member Functions

void parseRule (String ruleString)
void debug (String str)
void parseRule (String ruleString)
void debug (String str)

Private Attributes

String ruleString = null
Vector imVector
PCE pce
String ccdef

Static Private Attributes

static final String PROTOCOL_DRIVER_NAME = "sun.awt.im.iiimp.ProtocolDriver"
static final String DEFAULT_PCE_RULE = "sun/awt/im/iiimp/sample.lwesyntax"

Detailed Description

Definition at line 53 of file ManageRule.java.


Constructor & Destructor Documentation

sun.awt.im.iiimp.ManageRule.ManageRule ( String  rule) [inline, package]

Definition at line 63 of file ManageRule.java.

Here is the call graph for this function:

sun.awt.im.iiimp.ManageRule.ManageRule ( InputStreamReader  reader) [inline, package]

Definition at line 68 of file ManageRule.java.

                                         {
       StringBuffer sb = new StringBuffer();
       int ch;
       try {
           for (; (ch = reader.read()) != -1;) {
              sb.append((char)ch);
           }
       } catch(Exception e) {}
       ruleString = sb.toString();
       parseRule(ruleString);
    }

Here is the call graph for this function:

sun.awt.im.iiimp.ManageRule.ManageRule ( String  rule) [inline, package]

Definition at line 63 of file ManageRule.java.

Here is the call graph for this function:

sun.awt.im.iiimp.ManageRule.ManageRule ( InputStreamReader  reader) [inline, package]

Definition at line 68 of file ManageRule.java.

                                         {
       StringBuffer sb = new StringBuffer();
       int ch;
       try {
           for (; (ch = reader.read()) != -1;) {
              sb.append((char)ch);
           }
       } catch(Exception e) {}
       ruleString = sb.toString();
       parseRule(ruleString);
    }

Here is the call graph for this function:


Member Function Documentation

boolean sun.awt.im.iiimp.ManageRule.contains ( Object  o) [inline, package]

Definition at line 88 of file ManageRule.java.

                               {
       Class c1 = o.getClass();
       for (int i = 0; i < imVector.size(); i++) {
           Class c2 = imVector.get(i).getClass();
           if (c1 == c2) {
              return true;
           }
       }
       return false;
    }
boolean sun.awt.im.iiimp.ManageRule.contains ( Object  o) [inline, package]

Definition at line 88 of file ManageRule.java.

                               {
       Class c1 = o.getClass();
       for (int i = 0; i < imVector.size(); i++) {
           Class c2 = imVector.get(i).getClass();
           if (c1 == c2) {
              return true;
           }
       }
       return false;
    }
void sun.awt.im.iiimp.ManageRule.debug ( String  str) [inline, private]

Definition at line 175 of file ManageRule.java.

                                   {
       if (Manager.DEBUG) {
           System.err.println(str);
       }
    }

Here is the caller graph for this function:

void sun.awt.im.iiimp.ManageRule.debug ( String  str) [inline, private]

Definition at line 175 of file ManageRule.java.

                                   {
       if (Manager.DEBUG) {
           System.err.println(str);
       }
    }
IIIMListener sun.awt.im.iiimp.ManageRule.get ( int  i) [inline, package]

Definition at line 99 of file ManageRule.java.

                            {
       return (IIIMListener)imVector.get(i);
    }

Here is the caller graph for this function:

IIIMListener sun.awt.im.iiimp.ManageRule.get ( int  i) [inline, package]

Definition at line 99 of file ManageRule.java.

                            {
       return (IIIMListener)imVector.get(i);
    }
void sun.awt.im.iiimp.ManageRule.parseRule ( String  ruleString) [inline, private]

Definition at line 119 of file ManageRule.java.

                                              {
       imVector = new Vector();

       StringTokenizer st = new StringTokenizer(ruleString);
       imVector = new Vector();

       while(st.hasMoreTokens()) {
           String className = st.nextToken();
           Object obj;

           try {
              if (className.equals(PROTOCOL_DRIVER_NAME)) {
                  obj = ProtocolDriver.getInstance();
              } else {
                  obj = Class.forName(className).newInstance();
              }
           } catch(Exception e) {
              // ignore invalid entry in the rule
              continue;
           }
           if (obj == null) {
              continue;
           }
           if (obj instanceof IIIMListener) {
              if (obj instanceof PCE) {
                  // PCE setup
                  pce = (PCE)obj;
                  LWESyntax syntax = null;
                  if (ccdef == null) {
                     ClassLoader loader = ClassLoader.getSystemClassLoader();
                     InputStream is = loader.getResourceAsStream
                         (DEFAULT_PCE_RULE);
                     InputStreamReader reader = new InputStreamReader(is);
                     try {
                         syntax = new LWESyntax(reader);
                     } catch(InvalidSyntaxException e) {
                         debug(" err : " + e);
                         continue;
                     }
                  } else {
                     try {
                         syntax = new LWESyntax(ccdef);
                     } catch(InvalidSyntaxException e) {
                         debug(" err : " + e);
                         continue;
                     }
                  }
                  ((PCE)obj).pushSyntax(syntax);
              } else if (obj instanceof ProtocolDriver) {
                  Manager.setPD((ProtocolDriver)obj);
              }
              imVector.add(obj);
           }
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.ManageRule.parseRule ( String  ruleString) [inline, private]

Definition at line 119 of file ManageRule.java.

                                              {
       imVector = new Vector();

       StringTokenizer st = new StringTokenizer(ruleString);
       imVector = new Vector();

       while(st.hasMoreTokens()) {
           String className = st.nextToken();
           Object obj;

           try {
              if (className.equals(PROTOCOL_DRIVER_NAME)) {
                  obj = ProtocolDriver.getInstance();
              } else {
                  obj = Class.forName(className).newInstance();
              }
           } catch(Exception e) {
              // ignore invalid entry in the rule
              continue;
           }
           if (obj == null) {
              continue;
           }
           if (obj instanceof IIIMListener) {
              if (obj instanceof PCE) {
                  // PCE setup
                  pce = (PCE)obj;
                  LWESyntax syntax = null;
                  if (ccdef == null) {
                     ClassLoader loader = ClassLoader.getSystemClassLoader();
                     InputStream is = loader.getResourceAsStream
                         (DEFAULT_PCE_RULE);
                     InputStreamReader reader = new InputStreamReader(is);
                     try {
                         syntax = new LWESyntax(reader);
                     } catch(InvalidSyntaxException e) {
                         debug(" err : " + e);
                         continue;
                     }
                  } else {
                     try {
                         syntax = new LWESyntax(ccdef);
                     } catch(InvalidSyntaxException e) {
                         debug(" err : " + e);
                         continue;
                     }
                  }
                  ((PCE)obj).pushSyntax(syntax);
              } else if (obj instanceof ProtocolDriver) {
                  Manager.setPD((ProtocolDriver)obj);
              }
              imVector.add(obj);
           }
       }
    }

Here is the call graph for this function:

void sun.awt.im.iiimp.ManageRule.setCCDEF ( String  ccdef) [inline, package]

Definition at line 108 of file ManageRule.java.

                                {
       this.ccdef = ccdef;
       if (pce != null) {
           try {
              pce.pushSyntax(new LWESyntax(ccdef));
           } catch(InvalidSyntaxException e) {
              debug(" err = " + e);
           }
       }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void sun.awt.im.iiimp.ManageRule.setCCDEF ( String  ccdef) [inline, package]

Definition at line 108 of file ManageRule.java.

                                {
       this.ccdef = ccdef;
       if (pce != null) {
           try {
              pce.pushSyntax(new LWESyntax(ccdef));
           } catch(InvalidSyntaxException e) {
              debug(" err = " + e);
           }
       }
    }

Here is the call graph for this function:

int sun.awt.im.iiimp.ManageRule.size ( ) [inline, package]

Definition at line 84 of file ManageRule.java.

               {
       return imVector.size();
    }
int sun.awt.im.iiimp.ManageRule.size ( ) [inline, package]

Definition at line 84 of file ManageRule.java.

               {
       return imVector.size();
    }

Here is the caller graph for this function:

Definition at line 80 of file ManageRule.java.

                             {
       return ruleString;
    }

Definition at line 80 of file ManageRule.java.

                             {
       return ruleString;
    }

Member Data Documentation

Definition at line 106 of file ManageRule.java.

static final String sun.awt.im.iiimp.ManageRule.DEFAULT_PCE_RULE = "sun/awt/im/iiimp/sample.lwesyntax" [static, private]

Definition at line 58 of file ManageRule.java.

Definition at line 103 of file ManageRule.java.

Definition at line 105 of file ManageRule.java.

static final String sun.awt.im.iiimp.ManageRule.PROTOCOL_DRIVER_NAME = "sun.awt.im.iiimp.ProtocolDriver" [static, private]

Definition at line 55 of file ManageRule.java.

String sun.awt.im.iiimp.ManageRule.ruleString = null [private]

Definition at line 61 of file ManageRule.java.


The documentation for this class was generated from the following files: