Package com.mastfrog.acteur
Class ContentConverter.ContentValidationPlugin
java.lang.Object
com.mastfrog.acteur.ContentConverter.ContentValidationPlugin
- Enclosing class:
- ContentConverter
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedContentValidationPlugin(ContentConverter converter, Class<?>... types) protectedContentValidationPlugin(ContentConverter converter, Iterable<Class<?>> types) protectedContentValidationPlugin(ContentConverter converter, String... types) protectedContentValidationPlugin(ContentConverter converter, Set<String> types) -
Method Summary
Modifier and TypeMethodDescriptionprotected final <T> ContentConverter.ContentValidationPluginprotected abstract <T> voidvalidate(io.netty.buffer.ByteBuf buf, com.mastfrog.mime.MimeType mimeType, Class<T> type, Codec codec) Validate the contents of a bytebuf without necessarily instantiating an object.protected abstract <T> voidValidate a map which will be further deserialized into an object of type T.
-
Constructor Details
-
ContentValidationPlugin
-
ContentValidationPlugin
-
ContentValidationPlugin
protected ContentValidationPlugin(ContentConverter converter, String... types) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
ContentValidationPlugin
protected ContentValidationPlugin(ContentConverter converter, Set<String> types) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
-
Method Details
-
register
-
validate
protected abstract <T> void validate(io.netty.buffer.ByteBuf buf, com.mastfrog.mime.MimeType mimeType, Class<T> type, Codec codec) throws Exception Validate the contents of a bytebuf without necessarily instantiating an object. Throw an exception of some known type (may want to install an ExceptionEvaluator to turn that into a meaningful response code).- Type Parameters:
T- The type- Parameters:
buf- The buffermimeType-type-codec-- Throws:
Exception
-
validate
Validate a map which will be further deserialized into an object of type T. Throw an exception of some known type (may want to install an ExceptionEvaluator to turn that into a meaningful response code).- Type Parameters:
T- The type- Parameters:
type- The typemap- The map
-