Package me.folf.podns4j
Class PoDNS4J
java.lang.Object
me.folf.podns4j.PoDNS4J
Main API for the PoDNS4J library - Pronouns over DNS for Java.
This library implements the Pronouns over DNS specification, allowing
retrieval and parsing of personal pronouns from DNS TXT records.
Example usage:
PoDNS4J podns = new PoDNS4J();
PronounResult result = podns.lookup("example.com");
-
Constructor Summary
ConstructorsConstructorDescriptionPoDNS4J()Creates a new PoDNS4J instance.PoDNS4J(PronounDnsResolver resolver) Creates a new PoDNS4J instance with a custom resolver. -
Method Summary
Modifier and TypeMethodDescriptionLooks up pronouns for the given domain.static PronounRecordParses a pronoun record string.static PronounResultparseAndSelect(List<String> records) Parses pronoun record strings and selects the preferred one.
-
Constructor Details
-
PoDNS4J
public PoDNS4J()Creates a new PoDNS4J instance. -
PoDNS4J
Creates a new PoDNS4J instance with a custom resolver.- Parameters:
resolver- the resolver to use
-
-
Method Details
-
lookup
Looks up pronouns for the given domain.- Parameters:
domain- the domain to look up (e.g., "example.com")- Returns:
- the pronoun result, or null if no records were found
- Throws:
PronounParseException- if the records cannot be parsedNamingException- if the DNS query fails
-
parse
Parses a pronoun record string.- Parameters:
record- the record string to parse- Returns:
- the parsed pronoun record
- Throws:
PronounParseException- if the record is invalid
-
parseAndSelect
Parses pronoun record strings and selects the preferred one.- Parameters:
records- the record strings to parse- Returns:
- the pronoun result
- Throws:
PronounParseException- if any record is invalid
-