Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright 2012 Yannick Roffin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jbehaviour.reflexion.impl;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.jbehaviour.IBehaviourLauncher;
import org.jbehaviour.annotation.EnvReference;
import org.jbehaviour.exception.JBehaviourParsingError;
import org.jbehaviour.exception.JBehaviourRuntimeError;
import org.jbehaviour.parser.JBehaviourCallParser;
import org.jbehaviour.parser.model.IKeywordStatement.statement;
import org.jbehaviour.parser.template.IKeywordCall;
import org.jbehaviour.reflexion.IBehaviourEnv;
import org.jbehaviour.reflexion.IBehaviourReflexion;
import org.jbehaviour.reflexion.IBehaviourReflexionContext;
import org.jbehaviour.xref.IBehaviourXRef;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
public class JBehaviourEnv implements IBehaviourEnv {
Logger logger = LoggerFactory.getLogger(JBehaviourEnv.class);
private Map registry = new HashMap();
private Map declare = new HashMap();
private VelocityContext context = null;
private Writer writer = new StringWriter();
private IBehaviourXRef xref;
private IBehaviourReflexion ref;
private IBehaviourLauncher launcher;
public JBehaviourEnv(IBehaviourLauncher _launcher, IBehaviourReflexion _registry, IBehaviourXRef _xref) {
Velocity.init();
context = new VelocityContext();
xref = _xref;
ref = _registry;
ref.setEnv(this);
launcher = _launcher;
}
@Override
public List getProperties() {
List properties = new ArrayList();
for(Entry