当前位置: 首页>>代码示例>>Java>>正文


Java Config.getString方法代码示例

本文整理汇总了Java中gov.nasa.jpf.Config.getString方法的典型用法代码示例。如果您正苦于以下问题:Java Config.getString方法的具体用法?Java Config.getString怎么用?Java Config.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nasa.jpf.Config的用法示例。


在下文中一共展示了Config.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initialize

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
/**
 * initialize object from config file
 * 
 * @param conf 
 */
private void initialize(Config conf) {
  // create a constraint solver
  ConstraintSolverFactory cFactory = new ConstraintSolverFactory(conf);
  this.solver = cFactory.createSolver(conf);
  
  // parse symbolic method info
  if(conf.hasValue(CONF_PREFIX + ".method")) {
    String id = conf.getString(CONF_PREFIX + ".method");
    ConcolicMethodConfig mc = ConcolicMethodConfig.read(id, CONF_PREFIX + ".method." + id, conf);
    registerConcolicMethod(mc);
  }
  
  // parse termination
  this.termination = parseTerminationStrategy(conf);
}
 
开发者ID:psycopaths,项目名称:jdart,代码行数:21,代码来源:ConcolicConfig.java

示例2: createFieldChecks

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
private void createFieldChecks(Config conf){
  String[] checkIds = conf.getCompactTrimmedStringArray("range.fields");
  if (checkIds.length > 0){
    fieldChecks = new FieldCheck[checkIds.length];

    for (int i = 0; i < checkIds.length; i++) {
      String id = checkIds[i];
      FieldCheck check = null;
      String keyPrefix = "range." + id;
      String spec = conf.getString(keyPrefix + ".field");
      if (spec != null) {
        FieldSpec fs = FieldSpec.createFieldSpec(spec);
        if (fs != null) {
          double min = conf.getDouble(keyPrefix + ".min", Double.MIN_VALUE);
          double max = conf.getDouble(keyPrefix + ".max", Double.MAX_VALUE);
          check = new FieldCheck(fs, min, max);
        }
      }
      if (check == null) {
        throw new JPFConfigException("illegal field range check specification for " + id);
      }
      fieldChecks[i] = check;
    }
  }
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:26,代码来源:NumericValueChecker.java

示例3: IdleFilter

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public IdleFilter(Config config) {
  maxBackJumps = config.getInt("idle.max_backjumps", 500);

  String act = config.getString("idle.action", "break");
  if ("warn".equalsIgnoreCase(act)){
    action = Action.WARN;
  } else if ("break".equalsIgnoreCase(act)){
    action = Action.BREAK;
  } else if ("yield".equalsIgnoreCase(act)){
    action = Action.YIELD;
  } else if ("prune".equalsIgnoreCase(act)){
    action = Action.PRUNE;
  } else if ("jump".equalsIgnoreCase(act)){
    action = Action.JUMP;
  } else {
    throw new JPFConfigException("unknown IdleFilter action: " +act);
  }

}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:20,代码来源:IdleFilter.java

示例4: addToParamsWatchList

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
protected void addToParamsWatchList (Config conf, String id){
  String keyPrefix = "perturb." + id;

  String ms = conf.getString(keyPrefix + ".method");
  if (ms != null) {
    MethodSpec mthSpec = MethodSpec.createMethodSpec(ms);
    if (mthSpec != null) {
      Object[] args = {conf, keyPrefix};
      OperandPerturbator perturbator = conf.getInstance(keyPrefix + ".class", OperandPerturbator.class, argTypes, args);        
      if (perturbator != null) {
        String loc = conf.getString(keyPrefix + ".location");
        ParamsPerturbation p = new ParamsPerturbation(mthSpec, perturbator, loc);
        paramsWatchList.add(p);
      } else {
        log.warning("invalid perturbator spec for ", keyPrefix);
      }

    } else {
      log.warning("malformed method specification for ", keyPrefix);
    }
  } else {
    log.warning("missing method specification for ", keyPrefix);
  }
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:25,代码来源:Perturbator.java

示例5: ChoiceTracker

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public ChoiceTracker (Config config, JPF jpf) {
  this.config = config;
  vm = jpf.getVM();
  search = jpf.getSearch();
  
  String fname = config.getString("choice.trace");
  if (fname == null) {
    isReportExtension = true;
    jpf.addPublisherExtension(ConsolePublisher.class, this);
    // pw is going to be set later
  } else {
    try {
      pw = new PrintWriter(fname);
    } catch (FileNotFoundException fnfx) {
      System.err.println("cannot write choice trace to file: " + fname);
      pw = new PrintWriter(System.out);
    }
  }
  
  excludes = config.getStringArray("choice.exclude");
  cgClasses = config.getClasses("choice.class");

  format = config.getEnum("choice.format", Format.values(), Format.CG);
  showLocation = config.getBoolean("choice.show_location", true);
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:26,代码来源:ChoiceTracker.java

示例6: TraceStorer

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public TraceStorer (Config config, JPF jpf){
  
  traceFileName = config.getString("trace.file", "trace");
  storeMultiple = config.getBoolean("trace.multiple", false);    
  storeDepth = config.getInt("trace.depth", Integer.MAX_VALUE);
  verbose = config.getBoolean("trace.verbose", false);
  
  terminateOnStore = config.getBoolean("trace.terminate", false);
  storeOnConstraintHit = config.getBoolean("trace.store_constraint", false);
  
  storeCalls = StringSetMatcher.getNonEmpty(config.getStringArray("trace.store_calls"));
  storeThreads = StringSetMatcher.getNonEmpty(config.getStringArray("trace.store_threads"));
  
  vm = jpf.getVM();
  search = jpf.getSearch();
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:17,代码来源:TraceStorer.java

示例7: addToReturnWatchList

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
protected void addToReturnWatchList (Config conf, String id){
  String keyPrefix = "perturb." + id;

  String ms = conf.getString(keyPrefix + ".method");
  if (ms != null) {
    MethodSpec mthSpec = MethodSpec.createMethodSpec(ms);
    if (mthSpec != null) {
      Object[] args = {conf, keyPrefix};
      OperandPerturbator perturbator = conf.getInstance(keyPrefix + ".class", OperandPerturbator.class, argTypes, args);
      if (perturbator != null) {
        String loc = conf.getString(keyPrefix + ".location");
        ReturnPerturbation p = new ReturnPerturbation(mthSpec, perturbator, loc);
        returnWatchList.add(p);
      } else {
        log.warning("invalid perturbator spec for ", keyPrefix);
      }

    } else {
      log.warning("malformed method specification for ", keyPrefix);
    }

  } else {
    log.warning("missing method specification for ", keyPrefix);
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:26,代码来源:Perturbator.java

示例8: initialize

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
void initialize (VM vm){
  Config config = vm.getConfig();
  
  app = vm.getSUTName();
  app = app.replace("+", "__");
  app = app.replace('.', '_');

  String fname = config.getString("dot.file");
  if (fname == null){
    fname = app + ".dot";
  }

  try {
    file = new File(fname);
    FileWriter fw = new FileWriter(file);
    pw = new PrintWriter(fw);
  } catch (IOException iox){
    throw new JPFConfigException("unable to open SimpleDot output file: " + fname);
  }
  
  seenEdges = new HashSet<Long>();
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:23,代码来源:SimpleDot.java

示例9: ResultsPublisher

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public ResultsPublisher(Config conf, Reporter reporter) {
  super(conf, reporter);
  this.conf = conf;
  this.cfgInputSize = conf.getInt(CFG_INPUT_SIZE_CONF, -1);
  String resultsFile = conf.getString("target") + ".csv";

  this.generateSMTLibFormat = conf.getBoolean(SMTLIB_CONF, false);
  this.generateOmegaFormat = conf.getBoolean(OMEGA_CONF, false);
  baseDir = getResultsDir(conf);
  
  file = new File(baseDir, resultsFile);
}
 
开发者ID:isstac,项目名称:spf-wca,代码行数:13,代码来源:ResultsPublisher.java

示例10: getSerializedInputDir

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
private String getSerializedInputDir(Config jpfConfig) {
  String policyInputPath = jpfConfig.getString(SER_INPUT_PATH);
  if(policyInputPath == null)
    policyInputPath = jpfConfig.getString(PolicyGeneratorListener.SER_OUTPUT_PATH_CONF, 
        PolicyGeneratorListener.SER_OUTPUT_PATH_DEF);
  return policyInputPath;
}
 
开发者ID:isstac,项目名称:spf-wca,代码行数:8,代码来源:HeuristicListener.java

示例11: DebugJenkinsStateSet

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public DebugJenkinsStateSet (Config conf){
  String serializerCls = conf.getString("vm.serializer.class");
  if (serializerCls != null){
    int idx = serializerCls.lastIndexOf('.') + 1;
    String cname = serializerCls.substring(idx);
    
    if (!cname.startsWith("Debug")){
      if (idx > 0){
        serializerCls = serializerCls.substring(0,idx) + "Debug" + cname;
      } else {
        serializerCls = "Debug" + cname;
      }
    }
    
    serializer = conf.getInstance(null, serializerCls, DebugStateSerializer.class);
    if (serializer == null){
      throw new JPFConfigException("Debug StateSet cannot instantiate serializer: " + serializerCls);
    }
  }
  
  String path = conf.getString("vm.serializer.output", "tmp");
  outputDir = new File(path);
  if (!outputDir.isDirectory()){
    if (!outputDir.mkdirs()){
      throw new JPFConfigException("Debug StateSet cannot create output dir: " + outputDir.getAbsolutePath());        
    }
  }
  
  outputFile = new File( outputDir, LOGFILE);
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:31,代码来源:DebugJenkinsStateSet.java

示例12: ConsolePublisher

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public ConsolePublisher(Config conf, Reporter reporter) {
  super(conf, reporter);

  // options controlling the output destination
  fileName = conf.getString("report.console.file");
  port = conf.getString("report.console.port");

  // options controlling what info should be included in a trace
  showCG = conf.getBoolean("report.console.show_cg", true);
  showSteps = conf.getBoolean("report.console.show_steps", true);
  showLocation = conf.getBoolean("report.console.show_location", true);
  showSource = conf.getBoolean("report.console.show_source", true);
  showMethod = conf.getBoolean("report.console.show_method", false);
  showCode = conf.getBoolean("report.console.show_code", false);
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:16,代码来源:ConsolePublisher.java

示例13: getPlatformEndianness

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
protected boolean getPlatformEndianness (Config config){
  String endianness = config.getString("vm.endian");
  if (endianness == null) {
    return ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN;
  } else if (endianness.equalsIgnoreCase("big")) {
    return true;
  } else if (endianness.equalsIgnoreCase("little")) {
    return false;
  } else {
    config.exception("illegal vm.endian value: " + endianness);
    return false; // doesn't matter
  }
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:14,代码来源:VM.java

示例14: JPF_gov_nasa_jpf_CachedROHttpConnection

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public JPF_gov_nasa_jpf_CachedROHttpConnection (Config conf){
  String cacheDirPath = conf.getString("http.cache_dir");
  if (cacheDirPath != null){
    cacheDir = new File(cacheDirPath);

    if (!cacheDir.exists()){
      cacheDir.mkdir();
    }
    if (!cacheDir.isDirectory()){
      throw new JPFConfigException("illegal http.cache_dir entry: " + cacheDirPath);
    }
  }

  dataCache = new HashMap<String,byte[]>();
}
 
开发者ID:grzesuav,项目名称:gjpf-core,代码行数:16,代码来源:JPF_gov_nasa_jpf_CachedROHttpConnection.java

示例15: MethodAnalyzer

import gov.nasa.jpf.Config; //导入方法依赖的package包/类
public MethodAnalyzer (Config config, JPF jpf){
  jpf.addPublisherExtension(ConsolePublisher.class, this);
  
  maxHistory = config.getInt("method.max_history", Integer.MAX_VALUE);
  format = config.getString("method.format", "raw");
  skipInit = config.getBoolean("method.skip_init", true);
  showDepth = config.getBoolean("method.show_depth", false);
  showTransition = config.getBoolean("method.show_transition", false);
  
  includes = StringSetMatcher.getNonEmpty(config.getStringArray("method.include"));
  excludes = StringSetMatcher.getNonEmpty(config.getStringArray("method.exclude"));
  
  vm = jpf.getVM();
  search = jpf.getSearch();
}
 
开发者ID:grzesuav,项目名称:jpf-core,代码行数:16,代码来源:MethodAnalyzer.java


注:本文中的gov.nasa.jpf.Config.getString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。