public class PropertiesWithComments extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
PropertiesWithComments.CommentedProperty
A POJO which looks like a property.
|
| Modifier and Type | Field and Description |
|---|---|
private List<Object> |
contents
The contents.
|
private boolean |
loadedData
Have we loaded data?.
|
private Properties |
nameReplacement
Name Replacement info.
|
private Map<String,PropertiesWithComments.CommentedProperty> |
properties
The properties bit.
|
| Constructor and Description |
|---|
PropertiesWithComments() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComment(String what)
Append a comment to the list.
|
protected void |
addCommentedProperty(String line,
boolean isComment)
Add a property, either as a key/value pair or as a key/comment pair.
|
void |
load(InputStream input)
Read the input stream into our structures.
|
void |
loadNameReplacement(InputStream input)
Read the name replacement data.
|
boolean |
replaceProperty(String propName,
String newPropValue)
Replace the supplied property or stuff it at the bottom of the list.
|
void |
store(OutputStream output)
Put the output to the supplied stream.
|
private List<Object> contents
Object is either a string (a non-property line) or a PropertiesWithComments.CommentedProperty
(an optionally commented property definition).private Map<String,PropertiesWithComments.CommentedProperty> properties
private final Properties nameReplacement
private boolean loadedData
protected void addCommentedProperty(@Nonnull@NotEmpty String line, boolean isComment) throws IOException
line - what to look atisComment - whether this is a comment or not.IOException - when badness happens.public void loadNameReplacement(InputStream input) throws IOException
input - what to readIOException - if readline failspublic void load(InputStream input) throws IOException
input - what to readIOException - if readline failspublic void store(OutputStream output) throws IOException
output - where to writeIOException - is the write failspublic boolean replaceProperty(String propName, String newPropValue)
propName - the name of the property to replacenewPropValue - the value to replacepublic void addComment(String what)
what - what to addCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.