public abstract class AbstractProfilesConfigFileScanner
extends java.lang.Object
Constructor and Description |
---|
AbstractProfilesConfigFileScanner() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
isSupportedProperty(java.lang.String propertyName) |
protected abstract void |
onEmptyOrCommentLine(java.lang.String profileName,
java.lang.String line)
Action to be performed when an empty or comment line is detected
|
protected abstract void |
onEndOfFile()
Action to be performed when the scanner reaches the end of the
credentials file.
|
protected abstract void |
onProfileEndingLine(java.lang.String prevProfileName)
Action to be performed when the scanner reaches the end of a profile
section.
|
protected abstract void |
onProfileProperty(java.lang.String profileName,
java.lang.String propertyName,
java.lang.String propertyValue,
boolean isSupportedProperty,
java.lang.String line)
Action to be performed when a property declaration is detected inside a
profile section.
|
protected abstract void |
onProfileStartingLine(java.lang.String newProfileName,
java.lang.String line)
Action to be performed when the starting line of a new profile is detected
|
private static java.lang.String |
parseProfileName(java.lang.String trimmedLine)
Returns the profile name if this line indicates the beginning of a new
profile section.
|
private static java.util.Map.Entry<java.lang.String,java.lang.String> |
parsePropertyLine(java.lang.String propertyLine) |
protected void |
run(java.util.Scanner scanner)
Scan through the given input, and perform the defined actions.
|
protected abstract void onEmptyOrCommentLine(java.lang.String profileName, java.lang.String line)
protected abstract void onProfileStartingLine(java.lang.String newProfileName, java.lang.String line)
protected abstract void onProfileEndingLine(java.lang.String prevProfileName)
protected abstract void onEndOfFile()
protected abstract void onProfileProperty(java.lang.String profileName, java.lang.String propertyName, java.lang.String propertyValue, boolean isSupportedProperty, java.lang.String line)
profileName
- The name of the profile where this property is declared.propertyName
- The name of the property.propertyValue
- The value of the property.isSupportedProperty
- Whether this is a supported property according to the
specification of credential profiles file.line
- The original line of text where the property is declared.protected void run(java.util.Scanner scanner)
scanner
- The scanner for the credentials file input.private static java.lang.String parseProfileName(java.lang.String trimmedLine)
private static java.util.Map.Entry<java.lang.String,java.lang.String> parsePropertyLine(java.lang.String propertyLine)
private static boolean isSupportedProperty(java.lang.String propertyName)