org.tinygroup.context.Context.get()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(154)

本文整理了Java中org.tinygroup.context.Context.get()方法的一些代码示例,展示了Context.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.get()方法的具体详情如下:
包路径:org.tinygroup.context.Context
类名称:Context
方法名:get

Context.get介绍

[英]从指定子环境获取变量
[中]从指定子环境获取变量

代码示例

代码示例来源:origin: org.tinygroup/context

public <T> T get(String contextName, String name) {
  Context subContext = subContextMap.get(contextName);
  if (subContext != null) {
    return (T) subContext.get(name);
  }
  return null;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.templateengine

/**
 * 从上下文获取对应标识的值
 *
 * @param context
 * @param key
 * @return
 */
public static Object getValueFromContext(Context context, Object key) {
  return context.get(key.toString());
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context

public <T> T getInSubContext(String contextName, String name) {
  Context subContext = subContextMap.get(contextName);
  if (subContext != null) {
    return (T) subContext.get(name);
  }
  return null;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.ientity

public String checkCompareMode(String defaultCompareMode,
    String propertyName) {
  String compareMode = context.get(getSpliceParamterName(propertyName,
      COMPARE_MODE));
  if (compareMode == null) {
    compareMode = defaultCompareMode;
  }
  return compareMode;
}

代码示例来源:origin: org.tinygroup/ientity

public String checkHavingCompareMode(String defaultCompareMode,
    String propertyName) {
  String compareMode = context.get(getSpliceParamterName(propertyName,
      HAVING_COMPARE_MODE));
  if (compareMode == null) {
    compareMode = defaultCompareMode;
  }
  return compareMode;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.ientity

public String checkHavingCompareMode(String defaultCompareMode,
    String propertyName) {
  String compareMode = context.get(getSpliceParamterName(propertyName,
      HAVING_COMPARE_MODE));
  if (compareMode == null) {
    compareMode = defaultCompareMode;
  }
  return compareMode;
}

代码示例来源:origin: org.tinygroup/ientity

protected Context buildParameter(EntityModel model,
    ModelRequestInfo modelRequestInfo, Context context) {
   Context newContext=super.buildParameter(model, modelRequestInfo, context);
   newContext.put(PAGE_SIZE, context.get(PAGE_SIZE));
   newContext.put(PAGE_NUMBER, context.get(PAGE_NUMBER));
   newContext.put(ORDER_BY_FIELD, context.get(ORDER_BY_FIELD));
   newContext.put(SORT_DIRECTION, context.get(SORT_DIRECTION));
   newContext.put(GROUP_BY_FIELD, context.get(GROUP_BY_FIELD));
   return newContext;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.pageflowbasiccomponent

public void execute(Context context) {
  WebContext webContext = (WebContext) context;
  try {
    webContext.getResponse().getWriter().write(objectToXml.convert(context.get(resultKey)));
  } catch (IOException e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.tinygroup/org.tinygroup.pageflowbasiccomponent

public void execute(Context context) {
  WebContext webContext = (WebContext) context;
  try {
    webContext.getResponse().getWriter().write(objectToJson.convert(context.get(resultKey)));
  } catch (Exception e) {
    throw new RuntimeException(e);
  }
}

代码示例来源:origin: org.tinygroup/org.tinygroup.imda

public boolean validateField(ValidateRule validateRule, String fieldName,
    Context context) {
  String value = context.get(fieldName);
  ValidateExecutor validateExecutor = validateExecutorMap
      .get(validateRule.getRuleName());
  if (validateExecutor != null) {// 如果找不到对应的校验器,则忽略之
    if (!validateExecutor.isValidate(validateRule, value, context)) {
      return false;
    }
  }
  return true;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.ientity

public void assembleParamterValue(String name, Context context, List<Object> params) {
  Assert.assertNotNull(params, "params must not null");
  Object value=context.get(name);
  if (value != null && value.getClass().isArray()) {
    formatValueArray((Object[]) value, params);
  } else {
    Object formatValue = formaterValue(value,name,context);
    if (formatValue != null) {
      params.add(formatValue);
    }
  }
}

代码示例来源:origin: org.tinygroup/tinydb

public static Bean context2Bean(Context c, String beanType,
      List<String> properties,String schame) {
    Bean bean = getBeanInstance(beanType,schame);
    for (String property : properties) {
      bean.put(property, c.get(property));
    }
    return bean;
  }
}

代码示例来源:origin: org.tinygroup/org.tinygroup.tinyscriptbase

public <T> T get(String name) {
  T result = super.get(name);
  if (result != null) {
    return (T) result;
  }
  Context parentContext = getParent();
  if (parentContext != null) {
    return parentContext.get(name);
  }
  return null;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.templateengine

public <T> T get(String name) {
  T result = super.get(name);
  if (result != null) {
    return result;
  }
  Context parentContext = getParent();
  if (parentContext != null) {
    return (T) parentContext.get(name);
  }
  return null;
}

代码示例来源:origin: org.tinygroup/org.tinygroup.i18n

public Locale getContextLocale(Context context) {
  Locale locale = context.get("contextLocale");
  if (locale == null) {
    locale = LocaleUtil.getContext().getLocale();
  }
  return locale;
}

代码示例来源:origin: org.tinygroup/context2object

public static Object getObject(Parameter p, Context context) {
  Object o = context.get(p.getName());
  if (o != null) {
    return o;
  }
  return getObjectByGenerator(p, context);
}

代码示例来源:origin: org.tinygroup/flowbasiccomponent

public void execute(Context context) {
  Assert.assertNotNull(contextKey, "contextKey must not null");
  Assert.assertNotNull(sessionKey, "sessionKey must not null");
  Object object=context.get(contextKey);
  if(!ObjectUtil.isEmptyObject(object)){
    WebContext webContext=(WebContext)context;
    logger.logMessage(LogLevel.INFO, "put object:[{}] to session,the key is [{}]",object,sessionKey);
    webContext.getRequest().getSession(true).setAttribute(sessionKey, object);
  }else{
    logger.logMessage(LogLevel.WARN, "not found object with key:[{}] from context",contextKey);
  }
  
  
}

代码示例来源:origin: org.tinygroup/org.tinygroup.context2object

public static Object getObject(Parameter p, Context context,
                ClassLoader loader) {
  if (context.exist(p.getName()))
    return context.get(p.getName());
  return getObjectByGenerator(p, context, loader);
}

代码示例来源:origin: org.tinygroup/org.tinygroup.servicewrapper

private <T> T callServiceAndCallBack(String serviceId, Context context)
    throws Exception {
  Event event = getEvent(serviceId, context);
  core.process(event);
  ServiceInfo info = core.getServiceInfo(serviceId);
  List<Parameter> resultsParam = info.getResults();
  if (resultsParam == null || resultsParam.size() == 0) {
    return null;
  }
  return event.getServiceRequest().getContext()
      .get(resultsParam.get(0).getName());
}

代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl

public void dealScUnregNodeToNode(Event event, ChannelHandlerContext ctx) {
  logger.logMessage(LogLevel.INFO, "开始处理服务中心发来的其它节点注销请求");
  Context c = event.getServiceRequest().getContext();
  Node remoteNode = c.get(NODE_KEY);
  logger.logMessage(LogLevel.INFO, "开始注销节点:{}", remoteNode.toString());
  RemoteEventProcessorConatiner.remove(remoteNode.toString(), getCore());
  logger.logMessage(LogLevel.INFO, "注销节点:{}完成", remoteNode.toString());
  logger.logMessage(LogLevel.INFO, "处理服务中心发来的其它节点注销请求完成");
}

相关文章