Package com.yahoo.config.codegen
Class NormalizedDefinition
java.lang.Object
com.yahoo.config.codegen.NormalizedDefinition
Does normalizing (removing comments, trimming whitespace etc.) and calculation of md5sum
of config definitions
- Author:
- hmusum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNormalizedLine(String line) normalize(BufferedReader reader) static StringNormalizes a config definition line.static StringstripSpaces(String str) Replaces sequences of spaces with 1 space, unless inside quotes.static byte[]toString()
-
Constructor Details
-
NormalizedDefinition
public NormalizedDefinition()
-
-
Method Details
-
normalize
- Throws:
IOException
-
normalize
Normalizes a config definition line. Each string is normalized according to the rules of config and definition files before they are used:- Remove trailing space.
- Remove trailing comments, and spaces before trailing comments.
- Remove empty lines
- Keep comment lines
- Parameters:
line- a config definition line- Returns:
- a normalized config definition line
-
addNormalizedLine
-
generateMd5Sum
-
toBytes
-
stripSpaces
Replaces sequences of spaces with 1 space, unless inside quotes. Public for testing.- Parameters:
str- String to strip spaces from- Returns:
- String with spaces stripped
-
getNormalizedContent
-
toString
-
getDefMd5
-