verinec.gui.configurator.nodeeditor
Class InputValidator

java.lang.Object
  extended by verinec.gui.configurator.nodeeditor.InputValidator

public class InputValidator
extends Object

This class contains the functionality needed to check the input of the EditorTextFields and to define the values for the EditorComboBox. In contrast to the ElementType class this has nothing to do with the XML structure but only with the values of the attributes or inputfields.

Some datatypes already exist in XML as primitives, the definition of those primitives has been taken from the W3C homepage W3C built-in-datatypes specification . The other data-types are defined according to the specification in "base_types.xsd".

Java doesn't support variable type unsigned long, only long. So if a string is parsed with Long.parseLong(), the maximum value accepted is
  9223372036854775807 and negative numbers will also be accepted. If the pattern "0|[1-9][0-9]{0,18}|1[0-7][0-9]{18}" is used to check the unsigned long, then it works from 0 up to
17999999999999999999 which is closer to the max value of an unsigned long of
18446744073709551615

Author:
damian vogel

Field Summary
static String AbsoluteHostName
          Data-type definition according to base_types.xsd
static String[] booleanOptional
          Choice list for EditorComboBox with a neutral Element to indicate no selection
static String[] booleanRequired
          Choice list for EditorComboBox where values are required
static String CommaMerge
          Regular Expression for EditorMultiTextField
static String CommaSepPattern
          Regular Expression for EditorMultiTextField
static String[] DynType
          Choice list for EditorComboBox where values are required
static String HostName
          Data-type definition according to base_types.xsd
static String integer
          XML built-in data-type
static String IPv4
          Data-type definition according to base_types.xsd
static String[] LogLevel
          Choice list for EditorComboBox with a neutral Element to indicate no selection
static String mac
          Data-type definition according to base_types.xsd
static String NMTOKEN
          XML built-in data-type.
static String NodeName
          Data-type definition according to base_types.xsd
static String NwDNSServer
          Regular Expression for EditorMultiTextField
static String[] NwType
          Choice list for EditorComboBox where values are required
static String[] OnOff
          Choice list for EditorComboBox with a neutral Element to indicate no selection
static String Phonenumber
          Data-type definition according to base_types.xsd
static String[] PlatformName
          Choice list for EditorComboBox with a neutral Element to indicate no selection
static String[] Protocol
          Choice list for EditorComboBox where values are required
static String string
          XML built-in data-type
static String[] System
          Choice list for EditorComboBox where values are required
static String unsignedLong
          XML built-in data-type
static String wepkey
          Data-type definition according to base_types.xsd
static String[] YesNo
          Choice list for EditorComboBox with a neutral Element to indicate no selection
 
Constructor Summary
InputValidator()
           
 
Method Summary
static String getToolTip(String message)
          Matches a pattern with a short explication.
static boolean go(String regex, String inputValue)
          Function that verifies a string with a regular expression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

string

public static final String string
XML built-in data-type

See Also:
Constant Field Values

unsignedLong

public static final String unsignedLong
XML built-in data-type

See Also:
Constant Field Values

integer

public static final String integer
XML built-in data-type

See Also:
Constant Field Values

NMTOKEN

public static final String NMTOKEN
XML built-in data-type. See also W3C Nmtoken specification und W3C CombiningChar specification.

See Also:
Constant Field Values

IPv4

public static final String IPv4
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

mac

public static final String mac
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

wepkey

public static final String wepkey
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

Phonenumber

public static final String Phonenumber
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

NodeName

public static final String NodeName
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

HostName

public static final String HostName
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

AbsoluteHostName

public static final String AbsoluteHostName
Data-type definition according to base_types.xsd

See Also:
Constant Field Values

CommaSepPattern

public static final String CommaSepPattern
Regular Expression for EditorMultiTextField

See Also:
Constant Field Values

CommaMerge

public static final String CommaMerge
Regular Expression for EditorMultiTextField

See Also:
Constant Field Values

NwDNSServer

public static final String NwDNSServer
Regular Expression for EditorMultiTextField

See Also:
Constant Field Values

System

public static final String[] System
Choice list for EditorComboBox where values are required


DynType

public static final String[] DynType
Choice list for EditorComboBox where values are required


NwType

public static final String[] NwType
Choice list for EditorComboBox where values are required


Protocol

public static final String[] Protocol
Choice list for EditorComboBox where values are required


booleanRequired

public static final String[] booleanRequired
Choice list for EditorComboBox where values are required


YesNo

public static final String[] YesNo
Choice list for EditorComboBox with a neutral Element to indicate no selection


OnOff

public static final String[] OnOff
Choice list for EditorComboBox with a neutral Element to indicate no selection


LogLevel

public static final String[] LogLevel
Choice list for EditorComboBox with a neutral Element to indicate no selection


PlatformName

public static final String[] PlatformName
Choice list for EditorComboBox with a neutral Element to indicate no selection


booleanOptional

public static final String[] booleanOptional
Choice list for EditorComboBox with a neutral Element to indicate no selection

Constructor Detail

InputValidator

public InputValidator()
Method Detail

go

public static boolean go(String regex,
                         String inputValue)
Function that verifies a string with a regular expression

Parameters:
regex - The regular expression (Pattern).
inputValue - The string to verify.
Returns:
Whether the regex matches the inputValue.

getToolTip

public static String getToolTip(String message)
Matches a pattern with a short explication.

Parameters:
message - Valid Arguments for this function are data-type definition from above, i.e. one of the following: string, unsignedLong, integer, NMTOKEN, IPv4, mac, wepkey, Phonenumber, NodeName, HostName, AbsoluteHostName, NwDNSServer.
Returns:
Small Text that explaines the input range comprehensively.

Copyright © 2005 Verinec, DIUF