Package com.google.openrtb.snippet
Class SnippetProcessor
- java.lang.Object
-
- com.google.openrtb.snippet.SnippetProcessor
-
- Direct Known Subclasses:
OpenRtbSnippetProcessor
public abstract class SnippetProcessor extends Object
Supports preprocessing for "snippets" of textual information, in particular for various String fields from the responseOpenRtb.BidResponse.SeatBid.Bids such as the ad markup, URLs and IDs. Additionally, you can use the syntax %{...}% for URL encoding. Nesting can be used, e.g. %{A%{B}%}% will encode A and doubly-encode B. This nesting is typically necessary when URLs have parameter that contain other URLs, so each server decodes and redirects to the next URL.This class is threadsafe, and all concrete subclasses have to be too.
-
-
Field Summary
Fields Modifier and Type Field Description static SnippetProcessorNULL
-
Constructor Summary
Constructors Constructor Description SnippetProcessor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static com.google.common.escape.EscapergetEscaper()Stringprocess(SnippetProcessorContext ctx, String snippet)Processes the raw snippet that was set by the bid, making any transformations necessary.protected abstract booleanprocessMacroAt(SnippetProcessorContext ctx, SnippetMacroType macroDef)protected List<SnippetMacroType>registerMacros()StringtoString()protected com.google.common.base.MoreObjects.ToStringHelpertoStringHelper()protected static StringurlEncode(SnippetProcessorContext ctx, String snippet)
-
-
-
Field Detail
-
NULL
public static final SnippetProcessor NULL
-
-
Method Detail
-
registerMacros
protected List<SnippetMacroType> registerMacros()
-
getEscaper
public static com.google.common.escape.Escaper getEscaper()
-
process
public String process(SnippetProcessorContext ctx, String snippet)
Processes the raw snippet that was set by the bid, making any transformations necessary.
-
processMacroAt
protected abstract boolean processMacroAt(SnippetProcessorContext ctx, SnippetMacroType macroDef)
-
urlEncode
protected static String urlEncode(SnippetProcessorContext ctx, String snippet)
-
toStringHelper
protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
-
-