public ContextPropertiesFactory create(String context) { return new ContextPropertiesFactory(context); }
public ContextPropertiesFactory create(Object context) { return new ContextPropertiesFactory(context); }
public ContextPropertiesFactory create(Class<?> context) { return new ContextPropertiesFactory(context); }
@Override public Properties create() throws IOException { return new ContextPropertiesFactory(STTemplateWorker.class) .withProperties(getProperties()).fromResource(PROPERTIES_URL); }
/** * Creates the converter with default properties. * * @param appendable * the {@link Appendable} to append the converted string. * * @return the {@link MapToTableString}. */ public static MapToTableString withDefaults(Appendable appendable) { try { return new MapToTableString( new ContextPropertiesFactory(MapToTableString.class) .fromResource(PROPERTIES_RESOURCE).withReplacements( System.getProperties()), appendable); } catch (IOException e) { throw new RuntimeException(e); } }
private synchronized void loadProperties() { try { ContextPropertiesFactory p = new ContextPropertiesFactory(context) .withProperties(System.getProperties()); if (defaultProperties != null) { p.withDefaultProperties(defaultProperties); } properties = p.fromResource(resource); } catch (IOException e) { throw new ProvisionException(format(LOAD_MESSAGE, resource), e); } }