public ScriptNested<R> setPropertyValue(String propertyValue) { node.setPropertyValue(new AstLiteralTextValue(propertyValue)); return this; }
@Override protected boolean equalTo(AstRegion that) { return (that instanceof AstLiteralTextValue) && equalTo((AstLiteralTextValue) that); }
@Override public Masker visit(AstLiteralTextValue value, State state) { String literalText = value.getValue(); byte[] literalTextAsBytes = literalText.getBytes(UTF_8); for (byte literalTextAsByte : literalTextAsBytes) { if (literalTextAsByte != 0x00) { return Maskers.newMasker(literalTextAsBytes); } } // no need to unmask for all-zeros masking key return Masker.IDENTITY_MASKER; }
@Override public AstLiteralTextValue visitLiteralText(LiteralTextContext ctx) { String text = ctx.literal.getText(); String textWithoutQuotes = text.substring(1, text.length() - 1); String escapedText = escapeString(textWithoutQuotes); AstLiteralTextValue value = new AstLiteralTextValue(escapedText); value.setRegionInfo(asSequentialRegion(childInfos, ctx)); return value; } }
@Override public AstValue<T> visitLiteralText(LiteralTextContext ctx) { if (expectedType == URI.class) { AstLiteralURIValueVisitor visitor = new AstLiteralURIValueVisitor(factory, environment); AstLiteralURIValue value = visitor.visit(ctx); if (value != null) { childInfos().add(value.getRegionInfo()); } return (AstValue<T>) value; } AstLiteralTextValueVisitor visitor = new AstLiteralTextValueVisitor(factory, environment); AstLiteralTextValue value = visitor.visit(ctx); if (value != null) { childInfos().add(value.getRegionInfo()); } return (AstValue<T>) value; }
public StreamNested<R> addValue(String value) { node.addValue(new AstLiteralTextValue(value)); return this; }
@Override public MessageEncoder visit(AstLiteralTextValue value, Void parameter) { return new WriteTextEncoder(value.getValue(), UTF_8); }
public StreamNested<R> setOptionValue(String optionValue) { node.setOptionValue(new AstLiteralTextValue(optionValue)); return this; }
private static WriteOptionFileOffsetHandler newWriteFileOffsetHandler( AstWriteOptionNode node) { AstLiteralTextValue offsetValue = (AstLiteralTextValue) node.getOptionValue(); int offset = Integer.parseInt(offsetValue.getValue()); WriteOptionFileOffsetHandler handler = new WriteOptionFileOffsetHandler(offset); handler.setRegionInfo(node.getRegionInfo()); return handler; } }
public AstWriteConfigNodeBuilder setValue(String name, String value) { node.setValue(name, new AstLiteralTextValue(value)); return this; }
private static ReadOptionFileOffsetHandler newReadFileOffsetHandler( AstReadOptionNode node) { AstLiteralTextValue offsetValue = (AstLiteralTextValue) node.getOptionValue(); int offset = Integer.parseInt(offsetValue.getValue()); ReadOptionFileOffsetHandler handler = new ReadOptionFileOffsetHandler(offset); handler.setRegionInfo(node.getRegionInfo()); return handler; }
public StreamNested<R> setOptionValue(String optionValue) { node.setOptionValue(new AstLiteralTextValue(optionValue)); return this; }
public StreamNested<R> setValue(String name, String value) { node.setValue(name, new AstLiteralTextValue(value)); return this; }
public AstWriteOptionNodeBuilder setOptionValue(String optionValue) { node.setOptionValue(new AstLiteralTextValue(optionValue)); return this; }
public AstReadOptionNodeBuilder setOptionValue(String optionValue) { node.setOptionValue(new AstLiteralTextValue(optionValue)); return this; }
public AstWriteConfigNodeBuilder addValue(String value) { node.addValue(new AstLiteralTextValue(value)); return this; }
public AstWriteNodeBuilder addExactText(String exactText) { node.addValue(new AstLiteralTextValue(exactText)); return this; }
public StreamNested<R> addExactText(String exactText) { node.addValue(new AstLiteralTextValue(exactText)); return this; }
public AstPropertyNodeBuilder setPropertyValue(String propertyValue) { node.setPropertyValue(new AstLiteralTextValue(propertyValue)); return this; }