Package org.pjdbc.annotations
Annotation Interface DriverParameter
@Documented
@Retention(RUNTIME)
@Target(TYPE)
@Repeatable(DriverParameters.class)
public @interface DriverParameter
Declares a URL parameter accepted by a PJDBC proxy driver.
This annotation is repeatable, allowing multiple parameters to be declared on a single driver class.
Example usage:
@DriverCapability(prefix = "cache", description = "Caches query results")
@DriverParameter(name = "ttl", type = ParameterType.INTEGER,
description = "Time-to-live in seconds", defaultValue = "60", min = 1)
@DriverParameter(name = "maxSize", type = ParameterType.INTEGER,
description = "Maximum cached entries", defaultValue = "1000", min = 1)
@DriverParameter(name = "enabled", type = ParameterType.BOOLEAN,
description = "Enable caching", defaultValue = "true")
public class CachingDriver extends AbstractProxyDriver {
// ...
}
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumParameter types supported by driver parameters. -
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe default value if not specified in the URL.A description of what this parameter controls.String[]Valid values for enum-like string parameters.longMaximum value for numeric parameters.longMinimum value for numeric parameters.booleanWhether this parameter is required.The parameter type.
-
Element Details
-
name
String nameThe parameter name as it appears in the JDBC URL. For example, "ttl" for jdbc:cache[ttl=60]:...- Returns:
- the parameter name
-
type
The parameter type.- Returns:
- the parameter type
- Default:
STRING
-
description
String descriptionA description of what this parameter controls.- Returns:
- the parameter description
- Default:
""
-
defaultValue
String defaultValueThe default value if not specified in the URL. Use empty string for no default (required parameter).- Returns:
- the default value as a string
- Default:
""
-
min
long minMinimum value for numeric parameters. Use Long.MIN_VALUE to indicate no minimum.- Returns:
- the minimum value
- Default:
-9223372036854775808L
-
max
long maxMaximum value for numeric parameters. Use Long.MAX_VALUE to indicate no maximum.- Returns:
- the maximum value
- Default:
9223372036854775807L
-
enumValues
String[] enumValuesValid values for enum-like string parameters. Empty array means any value is allowed.- Returns:
- array of valid values
- Default:
{}
-
required
boolean requiredWhether this parameter is required. If true and no default is provided, the driver will fail if the parameter is not specified.- Returns:
- true if the parameter is required
- Default:
false
-