Rajan Prasad
Rajan Prasad

Reputation: 1679

Where to look for to get the possible values of String constants used in Java class library

With reference to my earlier question Why does Java class library still use String constants in place of enum, can someone recommend an online information source to look for what all String constants are permitted for a Java Standard Class library method accepting a String constant? For example, what String values can MessageDigest.getInstance can take, other than "SHA" ? Similarly, what all properties can be fed into a Properties instance to create a valid SMTP/IMAP Session? Some of them are

properties.setProperty("mail.imap.auth", "true");
properties.setProperty("mail.imap.host", mailHost);
properties.setProperty("mail.imap.port", mailServerPort.toString());
properties.setProperty("mail.imap.starttls.enable","true");
properties.setProperty("mail.imap.starttls.enable","true");
properties.setProperty("mail.imap.ssl.enable","true");

Now create your Session as

Session.getInstance(properties, authenticator);

Upvotes: 1

Views: 208

Answers (1)

user207421
user207421

Reputation: 310979

There's no one place, especially as you have mentioned a JDK class and an extension class. You just have to look around the Javadoc.

For example, what String values can MessageDigest.getInstance can take, other than "SHA"

Appendix A of the JCE Specification.

Similarly, what all properties can be fed into a Properties instance to create a valid SMTP/IMAP Session?

Package documentation for the JavaMail SMTP and IMAP packages respectively.

Upvotes: 1

Related Questions