Package org.apache.tika.config
Annotation Interface OperatorOnly
@Documented
@Inherited
@Retention(RUNTIME)
@Target({TYPE,METHOD,FIELD})
public @interface OperatorOnly
Marks a configuration property that only operator-authored configuration (the config
file, presets) may set. Per-request JSON (
JsonConfig.trusted() false, which is
what a tika-server /config part or a pipes FetchEmitTuple carries) that
names the property is refused before any setter runs.
On a component class (inherited by subclasses), a request may not build the component: for an implementation of a request-allowed type that sends data off the host or otherwise breaks that type's promise. A self-configuring component's flat per-request config still tunes the operator's instance, minus its operator-only properties. Not honored on an interface, which does not pass annotations to its implementations.
Put it on the setter (or field, or getter) of anything whose value reaches the host rather than the document: a path or executable the parser runs, a class name it loads, a URL or credential it sends data to, a pool size or memory ceiling an operator sized.
@OperatorOnly
public void setTesseractPath(String tesseractPath) { ... }
Enforced in tika-serialization wherever untrusted JSON configures something: a component
a request builds (ComponentInstantiator), a JsonConfig constructor
(ConfigDeserializer.buildConfig(org.apache.tika.config.JsonConfig, java.lang.Class<T>)), and a self-configuring component's runtime
config (ParseContextConfig.getConfig(org.apache.tika.parser.ParseContext, java.lang.String, java.lang.Class<T>, T)). The check is by JSON key, so a nested
object's properties are checked against the nested type too.- Since:
- Apache Tika 4.2