com.inet.html.css
Class ClassIDGenerator

java.lang.Object
  extended by com.inet.html.css.ClassIDGenerator

public class ClassIDGenerator
extends java.lang.Object

This class generates and supervises artificial class IDs. The generated class IDs will get their string value at the first time toString is called.


Nested Class Summary
 class ClassIDGenerator.ClassID
          This class represents an artificial class ID
 
Field Summary
static java.lang.String WEBENGINE_PREFIX
          the prefix of auto-generated classes of JWebEngine.
static java.util.regex.Pattern WEBENGINE_PREFIX_PATTERN
          The matcher to find JWebEngine auto generated Styles on load
 
Constructor Summary
ClassIDGenerator()
           
 
Method Summary
 void generateID(ClassIDGenerator.ClassID classID)
          Generates and sets an ID value on a given class ID object
 ClassIDGenerator.ClassID getClassID(boolean preset)
          Creates a class ID object
 void register(int id)
          Registers an numeric ID
 void register(java.lang.String id)
          Registers a new ID.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEBENGINE_PREFIX

public static final java.lang.String WEBENGINE_PREFIX
the prefix of auto-generated classes of JWebEngine. Required to identify generated classes on load

See Also:
Constant Field Values

WEBENGINE_PREFIX_PATTERN

public static final java.util.regex.Pattern WEBENGINE_PREFIX_PATTERN
The matcher to find JWebEngine auto generated Styles on load

Constructor Detail

ClassIDGenerator

public ClassIDGenerator()
Method Detail

register

public void register(java.lang.String id)
Registers a new ID. The ID will only be recognized if it matches the JWebEngine style pattern.

Parameters:
id - the id to register

register

public void register(int id)
Registers an numeric ID

Parameters:
id - the numeric id

generateID

public void generateID(ClassIDGenerator.ClassID classID)
Generates and sets an ID value on a given class ID object

Parameters:
classID - the class ID to modify

getClassID

public ClassIDGenerator.ClassID getClassID(boolean preset)
Creates a class ID object

Parameters:
preset - if true, it ID of the classID will be set and fixed, if false the ID will be generated at the first time toString is called on the ClassID
Returns:
the generated ClassIDGenerator.ClassID object