public abstract class KNXAddress extends Object
An address consists of a 16 Bit unsigned value. Concrete implementations of address are
GroupAddress
and IndividualAddress
. Instances of
KNXAddress
are immutable.
Loading and saving KNX addresses in XML format is supported.
Modifier and Type | Method and Description |
---|---|
static KNXAddress |
create(String address)
Creates a KNX address from a string
address representation. |
static KNXAddress |
create(XMLReader r)
Creates a KNX address from xml input.
|
int |
getRawAddress()
Returns the KNX address in 16 Bit value representation.
|
abstract String |
getType()
Returns the KNX address type, identifying a group or individual address.
|
void |
save(XMLWriter w)
Writes the KNX address in XML format to the supplied writer.
|
byte[] |
toByteArray()
Returns the raw address value in a new byte array.
|
public static KNXAddress create(XMLReader r) throws KNXMLException
The KNX address element is expected to be the current or next element from the parser.
r
- a XML readerGroupAddress
or
IndividualAddress
KNXMLException
- if the XML element is no KNX address, on unknown address
type or wrong address syntaxpublic static KNXAddress create(String address) throws KNXFormatException
address
representation.
An address level separator of type '.' found in address
indicates an
individual address, i.e., an IndividualAddress
is created, otherwise a
GroupAddress
is created.
Allowed separators are '.' or '/', mutually exclusive.
address
- string containing the KNX addressGroupAddress
or
IndividualAddress
KNXFormatException
- thrown on unknown address type, wrong address syntax or
wrong separator usedpublic abstract String getType()
public final int getRawAddress()
public void save(XMLWriter w) throws KNXMLException
w
- a XML writerKNXMLException
- on output errorpublic final byte[] toByteArray()
Copyright © 2015. All rights reserved.