Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## rj.tools.jcsc.rules
Class RulesHandler

    java.lang.Object
      |
      +--rj.tools.jcsc.rules.RulesHandler

public class RulesHandler
extends java.lang.Object

`RulesHandler` is a helper class which is resoponsibel for saving the rules properties.

Version:
  $Revision: 1.6 $
Author:
  Ralph Jocham

Field Summary
`static java.lang.String` | `CHOICE` choice token
`static java.lang.String` | `CHOICES` choices token
`static java.lang.String` | `JCSC` jcsc token
`static java.lang.String` | `RULE` rule token
`static java.lang.String` | `RULES` rules token
`static java.lang.String` | `SEVERITY` priority token
`static java.lang.String` | `TYPE` type token
`static java.lang.String` | `VALUE` value token

Constructor Summary
`RulesHandler(java.io.PrintStream stream)` Creates qa new RulesHandler for a specific PrintStream to write to

Method Summary
`void` | `closeTag(java.lang.String tag)` Close a XML tag
`void` | `openTag(java.lang.String tag)` Print a XML open tag
`void` | `openTag(java.lang.String tag, java.lang.String[] attributes)` Print a XML open tag with attributes
`void` | `persistRules(java.util.Map map)` Persist the rules map into the print stream
`void` | `printIndent()` Print the indent for the xml file
`static java.util.Properties` | `readPropertiesRulesFile(java.lang.String fileName)` Reads a rules .jcsc properties file; only used for conversion from older JCSC versions
`static java.util.Map` | `readRulesFile(java.lang.String fileName)` Read a rules XML file from the file system
`static java.util.Map` | `readZipRulesFile(java.lang.String fileName)` Read a rules XML file from a zip/jar file (rj/tools/jcsc/rules is path)
`void` | `tag(java.lang.String tagName, java.lang.String value)` Print a XML tag with a value

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### JCSC

    public static final java.lang.String JCSC

  jcsc token

### RULES

    public static final java.lang.String RULES

  rules token

### RULE

    public static final java.lang.String RULE

  rule token

### TYPE

    public static final java.lang.String TYPE

  type token

### VALUE

    public static final java.lang.String VALUE

  value token

### SEVERITY

    public static final java.lang.String SEVERITY

  priority token

### CHOICES

    public static final java.lang.String CHOICES

  choices token

### CHOICE

    public static final java.lang.String CHOICE

  choice token

Constructor Detail

### RulesHandler

    public RulesHandler(java.io.PrintStream stream)

  Creates qa new RulesHandler for a specific PrintStream to write to
  Parameters:
    `stream` -

Method Detail

### persistRules

    public void persistRules(java.util.Map map)

  Persist the rules map into the print stream
  Parameters:
    `map` -

### printIndent

    public void printIndent()

  Print the indent for the xml file

### openTag

    public void openTag(java.lang.String tag)

  Print a XML open tag
  Parameters:
    `tag` -

### openTag

    public void openTag(java.lang.String tag,
                        java.lang.String[] attributes)

  Print a XML open tag with attributes
  Parameters:
    `tag` -
    `attributes` -

### tag

    public void tag(java.lang.String tagName,
                    java.lang.String value)

  Print a XML tag with a value
  Parameters:
    `tagName` -
    `value` -

### closeTag

    public void closeTag(java.lang.String tag)

  Close a XML tag
  Parameters:
    `tag` -

### readZipRulesFile

    public static java.util.Map readZipRulesFile(java.lang.String fileName)
                                          throws java.io.IOException

  Read a rules XML file from a zip/jar file (rj/tools/jcsc/rules is path)
  Parameters:
    `fileName` -
  Returns:
    rules map
  Throws:
    `java.io.IOException` -

### readRulesFile

    public static java.util.Map readRulesFile(java.lang.String fileName)
                                       throws java.io.IOException

  Read a rules XML file from the file system
  Parameters:
    `fileName` -
  Returns:
    rules map
  Throws:
    `java.io.IOException` -

### readPropertiesRulesFile

    public static java.util.Properties readPropertiesRulesFile(java.lang.String fileName)
                                                        throws java.io.IOException

  Reads a rules .jcsc properties file; only used for conversion from older JCSC versions
  Parameters:
    `fileName` -
  Returns:
    rules properties
  Throws:
    `java.io.IOException` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(c) 1999-2004 by Ralph Jocham (rjocham72@netscape.net)
JCSC is released under the terms of the GNU General Public License