How to write custom link-checker java code and exports the json
how to write a custom link-checker java code and exports the json weather its valid or not just like in HTML with broken link icon

-I want this validation/link checker functionality in custom java code format then i can export json and integrate with UI
-Exporter inform of JSON format as mentioned in below format ""isValidLink":true," any refrence please.
{
"cta":{
"InHref":"www.google.com",
"lnTarget":false,
"isValidLink":true,
}
}