📄 propertiespersister.java
字号:
/*
* Copyright 2002-2004 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.util;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.util.Properties;
/**
* Strategy interface for persisting java.util.Properties,
* allowing for pluggable parsing strategies.
*
* <p>The default implementation is DefaultPropertiesPersister,
* providing java.util.Properties' native parsing, but allowing
* for reading from any Reader and writing to any Writer,
* for example to specify a charset for a properties file.
*
* @author Juergen Hoeller
* @since 10.03.2004
* @see DefaultPropertiesPersister
* @see java.util.Properties
*/
public interface PropertiesPersister {
/**
* Load properties from the given InputStream into the given
* Properties object.
* @param props the Properties object to load into
* @param is the InputStream to load from
* @throws IOException in case of I/O errors
* @see java.util.Properties#load
*/
void load(Properties props, InputStream is) throws IOException;
/**
* Load properties from the given Reader into the given
* Properties object.
* @param props the Properties object to load into
* @param reader the Reader to load from
* @throws IOException in case of I/O errors
*/
void load(Properties props, Reader reader) throws IOException;
/**
* Write the contents of the given Properties object to the
* given OutputStream.
* @param props the Properties object to store
* @param os the OutputStream to write to
* @param header the description of the property list
* @throws IOException in case of I/O errors
* @see java.util.Properties#store
*/
void store(Properties props, OutputStream os, String header) throws IOException;
/**
* Write the contents of the given Properties object to the
* given Writer.
* @param props the Properties object to store
* @param writer the Writer to write to
* @param header the description of the property list
* @throws IOException in case of I/O errors
*/
void store(Properties props, Writer writer, String header) throws IOException;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -