public class AnonymizingTypeTranslator extends GroovyTranslator.DefaultTypeTranslator
Bytecode into a representation that has been stripped of any user data
(anonymized). A default anonymizer is provided, but can be replaced with a custom anonymizer as needed. The
default anonymizer replaces any String, Numeric, Date, Timestamp, or UUID with a type-based token. Identical values
will receive the same token (e.g. if "foo" is assigned "string0" then all occurrences of "foo" will be replaced
with "string0").| Modifier and Type | Class and Description |
|---|---|
static interface |
AnonymizingTypeTranslator.Anonymizer
Customizable anonymizer interface.
|
static class |
AnonymizingTypeTranslator.DefaultAnonymizer
This default implementation keeps a map from type (Java Class) to another map from instances to anonymized
token.
|
ANONYMOUS_TRAVERSAL_PREFIX, script, withParameters| Constructor and Description |
|---|
AnonymizingTypeTranslator()
Default constructor creates a
AnonymizingTypeTranslator.DefaultAnonymizer + withParameters=false. |
AnonymizingTypeTranslator(AnonymizingTypeTranslator.Anonymizer anonymizer,
boolean withParameters) |
AnonymizingTypeTranslator(boolean withParameters) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getSyntax(Date o)
Take the
Date argument and convert it to a string representation in the target language. |
protected String |
getSyntax(Number o)
Take the numeric argument and convert it to a string representation in the target language.
|
protected String |
getSyntax(String o)
Take the string argument and convert it to a string representation in the target language (i.e.
|
protected String |
getSyntax(Timestamp o)
Take the
Timestamp argument and convert it to a string representation in the target language. |
protected String |
getSyntax(UUID o)
Take the
UUID argument and convert it to a string representation in the target language. |
protected Script |
produceScript(Class<?> o)
Gets the string representation of a class with the default implementation simply checking to see if the
Class is in CoreImports or not. |
getNullSyntax, getSyntax, getSyntax, getSyntax, getSyntax, getSyntax, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScript, produceScriptapply, convertToScript, getAnonymousTraversalPrefixclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitandThenpublic AnonymizingTypeTranslator()
AnonymizingTypeTranslator.DefaultAnonymizer + withParameters=false.public AnonymizingTypeTranslator(boolean withParameters)
public AnonymizingTypeTranslator(AnonymizingTypeTranslator.Anonymizer anonymizer, boolean withParameters)
protected String getSyntax(String o)
Translator.ScriptTranslator.AbstractTypeTranslatorgetSyntax in class GroovyTranslator.DefaultTypeTranslatorprotected String getSyntax(Date o)
Translator.ScriptTranslator.AbstractTypeTranslatorDate argument and convert it to a string representation in the target language.getSyntax in class GroovyTranslator.DefaultTypeTranslatorprotected String getSyntax(Timestamp o)
Translator.ScriptTranslator.AbstractTypeTranslatorTimestamp argument and convert it to a string representation in the target language.getSyntax in class GroovyTranslator.DefaultTypeTranslatorprotected String getSyntax(UUID o)
Translator.ScriptTranslator.AbstractTypeTranslatorUUID argument and convert it to a string representation in the target language.getSyntax in class GroovyTranslator.DefaultTypeTranslatorprotected String getSyntax(Number o)
Translator.ScriptTranslator.AbstractTypeTranslatorNumber instance itself (i.e. Double, Integer, etc.)getSyntax in class GroovyTranslator.DefaultTypeTranslatorprotected Script produceScript(Class<?> o)
GroovyTranslator.DefaultTypeTranslatorClass is in CoreImports or not. If it is present that means it can be referenced using the
simple name otherwise it uses the canonical name.
Those building custom ScriptTranslator instances might override this if they have other classes
that are not in CoreImports by default.produceScript in class GroovyTranslator.DefaultTypeTranslatorCopyright © 2013–2022 Apache Software Foundation. All rights reserved.