public class INIReader extends java.lang.Object implements ITemplatedReader
Constructor and Description |
---|
INIReader()
Constructor using the ! as a comment is the default behavior
|
INIReader(java.lang.String c)
Constructor allowing the specification of different comment symbols.
|
Modifier and Type | Method and Description |
---|---|
void |
addTemplateType(java.lang.String name,
org.eclipse.core.resources.IFile file)
Add a new template to the INIReader that can be used to validate forms.
|
java.util.ArrayList<Entry> |
findAll(org.eclipse.core.resources.IFile file,
java.lang.String regex)
Searches a given IFile for content that matches a given regular
expression.
|
java.lang.String |
getReaderType()
Return that this is an INIReader
|
Form |
read(org.eclipse.core.resources.IFile file)
Read through an INI file by reading each section.
|
void |
setAssignmentPattern(java.lang.String regex)
Allows the changing of the syntax for variable assignment
|
void |
setCommentString(java.lang.String comm)
Set what the reader should consider to be the comment string in the ini
file
|
void |
setIndentString(java.lang.String indent)
Allows the changing of the section assignment indentation string.
|
void |
setSectionPattern(java.lang.String regex)
Allows the changing of the syntax for section headers.
|
void |
setTemplateType(java.lang.String template)
Set the template file used to validate that the form is correctly set up.
|
public INIReader()
public INIReader(java.lang.String c)
c
- the symbol to use to specify a commentpublic Form read(org.eclipse.core.resources.IFile file)
public void setCommentString(java.lang.String comm)
setCommentString
in interface ITemplatedReader
comm
- The comment string to look forpublic void setIndentString(java.lang.String indent)
setIndentString
in interface ITemplatedReader
indent
- Set how to indent on sectionspublic void setSectionPattern(java.lang.String regex)
setSectionPattern
in interface ITemplatedReader
regex
- A regular expression to match to section headerspublic void setAssignmentPattern(java.lang.String regex)
setAssignmentPattern
in interface ITemplatedReader
regex
- How to search for variable assignmentspublic void setTemplateType(java.lang.String template)
setTemplateType
in interface ITemplatedReader
template
- the type of template that should be used to validate the form
after calling read()public void addTemplateType(java.lang.String name, org.eclipse.core.resources.IFile file)
addTemplateType
in interface ITemplatedReader
name
- The name to reference the template file withfile
- The template filepublic java.util.ArrayList<Entry> findAll(org.eclipse.core.resources.IFile file, java.lang.String regex)
public java.lang.String getReaderType()
getReaderType
in interface IReader