Class ClassRegistry
java.lang.Object
org.apache.tinkerpop.gremlin.structure.io.ClassRegistry
Holds the classes a GraphSON or Gryo
Class value may name, so such a name is resolved from this registry
rather than by a class loader. Registration is a Java API only and refuses a TraversalStrategy, which
belongs to TraversalStrategies.GlobalCache.
lookup(String) also falls back to GlobalCache.getRegisteredStrategyClassByFullName, so a strategy
the selector can construct is nameable without being registered here.-
Method Summary
Modifier and TypeMethodDescriptionLooks up a class nameable as a genericClassvalue, without loading it.static voidRegisters a class as nameable as a genericClassvalue, without making it constructible from a serialized traversal, so it cannot widen what the selector can construct.static voidunregister(Class<?> clazz) Removes a class from this registry, so it is no longer nameable as a genericClassvalue.
-
Method Details
-
register
Registers a class as nameable as a genericClassvalue, without making it constructible from a serialized traversal, so it cannot widen what the selector can construct. ATraversalStrategyis refused with anIllegalArgumentExceptionand anullwith aNullPointerException. -
unregister
Removes a class from this registry, so it is no longer nameable as a genericClassvalue. ATraversalStrategyis refused because strategies belong toTraversalStrategies.GlobalCache, and anullis refused with aNullPointerException. -
lookup
Looks up a class nameable as a genericClassvalue, without loading it. Matching is on the exactClass.getName(), never assignability, so registering a superclass or an interface does not admit its subtypes. Anullname yields an emptyOptional, since aClassvalue can name nothing.
-