verinec.gui.configurator.nodeeditor
Class ElementType

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

public class ElementType
extends Object

Provides some static functions and fields to facilitate node distinction and XML handling in NodeEditor respectively EditFieldsPanel and its descendants.

In a first part the strings corresponding to the names of XML elements and attributes are defined as constants (final static). In a second part, there are functions to check whether a given element or string is of a certain kind.

The motivation to group this together in a separate class as constants is that if once in the future the name of an element or an attribute is changed (which actually shouldn't but nevertheless is perfectly possible) then the only place you have to modify the code is in this file. All other classes doing XML treatment rely on this class.

Author:
Damian Vogel

Field Summary
static String AbortBusy
          values of XML elements. defined according to node.xsd
static String AbortNoDialtone
          values of XML elements. defined according to node.xsd
static String Address
          values of XML elements. defined according to node.xsd
static String AutoReconnect
          values of XML elements. defined according to node.xsd
static String Baud
          values of XML elements. defined according to node.xsd
static String CarrierCheck
          values of XML elements. defined according to node.xsd
static String DefaultReply
          values of XML elements. defined according to node.xsd
static String DeviceNr
          values of XML elements. defined according to node.xsd
static String DialAttempts
          values of XML elements. defined according to node.xsd
static String DialCommand
          values of XML elements. defined according to node.xsd
static String DialPrefix
          values of XML elements. defined according to node.xsd
static String Dyn
          values of XML elements. defined according to node.xsd
static String Ethernet
          values of XML elements. defined according to node.xsd
static String EthernetBinding
          values of XML elements. defined according to node.xsd
static String Gateway
          values of XML elements. defined according to node.xsd
static String Hardware
          values of XML elements. defined according to node.xsd
static String Hostname
          values of XML elements. defined according to node.xsd
static String HWAddress
          values of XML elements. defined according to node.xsd
static String ID
          values of XML elements. defined according to node.xsd
static String Identifier
          values of XML elements. defined according to node.xsd
static String IdleSeconds
          values of XML elements. defined according to node.xsd
static String Init1
          values of XML elements. defined according to node.xsd
static String Init2
          values of XML elements. defined according to node.xsd
static String Init3
          values of XML elements. defined according to node.xsd
static String Init4
          values of XML elements. defined according to node.xsd
static String Init5
          values of XML elements. defined according to node.xsd
static String Init6
          values of XML elements. defined according to node.xsd
static String Init7
          values of XML elements. defined according to node.xsd
static String Init8
          values of XML elements. defined according to node.xsd
static String Init9
          values of XML elements. defined according to node.xsd
static String IP
          values of XML elements. defined according to node.xsd
static String Login
          values of XML elements. defined according to node.xsd
static String LoginPrompt
          values of XML elements. defined according to node.xsd
static String Name
          values of XML elements. defined according to node.xsd
static String Node
          values of XML elements. defined according to node.xsd
static String NW
          values of XML elements. defined according to node.xsd
static String NwDNSServer
          values of XML elements. defined according to node.xsd
static String OnBoot
          values of XML elements. defined according to node.xsd
static String Password
          values of XML elements. defined according to node.xsd
static String PasswordAsk
          values of XML elements. defined according to node.xsd
static String PasswordPrompt
          values of XML elements. defined according to node.xsd
static String PeerDNS
          values of XML elements. defined according to node.xsd
static String Phone
          values of XML elements. defined according to node.xsd
static String PhysicalNetwork
          values of XML elements. defined according to node.xsd
static String Protocol
          values of XML elements. defined according to node.xsd
static String RemoteName
          values of XML elements. defined according to node.xsd
static String Retry
          values of XML elements. defined according to node.xsd
static String Serial
          values of XML elements. defined according to node.xsd
static String SerialBinding
          values of XML elements. defined according to node.xsd
static String Session
          values of XML elements. defined according to node.xsd
static String Subnet
          values of XML elements. defined according to node.xsd
static String TimeOut
          values of XML elements. defined according to node.xsd
static String Type
          values of XML elements. defined according to node.xsd
static String WEPKey
          values of XML elements. defined according to node.xsd
static String Wlan
          values of XML elements. defined according to node.xsd
static String WlanBinding
          values of XML elements. defined according to node.xsd
 
Constructor Summary
ElementType()
           
 
Method Summary
static String getElementName(Element element)
          Function used by EditorPanel to find a nice Name for a given XML element Takes the String from the Name of the element and calls the getElementName(String).
static String getElementName(String elementName)
          Get a nice description for the element named elementName.
static boolean isEthernet(Element element)
          Trivial method to check if element is ethernet element.
static boolean isEthernet(String elementName)
          Trivial method to check if string is XML tag name for ethernet.
static boolean isEthernetBinding(Element element)
          Trivial method to check if element is ethernet binding element.
static boolean isEthernetBinding(String elementName)
          Trivial method to check if string is XML tag name for ethernet binding.
static boolean isNetwork(Element element)
          Trivial method to check if element is network element.
static boolean isNetwork(String elementName)
          Trivial method to check if string is XML tag name for network.
static boolean isNode(Element element)
          Trivial method to check if element is node element.
static boolean isNode(String elementName)
          Trivial method to check if string is XML tag name for node.
static boolean isSerial(Element element)
          Trivial method to check if element is serial element.
static boolean isSerial(String elementName)
          Trivial method to check if string is XML tag name for serial.
static boolean isSerialBinding(Element element)
          Trivial method to check if element is serial binding element.
static boolean isSerialBinding(String elementName)
          Trivial method to check if string is XML tag name for serial binding.
static boolean isWlan(Element element)
          Trivial method to check if element is wlan element.
static boolean isWlan(String elementName)
          Trivial method to check if string is XML tag name for wlan.
static boolean isWlanBinding(Element element)
          Trivial method to check if element is wlan binding element.
static boolean isWlanBinding(String elementName)
          Trivial method to check if string is XML tag name for wlan binding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Node

public static final String Node
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

PhysicalNetwork

public static final String PhysicalNetwork
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Ethernet

public static final String Ethernet
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

EthernetBinding

public static final String EthernetBinding
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Wlan

public static final String Wlan
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

WlanBinding

public static final String WlanBinding
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Serial

public static final String Serial
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

SerialBinding

public static final String SerialBinding
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Name

public static final String Name
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Hostname

public static final String Hostname
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Hardware

public static final String Hardware
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

NW

public static final String NW
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Address

public static final String Address
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

HWAddress

public static final String HWAddress
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Subnet

public static final String Subnet
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Gateway

public static final String Gateway
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

OnBoot

public static final String OnBoot
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

PeerDNS

public static final String PeerDNS
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Type

public static final String Type
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

ID

public static final String ID
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

IP

public static final String IP
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Dyn

public static final String Dyn
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Retry

public static final String Retry
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

TimeOut

public static final String TimeOut
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

NwDNSServer

public static final String NwDNSServer
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

DeviceNr

public static final String DeviceNr
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Identifier

public static final String Identifier
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Baud

public static final String Baud
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

WEPKey

public static final String WEPKey
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Session

public static final String Session
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init1

public static final String Init1
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init2

public static final String Init2
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init3

public static final String Init3
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init4

public static final String Init4
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init5

public static final String Init5
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init6

public static final String Init6
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init7

public static final String Init7
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init8

public static final String Init8
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Init9

public static final String Init9
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Phone

public static final String Phone
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

DialPrefix

public static final String DialPrefix
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

DialCommand

public static final String DialCommand
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Login

public static final String Login
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

LoginPrompt

public static final String LoginPrompt
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Password

public static final String Password
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

PasswordAsk

public static final String PasswordAsk
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

PasswordPrompt

public static final String PasswordPrompt
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

AbortBusy

public static final String AbortBusy
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

AbortNoDialtone

public static final String AbortNoDialtone
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

AutoReconnect

public static final String AutoReconnect
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

CarrierCheck

public static final String CarrierCheck
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

DefaultReply

public static final String DefaultReply
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

DialAttempts

public static final String DialAttempts
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

IdleSeconds

public static final String IdleSeconds
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

Protocol

public static final String Protocol
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values

RemoteName

public static final String RemoteName
values of XML elements. defined according to node.xsd

See Also:
Constant Field Values
Constructor Detail

ElementType

public ElementType()
Method Detail

getElementName

public static String getElementName(Element element)
Function used by EditorPanel to find a nice Name for a given XML element Takes the String from the Name of the element and calls the getElementName(String).

Parameters:
element - The element to look for its name.
Returns:
A description for the element or empty string if no known element.

getElementName

public static String getElementName(String elementName)
Get a nice description for the element named elementName.

Parameters:
elementName - The name to look for.
Returns:
A description for the element or empty string if no known element.

isNode

public static boolean isNode(String elementName)
Trivial method to check if string is XML tag name for node.

Parameters:
elementName - The name to check.
Returns:
True if it is a node, false otherwise.

isNode

public static boolean isNode(Element element)
Trivial method to check if element is node element.

Parameters:
element - The XML element to test.
Returns:
True if it is a node, false otherwise.

isNetwork

public static boolean isNetwork(String elementName)
Trivial method to check if string is XML tag name for network.

Parameters:
elementName - The name to check.
Returns:
True if it is a network, false otherwise.

isNetwork

public static boolean isNetwork(Element element)
Trivial method to check if element is network element.

Parameters:
element - The XML element to test.
Returns:
True if it is a network, false otherwise.

isEthernet

public static boolean isEthernet(String elementName)
Trivial method to check if string is XML tag name for ethernet.

Parameters:
elementName - The name to check.
Returns:
True if it is a ethernet, false otherwise.

isEthernet

public static boolean isEthernet(Element element)
Trivial method to check if element is ethernet element.

Parameters:
element - The XML element to test.
Returns:
True if it is a ethernet, false otherwise.

isEthernetBinding

public static boolean isEthernetBinding(String elementName)
Trivial method to check if string is XML tag name for ethernet binding.

Parameters:
elementName - The name to check.
Returns:
True if it is a ethernet binding, false otherwise.

isEthernetBinding

public static boolean isEthernetBinding(Element element)
Trivial method to check if element is ethernet binding element.

Parameters:
element - The XML element to test.
Returns:
True if it is a ethernet element, false otherwise.

isWlan

public static boolean isWlan(String elementName)
Trivial method to check if string is XML tag name for wlan.

Parameters:
elementName - The name to check.
Returns:
True if it is a wlan, false otherwise.

isWlan

public static boolean isWlan(Element element)
Trivial method to check if element is wlan element.

Parameters:
element - The XML element to test.
Returns:
True if it is a wlan, false otherwise.

isWlanBinding

public static boolean isWlanBinding(String elementName)
Trivial method to check if string is XML tag name for wlan binding.

Parameters:
elementName - The name to check.
Returns:
True if it is a wlan binding, false otherwise.

isWlanBinding

public static boolean isWlanBinding(Element element)
Trivial method to check if element is wlan binding element.

Parameters:
element - The XML element to test.
Returns:
True if it is a wlan binding, false otherwise.

isSerial

public static boolean isSerial(String elementName)
Trivial method to check if string is XML tag name for serial.

Parameters:
elementName - The name to check.
Returns:
True if it is a serial, false otherwise.

isSerial

public static boolean isSerial(Element element)
Trivial method to check if element is serial element.

Parameters:
element - The XML element to test.
Returns:
True if it is a serial, false otherwise.

isSerialBinding

public static boolean isSerialBinding(String elementName)
Trivial method to check if string is XML tag name for serial binding.

Parameters:
elementName - The name to check.
Returns:
True if it is a serial binding, false otherwise.

isSerialBinding

public static boolean isSerialBinding(Element element)
Trivial method to check if element is serial binding element.

Parameters:
element - The XML element to test.
Returns:
True if it is a serial binding, false otherwise.

Copyright © 2005 Verinec, DIUF