Search in sources :

Example 6 with ObjectStringConverter

use of org.webpieces.router.api.extensions.ObjectStringConverter in project webpieces by deanhiller.

the class PluginSetup method wireInPluginPoints.

/**
 * This is where we wire in all plugin points EXCEPT the Startup one
 * we can't inject them :(
 */
@SuppressWarnings("rawtypes")
public void wireInPluginPoints(Injector appInjector) {
    Key<Set<EntityLookup>> key = Key.get(new TypeLiteral<Set<EntityLookup>>() {
    });
    Set<EntityLookup> lookupHooks = appInjector.getInstance(key);
    translator.install(lookupHooks);
    Key<Set<ObjectStringConverter>> key3 = Key.get(new TypeLiteral<Set<ObjectStringConverter>>() {
    });
    Set<ObjectStringConverter> converters = appInjector.getInstance(key3);
    translation.install(converters);
    Key<Set<BodyContentBinder>> key2 = Key.get(new TypeLiteral<Set<BodyContentBinder>>() {
    });
    Set<BodyContentBinder> bodyBinders = appInjector.getInstance(key2);
    bodyContentChecker.install(bodyBinders);
    Key<Set<HtmlTagCreator>> key4 = Key.get(new TypeLiteral<Set<HtmlTagCreator>>() {
    });
    Set<HtmlTagCreator> htmlTagCreators = appInjector.getInstance(key4);
    // Guice circular dependency we could not work around quite yet.  figure out later maybe
    TemplateApi api = templateApi.get();
    api.installCustomTags(htmlTagCreators);
}
Also used : BodyContentBinder(org.webpieces.router.api.extensions.BodyContentBinder) Set(java.util.Set) TemplateApi(org.webpieces.router.api.TemplateApi) EntityLookup(org.webpieces.router.api.extensions.EntityLookup) HtmlTagCreator(org.webpieces.ctx.api.extension.HtmlTagCreator) ObjectStringConverter(org.webpieces.router.api.extensions.ObjectStringConverter)

Example 7 with ObjectStringConverter

use of org.webpieces.router.api.extensions.ObjectStringConverter in project webpieces by deanhiller.

the class CookieScopeImpl method put.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void put(String key, Object value) {
    // put(key, "") is different than put(key, null) because in FieldTag, IF the field is null(from Flash cookie) then
    // the webpage will display the default value.  If the value is "", then page will display "" assuming customer deleted the field
    hasModifiedData = true;
    ObjectStringConverter marshaller = objectTranslator.getConverterFor(value);
    String strValue = marshaller.objectToString(value);
    cookie.put(key, strValue);
}
Also used : ObjectStringConverter(org.webpieces.router.api.extensions.ObjectStringConverter)

Aggregations

ObjectStringConverter (org.webpieces.router.api.extensions.ObjectStringConverter)7 ParamMeta (org.webpieces.router.api.extensions.ParamMeta)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 Method (java.lang.reflect.Method)2 HashMap (java.util.HashMap)2 Set (java.util.Set)2 HtmlTagCreator (org.webpieces.ctx.api.extension.HtmlTagCreator)2 BodyContentBinder (org.webpieces.router.api.extensions.BodyContentBinder)2 EntityLookup (org.webpieces.router.api.extensions.EntityLookup)2 ParamNode (org.webpieces.router.impl.params.ParamNode)2 ValueNode (org.webpieces.router.impl.params.ValueNode)2 XFuture (org.webpieces.util.futures.XFuture)2 Annotation (java.lang.annotation.Annotation)1 Field (java.lang.reflect.Field)1 Parameter (java.lang.reflect.Parameter)1 ParameterizedType (java.lang.reflect.ParameterizedType)1 Type (java.lang.reflect.Type)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Map (java.util.Map)1