Japaki Customizing

Pattern Level

The easiest way to change the string representation of an object is to use another pattern. Most implementations of java.text.Format take a string argument to define their behaviour. Either

Steps

For a new default pattern the steps to be taken are
  1. Create a new parser mold with the new default pattern.
  2. Add parser mold with a name to parser store.
  3. Use new name.

Format Level

Sometimes a new format is needed, this is for example the case,

Steps

  1. Create a new base type, if necessary, for example net.sf.japaki.basic.Duration.
  2. Create a new format, for example net.sf.japaki.text.DurationFormat.
  3. Create a new parser mold, for example net.sf.japaki.kit.DurationParserMold.
  4. Add parser mold with a name to parser store, for example "duration".
  5. Use new name.

Parser Level

In rare cases a new parser is required.

Steps

  1. Create a new parser.
  2. Create a new parser bean, if necessary.
  3. Inherit from net.sf.japaki.SyntaxParser and add new parser or create new syntax parser.