Package org.minidns.dnslabel
Class LdhLabel
- java.lang.Object
-
- org.minidns.util.SafeCharSequence
-
- org.minidns.dnslabel.DnsLabel
-
- org.minidns.dnslabel.LdhLabel
-
- All Implemented Interfaces:
java.lang.CharSequence
,java.lang.Comparable<DnsLabel>
- Direct Known Subclasses:
NonReservedLdhLabel
,ReservedLdhLabel
public abstract class LdhLabel extends DnsLabel
A LDH (Letters, Digits, Hyphen) label, which is the classical label form.Note that it is a common misconception that LDH labels can not start with a digit. The origin of this misconception is likely that RFC 1034 § 3.5 specified
They [i.e, DNS labels] must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen.
. However, this was relaxed in RFC 1123 § 2.1One aspect of host name syntax is hereby changed: the restriction on the first character is relaxed to allow either a letter or a digit.
and later summarized in RFC 3696 § 2:If the hyphen is used, it is not permitted to appear at either the beginning or end of a label.
Furthermore RFC 5890 § 2.3.1 only mentions the requirement that hyphen must not be the first or last character of a LDH label.- See Also:
- RFC 5890 § 2.3.1. LDH Label
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.minidns.dnslabel.DnsLabel
DnsLabel.LabelToLongException
-
-
Field Summary
-
Fields inherited from class org.minidns.dnslabel.DnsLabel
label, MAX_LABEL_LENGTH_IN_OCTETS, VALIDATE, WILDCARD_LABEL
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LdhLabel(java.lang.String label)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static LdhLabel
fromInternal(java.lang.String label)
static boolean
isLdhLabel(java.lang.String label)
-
Methods inherited from class org.minidns.dnslabel.DnsLabel
asLowercaseVariant, compareTo, consistsOnlyOfLettersDigitsAndHypen, consistsOnlyOfLettersDigitsHypenAndUnderscore, equals, from, from, getInternationalizedRepresentation, getInternationalizedRepresentationInternal, getLabelType, getRawLabel, hashCode, isIdnAcePrefixed, toSafeRepesentation, toString, writeToBoas
-
Methods inherited from class org.minidns.util.SafeCharSequence
charAt, length, subSequence, toSafeString
-
-
-
-
Constructor Detail
-
LdhLabel
protected LdhLabel(java.lang.String label)
-
-
Method Detail
-
isLdhLabel
public static boolean isLdhLabel(java.lang.String label)
-
fromInternal
protected static LdhLabel fromInternal(java.lang.String label)
-
-