Examples of MapContext


Examples of com.cognifide.slice.core.internal.context.MapContext

   * Returned Context will contain entry for ResourceResolver.class. No ServletRequest.class or
   * ServletResponse.class will be available for injector.
   */
  @Override
  public Context getResourceResolverContext(final ResourceResolver resourceResolver) {
    final MapContext mapContex = new MapContext();
    mapContex.put(Key.get(ResourceResolver.class), resourceResolver);

    return mapContex;
  }
View Full Code Here

Examples of net.freedom.gj.beans.criteria.MapContext

    }
   
    @Test
    public void testFactoryUsingMapContext() throws Exception{
       
         MyService service = factory.getObject(new MapContext("payload","I am a string value") );
         assertEquals(MyServiceA.class, service.getClass());
         service.execute();
        
         service = factory.getObject(new MapContext("payload",new Integer(0),"switch","ON" ) );
         assertEquals(MyServiceB.class, service.getClass());
         service.execute();
        
         DataEntity pojo = new DataEntity("ABC","furniture");        
         service = factory.getObject(pojo);
View Full Code Here

Examples of net.sf.laja.context.MapContext

    context.addMacro(this);
    return null;
  }

  public void populateArguments(List<Object> arguments) {
    MapContext populatedArguments = new MapContext(name, namespaces, templateTextWriter);
   
    Iterator<Object> argumentsIterator = arguments.iterator();
   
    for (String parameter : parameters) {
      if (!argumentsIterator.hasNext()) {
        throw new InterpretationException(source, indexInSource, "Missing argument in parameter list for macro '" + name + "'");
      }
      populatedArguments.set(parameter, argumentsIterator.next());
    }
    if (argumentsIterator.hasNext()) {
      throw new InterpretationException(source, indexInSource, "Too many arguments in parameter list for macro '" + name + "'");
    }
    localContext.setLocalVariables(populatedArguments);
View Full Code Here

Examples of net.sf.laja.context.MapContext

    }
    localContext.setLocalVariables(populatedArguments);
  }
 
  public void populateDataArguments(List<Data> arguments) {
    MapContext populatedArguments = new MapContext(name, namespaces, templateTextWriter);
   
    Iterator<Data> argumentsIterator = arguments.iterator();

    for (String parameter : parameters) {
      if (!argumentsIterator.hasNext()) {
        throw new InterpretationException(source, indexInSource, "Missing argument in parameter list for macro '" + name + "'");
      }
      Data argument = argumentsIterator.next();
      if (argument.isLazy()) {
        populatedArguments.set(parameter, argument);
      } else {
        populatedArguments.set(parameter, argument.evaluate());
      }
    }
    if (argumentsIterator.hasNext()) {
      throw new InterpretationException(source, indexInSource, "Too many arguments in parameter list for macro '" + name + "'");
    }
View Full Code Here

Examples of net.sf.laja.context.MapContext

    try {
      if (primitive != null) {
        attribute = primitive.evaluate();
      } else if (isNamespaceRef()) {
        String namespaceName = namespaceRef.getNamespaceName();
        MapContext namespaceContext = namespaces.getNamespaceContext(namespaceName);
        if (namespaceContext == null) {
          throw new InterpretationException(source, indexInSource, "Could not find namespace '" + namespaceName + "'");
        }
        attribute = namespaceContext.getMap();
      } else if (namespaceRef == null) {
        attribute = getResultFromCurrentOrDefaultNamespace();
      } else {
        attribute = getResultFromSpecifiedNamespace();
      }
View Full Code Here

Examples of net.sf.laja.context.MapContext

  }
 
  public void setAttribute(String attributeName, Context parentContext) {
    Map<String,Object> map = new LinkedHashMap<String,Object>();
    parentContext.set(attributeName, map);
    Context mapSetter = new MapContext(attributeName, namespaces, templateTextWriter, map);
    for (MapMember member : members) {
      member.set(mapSetter);
    }
  }
View Full Code Here

Examples of org.apache.commons.jexl2.MapContext

        return result;
    }

    public JexlContext addFieldsToContext(final Object attributable, final JexlContext jexlContext) {
        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        final Field[] fields = attributable.getClass().getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            try {
View Full Code Here

Examples of org.apache.commons.jexl2.MapContext

    public JexlContext addAttrsToContext(final Collection<? extends AbstractAttr> attributes,
            final JexlContext jexlContext) {

        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        for (AbstractAttr attr : attributes) {
            List<String> attributeValues = attr.getValuesAsStrings();
            String expressionValue = attributeValues.isEmpty()
View Full Code Here

Examples of org.apache.commons.jexl2.MapContext

    public JexlContext addDerAttrsToContext(final Collection<? extends AbstractDerAttr> derAttrs,
            final Collection<? extends AbstractAttr> attrs, final JexlContext jexlContext) {

        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        for (AbstractDerAttr derAttr : derAttrs) {
            String expressionValue = derAttr.getValue(attrs);
            if (expressionValue == null) {
View Full Code Here

Examples of org.apache.commons.jexl2.MapContext

    public JexlContext addVirAttrsToContext(final Collection<? extends AbstractVirAttr> virAttrs,
            final JexlContext jexlContext) {

        JexlContext context = jexlContext == null
                ? new MapContext()
                : jexlContext;

        for (AbstractVirAttr virAttr : virAttrs) {
            List<String> attributeValues = virAttr.getValues();
            String expressionValue = attributeValues.isEmpty()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.