@SuppressWarnings({"PMD.OnlyOneReturn", "PMD.AvoidCatchingThrowable"}) private CronRunnable getRunnable(final String className, final CronParams params) { try { final Class<?> c = Class.forName(className); final Constructor<?> ctor = c.getConstructor(CronParams.class); return (CronRunnable) ctor.newInstance(params); } catch (Throwable e) { logger.warning(Value.join(Http.Token.SLASH, e.getClass().getSimpleName(), e.getMessage())); return null; } }
private static void setCustomSocketFactory(final String certificate, final Properties properties) throws IOException { if (!Value.isEmpty(certificate)) { try { final TLSContext tlsContext = new TLSContextFactory().create(certificate, "TLS"); // i18n JRE TLSSocketFactory.initialize(tlsContext.getContext()); properties.setProperty( "mail.smtp.ssl.socketFactory.class", TLSSocketFactory.class.getName()); properties.setProperty("mail.smtp.ssl.socketFactory.fallback", Boolean.FALSE.toString()); } catch (GeneralSecurityException e) { throw new IOException(e); } } }
public final int getMaxOccurs() { final boolean unbounded = XsdU.UNBOUNDED.equals(maxOccurs); return ((unbounded) ? Integer.MAX_VALUE : Value.defaultOnNull(maxOccurs, 1)); }
public final int getMinOccurs() { return Value.defaultOnNull(minOccurs, 1); }
private String getIDPrivate(final TypeInstance parentInstance) { return Value.join(XsdU.DOT, parentInstance.getID(), getName()); }
public final String getID() { return Value.join(XsdU.DOT, getName(), dataType.getQName().getLocalPart()); }