Java 类org.springframework.util.PropertiesPersister 实例源码

项目:alfresco-utility    文件:SubsystemWithClassLoaderState.java   
public SubsystemWithClassLoaderState(final ApplicationContext parentContext, final Properties globalProperties,
        final PropertiesPersister propertiesPersister, final String category, final String type, final String id,
        final String instancePath)
{
    ParameterCheck.mandatory("parentContext", parentContext);
    ParameterCheck.mandatory("globalProperties", globalProperties);
    ParameterCheck.mandatory("propertiesPersister", propertiesPersister);

    ParameterCheck.mandatoryString("category", category);
    ParameterCheck.mandatoryString("type", type);
    ParameterCheck.mandatoryString("id", id);
    ParameterCheck.mandatoryString("instancePath", instancePath);

    this.parentContext = parentContext;
    this.globalProperties = globalProperties;
    this.propertiesPersister = propertiesPersister;

    this.category = category;
    this.type = type;
    this.id = id;
    this.instancePath = instancePath;

    this.loadFixedConfigProperties();
}
项目:cougar    文件:PropertyConfigurer.java   
protected PropertyConfigurer(StringEncryptor encryptor) {
    this.propertyPlaceholderConfigurer = encryptor != null ? new EncryptablePropertyPlaceholderConfigurer(encryptor) : new PropertyPlaceholderConfigurer();

    // Ensure that system properties override the spring-set properties.
    propertyPlaceholderConfigurer.setSystemPropertiesMode(PropertyPlaceholderConfigurer.SYSTEM_PROPERTIES_MODE_OVERRIDE);

    PropertiesPersister savingPropertiesPersister = new DefaultPropertiesPersister() {

           @Override
           public void load(Properties props, InputStream is) throws IOException {
               props.put(HOSTNAME_KEY, HOSTNAME);
               CougarNodeId.initialiseNodeId(props);
               super.load(props, is);
               for (String propName: props.stringPropertyNames()) {
                   allLoadedProperties.put(propName, System.getProperty(propName, props.getProperty(propName)));
               }
           }};
       propertyPlaceholderConfigurer.setPropertiesPersister(savingPropertiesPersister);
}
项目:spring4-understanding    文件:PropertiesLoaderUtils.java   
/**
 * Actually load properties from the given EncodedResource into the given Properties instance.
 * @param props the Properties instance to load into
 * @param resource the resource to load from
 * @param persister the PropertiesPersister to use
 * @throws IOException in case of I/O errors
 */
static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister)
        throws IOException {

    InputStream stream = null;
    Reader reader = null;
    try {
        String filename = resource.getResource().getFilename();
        if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
            stream = resource.getInputStream();
            persister.loadFromXml(props, stream);
        }
        else if (resource.requiresReader()) {
            reader = resource.getReader();
            persister.load(props, reader);
        }
        else {
            stream = resource.getInputStream();
            persister.load(props, stream);
        }
    }
    finally {
        if (stream != null) {
            stream.close();
        }
        if (reader != null) {
            reader.close();
        }
    }
}
项目:spring    文件:PropertiesLoaderUtils.java   
/**
 * Actually load properties from the given EncodedResource into the given Properties instance.
 * @param props the Properties instance to load into
 * @param resource the resource to load from
 * @param persister the PropertiesPersister to use
 * @throws IOException in case of I/O errors
 */
static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister)
        throws IOException {

    InputStream stream = null;
    Reader reader = null;
    try {
        String filename = resource.getResource().getFilename();
        if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
            stream = resource.getInputStream();
            persister.loadFromXml(props, stream);
        }
        else if (resource.requiresReader()) {
            reader = resource.getReader();
            persister.load(props, reader);
        }
        else {
            stream = resource.getInputStream();
            persister.load(props, stream);
        }
    }
    finally {
        if (stream != null) {
            stream.close();
        }
        if (reader != null) {
            reader.close();
        }
    }
}
项目:class-guard    文件:PropertiesLoaderUtils.java   
/**
 * Actually load properties from the given EncodedResource into the given Properties instance.
 * @param props the Properties instance to load into
 * @param resource the resource to load from
 * @param persister the PropertiesPersister to use
 * @throws IOException in case of I/O errors
 */
