Class ParseFieldRegistry<T>
java.lang.Object
org.elasticsearch.common.xcontent.ParseFieldRegistry<T>
Registry for looking things up using ParseField semantics.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNames()All the names under which values are registered.lookup(String name, org.elasticsearch.common.xcontent.XContentLocation xContentLocation, org.elasticsearch.common.xcontent.DeprecationHandler deprecationHandler)Lookup a value from the registry by name while checking that the name matches the ParseField.lookupReturningNullIfNotFound(String name, org.elasticsearch.common.xcontent.DeprecationHandler deprecationHandler)Lookup a value from the registry by name while checking that the name matches the ParseField.voidRegister a parser.voidRegister a parser.
-
Constructor Details
-
ParseFieldRegistry
Build the registry.- Parameters:
registryName- used for error messages
-
-
Method Details
-
getNames
All the names under which values are registered. Expect this to be used mostly for testing. -
register
Register a parser. -
register
Register a parser. -
lookup
public T lookup(String name, org.elasticsearch.common.xcontent.XContentLocation xContentLocation, org.elasticsearch.common.xcontent.DeprecationHandler deprecationHandler)Lookup a value from the registry by name while checking that the name matches the ParseField.- Parameters:
name- The name of the thing to look up.- Returns:
- The value being looked up. Never null.
- Throws:
ParsingException- if the named thing isn't in the registry or the name was deprecated and deprecated names aren't supported.
-
lookupReturningNullIfNotFound
public T lookupReturningNullIfNotFound(String name, org.elasticsearch.common.xcontent.DeprecationHandler deprecationHandler)Lookup a value from the registry by name while checking that the name matches the ParseField.- Parameters:
name- The name of the thing to look up.- Returns:
- The value being looked up or null if it wasn't found.
- Throws:
ParsingException- if the named thing isn't in the registry or the name was deprecated and deprecated names aren't supported.
-