@ConfigurableContext(nocache=true) public final class ParserGroup extends BeanContext
Parsers that can be looked up by media type.
Adding new entries will cause the entries to be prepended to the group. This allows for previous parsers to be overridden through subsequent calls.
For example, calling g.append(P1.
will result in the order
| Modifier and Type | Field and Description |
|---|---|
static ParserGroup |
EMPTY
An unmodifiable empty parser group.
|
BEAN_beanClassVisibility, BEAN_beanConstructorVisibility, BEAN_beanDictionary, BEAN_beanDictionary_add, BEAN_beanDictionary_remove, BEAN_beanFieldVisibility, BEAN_beanFilters, BEAN_beanFilters_add, BEAN_beanFilters_remove, BEAN_beanMapPutReturnsOldValue, BEAN_beanMethodVisibility, BEAN_beansRequireDefaultConstructor, BEAN_beansRequireSerializable, BEAN_beansRequireSettersForGetters, BEAN_beansRequireSomeProperties, BEAN_beanTypePropertyName, BEAN_bpi, BEAN_bpro, BEAN_bpwo, BEAN_bpx, BEAN_debug, BEAN_examples, BEAN_excludeProperties, BEAN_fluentSetters, BEAN_ignoreInvocationExceptionsOnGetters, BEAN_ignoreInvocationExceptionsOnSetters, BEAN_ignorePropertiesWithoutSetters, BEAN_ignoreUnknownBeanProperties, BEAN_ignoreUnknownNullBeanProperties, BEAN_implClasses, BEAN_includeProperties, BEAN_locale, BEAN_mediaType, BEAN_notBeanClasses, BEAN_notBeanClasses_add, BEAN_notBeanClasses_remove, BEAN_notBeanPackages, BEAN_notBeanPackages_add, BEAN_notBeanPackages_remove, BEAN_pojoSwaps, BEAN_pojoSwaps_add, BEAN_pojoSwaps_remove, BEAN_propertyNamer, BEAN_sortProperties, BEAN_timeZone, BEAN_useEnumNames, BEAN_useInterfaceProxies, BEAN_useJavaBeanIntrospector, DEFAULT, DEFAULT_SORTED| Constructor and Description |
|---|
ParserGroup(PropertyStore ps,
Parser[] parsers)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
ParserGroupBuilder |
builder()
Returns a builder that's a copy of the settings on this parser group.
|
static ParserGroupBuilder |
create()
Instantiates a new clean-slate
ParserGroupBuilder object. |
Parser |
getParser(MediaType mediaType)
Same as
getParserMatch(MediaType) but returns just the matched parser. |
Parser |
getParser(String contentTypeHeader)
Same as
getParserMatch(String) but returns just the matched parser. |
ParserMatch |
getParserMatch(MediaType mediaType)
Same as
getParserMatch(String) but matches using a MediaType instance. |
ParserMatch |
getParserMatch(String contentTypeHeader)
Searches the group for a parser that can handle the specified
|
List<Parser> |
getParsers()
Returns the parsers in this group.
|
List<MediaType> |
getSupportedMediaTypes()
Returns the media types that all parsers in this group can handle
|
_class, createBeanSession, createBeanSession, createDefaultBeanSessionArgs, createDefaultSessionArgs, createSession, createSession, createSession, dumpCacheStats, getBeanClassVisibility, getBeanConstructorVisibility, getBeanDictionaryClasses, getBeanFieldVisibility, getBeanFilters, getBeanMeta, getBeanMethodVisibility, getBeanRegistry, getBeanTypePropertyName, getBpi, getBpi, getBpro, getBpro, getBpwo, getBpwo, getBpx, getBpx, getClassMeta, getClassMeta, getClassMetaForObject, getExamples, getImplClassConstructor, getImplClasses, getLocale, getMediaType, getNotBeanClasses, getNotBeanPackagesNames, getNotBeanPackagesPrefixes, getPojoSwaps, getPropertyNamer, getTimeZone, hasSameCache, isBean, isBeanMapPutReturnsOldValue, isBeansRequireDefaultConstructor, isBeansRequireSerializable, isBeansRequireSettersForGetters, isBeansRequireSomeProperties, isDebug, isFluentSetters, isIgnoreInvocationExceptionsOnGetters, isIgnoreInvocationExceptionsOnSetters, isIgnorePropertiesWithoutSetters, isIgnoreUnknownBeanProperties, isIgnoreUnknownNullBeanProperties, isNotABean, isSortProperties, isUseEnumNames, isUseInterfaceProxies, isUseJavaBeanIntrospector, object, resolveClassMeta, string, toMapequals, getArrayProperty, getArrayProperty, getBooleanProperty, getCdlProperty, getClassArrayProperty, getClassArrayProperty, getClassArrayProperty, getClassListProperty, getClassListProperty, getClassMapProperty, getClassMapProperty, getClassProperty, getClassSetProperty, getClassSetProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceArrayProperty, getInstanceProperty, getInstanceProperty, getInstanceProperty, getIntegerProperty, getListProperty, getListProperty, getLongProperty, getMapProperty, getProperty, getProperty, getPropertyKeys, getPropertyStore, getSetProperty, getSetProperty, getStringProperty, getStringPropertyWithNone, hashCode, identityCode, toStringpublic static final ParserGroup EMPTY
public ParserGroup(PropertyStore ps, Parser[] parsers)
ps - The modifiable properties that were used to initialize the parsers.
A snapshot of these will be made so that we can clone and modify this group.parsers - The parsers defined in this group.
The order is important because they will be tried in reverse order (e.g. newer first) in which they will be
tried to match against media types.public static ParserGroupBuilder create()
ParserGroupBuilder object.
This is equivalent to simply calling .
ParserGroupBuilder object.public ParserGroupBuilder builder()
builder in class BeanContextParserGroupBuilder initialized to this group.public ParserMatch getParserMatch(String contentTypeHeader)
The returned object includes both the parser and media type that matched.
contentTypeHeader - The HTTP public ParserMatch getParserMatch(MediaType mediaType)
getParserMatch(String) but matches using a MediaType instance.mediaType - The HTTP public Parser getParser(String contentTypeHeader)
getParserMatch(String) but returns just the matched parser.contentTypeHeader - The HTTP public Parser getParser(MediaType mediaType)
getParserMatch(MediaType) but returns just the matched parser.mediaType - The HTTP media type.public List<MediaType> getSupportedMediaTypes()
Entries are ordered in the same order as the parsers in the group.
public List<Parser> getParsers()
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.