public class InputAdapter extends Object
Adapter for reading properties files.
| Modifier and Type | Field and Description |
|---|---|
Charset |
currentCharset |
File |
currentFile |
Properties |
props |
| Constructor and Description |
|---|
InputAdapter() |
InputAdapter(boolean concurrent) |
InputAdapter(Properties props) |
| Modifier and Type | Method and Description |
|---|---|
Charset |
getCurrentCharset() |
File |
getCurrentFile() |
void |
read(Reader reader)
Read in a standard (i.e., legacy) properties formatted input stream assumed to possibly contain
unicode escapes.
|
void |
readFile(File path,
Charset charset)
Read in a file in .properties format.
|
void |
readJSON(Reader in)
Read in from a JSON-encoded stream.
|
void |
readLegacyProperties(Properties legacy)
Read in from legacy java.util.Properties
|
void |
readMap(Map<String,?> map)
Load from a Java Map
|
void |
readURL(URL url)
Read in from a given URL which is assumed may contain unicode escapes.
|
void |
readXML(Reader reader)
Read in from a stream encoded using the (legacy) properties Sun DTD.
|
void |
readXML(Reader reader,
boolean validate)
Read in from a stream encoded using the (legacy) properties Sun DTD.
|
public final Properties props
public File currentFile
public Charset currentCharset
public InputAdapter()
public InputAdapter(boolean concurrent)
public InputAdapter(Properties props)
public void readFile(File path, Charset charset)
path - charset - public void readMap(Map<String,?> map)
map - public void readLegacyProperties(Properties legacy)
legacy - public void readURL(URL url)
url - public void read(Reader reader)
reader - public void readXML(Reader reader)
reader - public void readXML(Reader reader, boolean validate)
reader - validate - - if true, use the DTD for validation, throw RuntimeException if failspublic void readJSON(Reader in)
in - public File getCurrentFile()
public Charset getCurrentCharset()
Copyright © 2011–2018 David R. Smith. All rights reserved.