Search in sources :

Example 1 with TextResourceOrigin

use of cn.taketoday.origin.TextResourceOrigin in project today-infrastructure by TAKETODAY.

the class OriginTrackedPropertiesLoader method loadValue.

private OriginTrackedValue loadValue(StringBuilder buffer, CharacterReader reader, boolean splitLists) throws IOException {
    buffer.setLength(0);
    while (reader.isWhiteSpace() && !reader.isEndOfLine()) {
        reader.read();
    }
    Location location = reader.getLocation();
    while (!reader.isEndOfLine() && !(splitLists && reader.isListDelimiter())) {
        buffer.append(reader.getCharacter());
        reader.read();
    }
    Origin origin = new TextResourceOrigin(this.resource, location);
    return OriginTrackedValue.of(buffer.toString(), origin);
}
Also used : Origin(cn.taketoday.origin.Origin) TextResourceOrigin(cn.taketoday.origin.TextResourceOrigin) TextResourceOrigin(cn.taketoday.origin.TextResourceOrigin) Location(cn.taketoday.origin.TextResourceOrigin.Location)

Example 2 with TextResourceOrigin

use of cn.taketoday.origin.TextResourceOrigin in project today-framework by TAKETODAY.

the class OriginTrackedPropertiesLoader method loadValue.

private OriginTrackedValue loadValue(StringBuilder buffer, CharacterReader reader, boolean splitLists) throws IOException {
    buffer.setLength(0);
    while (reader.isWhiteSpace() && !reader.isEndOfLine()) {
        reader.read();
    }
    Location location = reader.getLocation();
    while (!reader.isEndOfLine() && !(splitLists && reader.isListDelimiter())) {
        buffer.append(reader.getCharacter());
        reader.read();
    }
    Origin origin = new TextResourceOrigin(this.resource, location);
    return OriginTrackedValue.of(buffer.toString(), origin);
}
Also used : Origin(cn.taketoday.origin.Origin) TextResourceOrigin(cn.taketoday.origin.TextResourceOrigin) TextResourceOrigin(cn.taketoday.origin.TextResourceOrigin) Location(cn.taketoday.origin.TextResourceOrigin.Location)

Aggregations

Origin (cn.taketoday.origin.Origin)2 TextResourceOrigin (cn.taketoday.origin.TextResourceOrigin)2 Location (cn.taketoday.origin.TextResourceOrigin.Location)2