static void fillProperties(Properties props, EncodedResource resource, PropertiesPersister persister)
        throws IOException {

    InputStream stream = null;
    Reader reader = null;
    try {
        String filename = resource.getResource().getFilename();
        if (filename != null && filename.endsWith(XML_FILE_EXTENSION)) {
            stream = resource.getInputStream();
            persister.loadFromXml(props, stream);
        }
        else if (resource.requiresReader()) {
            reader = resource.getReader();
            persister.load(props, reader);
        }
        else {
            stream = resource.getInputStream();
            persister.load(props, stream);
        }
    }
    finally {
        if (stream != null) {
            stream.close();
        }
        if (reader != null) {
            reader.close();
        }
    }
}
项目:alfresco-repository    文件:ChildApplicationContextFactory.java   
/**
 * @return the persister
 */
public PropertiesPersister getPersister() 
{
    return persister;
}
项目:alfresco-repository    文件:ChildApplicationContextFactory.java   
/**
 * @param persister the persister to set
 */
public void setPersister(PropertiesPersister persister) 
{
    this.persister = persister;
}
项目:lams    文件:PropertiesBeanDefinitionReader.java   
/**
 * Return the PropertiesPersister to use for parsing properties files.
 */
public PropertiesPersister getPropertiesPersister() {
    return this.propertiesPersister;
}
项目:spring4-understanding    文件:PropertiesBeanDefinitionReader.java   
/**
 * Return the PropertiesPersister to use for parsing properties files.
 */
public PropertiesPersister getPropertiesPersister() {
    return this.propertiesPersister;
}
项目:spring    文件:PropertiesBeanDefinitionReader.java   
/**
 * Return the PropertiesPersister to use for parsing properties files.
 */
public PropertiesPersister getPropertiesPersister() {
    return this.propertiesPersister;
}
项目:alfresco-utility    文件:SubsystemWithClassLoaderFactory.java   
/**
 * @param persister
 *            the persister to set
 */
public void setPersister(final PropertiesPersister persister)
{
    ParameterCheck.mandatory("persister", persister);
    this.persister = persister;
}
项目:alfresco-utility    文件:SubsystemWithClassLoaderManager.java   
/**
 * @param persister
 *            the persister to set
 */
public void setPersister(final PropertiesPersister persister)
{
    ParameterCheck.mandatory("persister", persister);
    this.persister = persister;
}
项目:sakai    文件:SakaiProperties.java   
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:community-edition-old    文件:ChildApplicationContextFactory.java   
/**
 * @return the persister
 */
public PropertiesPersister getPersister() 
{
    return persister;
}
项目:community-edition-old    文件:ChildApplicationContextFactory.java   
/**
 * @param persister the persister to set
 */
public void setPersister(PropertiesPersister persister) 
{
    this.persister = persister;
}
项目:class-guard    文件:PropertiesBeanDefinitionReader.java   
/**
 * Return the PropertiesPersister to use for parsing properties files.
 */
public PropertiesPersister getPropertiesPersister() {
    return this.propertiesPersister;
}
项目:sakai    文件:SakaiProperties.java   
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:lams    文件:ReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:lams    文件:PropertiesBeanDefinitionReader.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:spring4-understanding    文件:ReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:spring4-understanding    文件:PropertiesLoaderSupport.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:spring4-understanding    文件:PropertiesBeanDefinitionReader.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:my-spring-cache-redis    文件:ReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:spring    文件:ReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:spring    文件:PropertiesBeanDefinitionReader.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:spring    文件:PropertiesLoaderSupport.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:starter-kit-spring-maven    文件:CustomReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>
 * The default is a DefaultPropertiesPersister.
 * 
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister = (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:class-guard    文件:ReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:class-guard    文件:PropertiesLoaderSupport.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:class-guard    文件:PropertiesBeanDefinitionReader.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * The default is DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:grails-icu    文件:ICUReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:clobaframe    文件:ReloadableResourceBundleMessageSource.java   
/**
 * Set the PropertiesPersister to use for parsing properties files.
 * <p>The default is a DefaultPropertiesPersister.
 * @see org.springframework.util.DefaultPropertiesPersister
 */
public void setPropertiesPersister(PropertiesPersister propertiesPersister) {
    this.propertiesPersister =
            (propertiesPersister != null ? propertiesPersister : new DefaultPropertiesPersister());
}
项目:fuwesta    文件:RecursivePropertiesPersister.java   
/**
 * Initiates an object of type RecursivePropertiesPersister.
 * 
 * @param propertiesPersister
 */
public RecursivePropertiesPersister(PropertiesPersister propertiesPersister) {
    super();
    this.propertiesPersister = propertiesPersister;
}