Package net.sf.laja.context

Examples of net.sf.laja.context.Context


    return new AttributeRef(namespaces);
  }

  @Override
  public IReference createReference(ITemplate itemplate, IMacro imacro, IFunction ifunction) {
    Context context = getContext(itemplate, imacro, ifunction);
    return new Reference(source, context, templateTextWriter, namespaces);
  }
View Full Code Here


    return new Reference(source, context, templateTextWriter, namespaces);
  }

  @Override
  public ICallReference createCallReference(ITemplate itemplate, IMacro imacro, IFunction ifunction) {
    Context context = getContext(itemplate, imacro, ifunction);
    return new CallReference(source, context, templateTextWriter, namespaces);
  }
View Full Code Here

    return new AttributeRefs(attributes.subList(0, attributes.size()-1));
  }

  public Object evaluateNextAttributes(Context context, Object attribute) {
    for (AttributeRef attributeRef : attributes) {
      Context attributeContext = context.createContext(attribute, attributeRef);
      attribute = attributeContext.evaluate(attributeRef);
      if (attributeRef.hasListIndex()) {
        attribute = attributeRef.evaluateArrayOrList(attribute);
      }
    }
    return attribute;
View Full Code Here

     
      if (targetAttributeRefs.hasAttributes()) {
        targetObject = targetAttributeRefs.evaluateNextAttributes(target.getContext(), targetObject);
      }
     
      Context targetContext = contextFactory.createContext(targetObject, targetAttributeRef);
      data.setAttribute(targetAttributeName, targetContext);
    }
    return null;
  }
View Full Code Here

    }
    return attribute;
  }
 
  private Object getResultFromSpecifiedNamespace() {
    Context context = namespaceRef.getNamespaceContextCreateIfNotExists();
    return context.evaluate(attributeRef);
  }
View Full Code Here

  }
 
  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

      if (!namespaces.namespaceExists(targetNamespace)) {
        throw new InterpretationException(source, indexInSource, "Could not find namespace '" + targetNamespace + "'");
      }
      if (returnedValue instanceof Map) {
        Map returnedMap = (Map)returnedValue;
        Context targetContext = namespaces.getNamespaceContext(targetNamespace);
       
        for (Object key : returnedMap.keySet()) {
          targetContext.set(key.toString(), returnedMap.get(key));
        }
      } else {
        throw new InterpretationException(source, indexInSource, "Returned value must implement the interface 'java.util.Map'");
      }
    } else if (targetVariable != null) {
View Full Code Here

TOP

Related Classes of net.sf.laja.context.Context

Copyright © 2018 www.massapicom. 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.