@Override public AstLiteralURIValue visitLiteralText(LiteralTextContext ctx) { String literal = ctx.literal.getText(); String textWithoutQuotes = literal.substring(1, literal.length() - 1); String escapedText = escapeString(textWithoutQuotes); AstLiteralURIValue value = new AstLiteralURIValue(URI.create(escapedText)); value.setRegionInfo(asSequentialRegion(childInfos, ctx)); return value; }
@Override protected boolean equalTo(AstRegion that) { return (that instanceof AstLiteralURIValue) && equalTo((AstLiteralURIValue) that); }
@Override public MessageEncoder visit(AstLiteralURIValue value, Void parameter) { return new WriteTextEncoder(value.getValue().toString(), UTF_8); } }
public ScriptNested<R> setPropertyValue(URI propertyValue) { node.setPropertyValue(new AstLiteralURIValue(propertyValue)); return this; }
@Override public AstValue<URI> visitLiteralText(LiteralTextContext ctx) { AstLiteralURIValueVisitor visitor = new AstLiteralURIValueVisitor(factory, environment); AstLiteralURIValue value = visitor.visit(ctx); if (value != null) { childInfos().add(value.getRegionInfo()); } return value; }
public StreamNested<R> setOptionValue(URI optionValue) { node.setOptionValue(new AstLiteralURIValue(optionValue)); return this; }
@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> setOptionValue(URI optionValue) { node.setOptionValue(new AstLiteralURIValue(optionValue)); return this; }
@Override public Masker visit(AstLiteralURIValue value, State state) { URI literalURI = value.getValue(); String literalText = literalURI.toString(); 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; }
public AstWriteOptionNodeBuilder setOptionValue(URI optionValue) { node.setOptionValue(new AstLiteralURIValue(optionValue)); return this; }
public AstReadOptionNodeBuilder setOptionValue(URI optionValue) { node.setOptionValue(new AstLiteralURIValue(optionValue)); return this; }
public AstPropertyNodeBuilder setPropertyValue(URI propertyValue) { node.setPropertyValue(new AstLiteralURIValue(propertyValue)); return this; }