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


Java NotNullLazyValue.getValue方法代码示例

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


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

示例1: getInitialElements

import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
private static PsiMethodMember[] getInitialElements(PsiMethodMember[] allElements,
                                                    PsiMethodMember[] onlyPrimaryElements,
                                                    NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
                                                    boolean merge,
                                                    boolean toImplement,
                                                    boolean sortByOverriding) {
  final boolean showElementsWithPercents = sortByOverriding && !toImplement;
  final PsiMethodMember[] defaultElements = toImplement || merge ? allElements : onlyPrimaryElements;
  return showElementsWithPercents ? lazyElementsWithPercent.getValue() : defaultElements;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:JavaOverrideImplementMemberChooser.java

示例2: getCompletionDataByFileType

import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@Nullable
public static CompletionData getCompletionDataByFileType(FileType fileType) {
  for(CompletionDataEP ep: Extensions.getExtensions(CompletionDataEP.EP_NAME)) {
    if (ep.fileType.equals(fileType.getName())) {
      return ep.getHandler();
    }
  }
  final NotNullLazyValue<CompletionData> lazyValue = ourCustomCompletionDatas.get(fileType);
  return lazyValue == null ? null : lazyValue.getValue();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:CompletionUtil.java

示例3: getInitialElements

import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
private static PsiMethodMember[] getInitialElements(PsiMethodMember[] allElements,
		PsiMethodMember[] onlyPrimaryElements,
		NotNullLazyValue<PsiMethodWithOverridingPercentMember[]> lazyElementsWithPercent,
		boolean merge,
		boolean toImplement,
		boolean sortByOverriding)
{
	final boolean showElementsWithPercents = sortByOverriding && !toImplement;
	final PsiMethodMember[] defaultElements = toImplement || merge ? allElements : onlyPrimaryElements;
	return showElementsWithPercents ? lazyElementsWithPercent.getValue() : defaultElements;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:JavaOverrideImplementMemberChooser.java

示例4: messageReceived

import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@Override
public void messageReceived(@NotNull Client client, @NotNull CharSequence message, boolean isBinary) throws IOException {
  if (LOG.isDebugEnabled()) {
    LOG.debug("IN " + message);
  }

  JsonReaderEx reader = new JsonReaderEx(message);
  if (!isBinary) {
    reader.beginArray();
  }

  int messageId = reader.peek() == JsonToken.NUMBER ? reader.nextInt() : -1;
  String domainName = reader.nextString();
  if (domainName.length() == 1) {
    AsyncPromise<Object> promise = client.messageCallbackMap.remove(messageId);
    if (domainName.charAt(0) == 'r') {
      if (promise == null) {
        LOG.error("Response with id " + messageId + " was already processed");
        return;
      }
      promise.setResult(JsonUtil.nextAny(reader));
    }
    else {
      promise.setError("error");
    }
    return;
  }

  NotNullLazyValue domainHolder = domains.get(domainName);
  if (domainHolder == null) {
    LOG.error("Cannot find domain " + domainName);
    return;
  }

  Object domain = domainHolder.getValue();
  String command = reader.nextString();
  if (domain instanceof JsonServiceInvocator) {
    ((JsonServiceInvocator)domain).invoke(command, client, reader, messageId);
    return;
  }

  Object[] parameters;
  if (reader.hasNext()) {
    List<Object> list = new SmartList<Object>();
    JsonUtil.readListBody(reader, list);
    parameters = ArrayUtil.toObjectArray(list);
  }
  else {
    parameters = ArrayUtilRt.EMPTY_OBJECT_ARRAY;
  }

  if (!isBinary) {
    reader.endArray();
  }

  try {
    boolean isStatic = domain instanceof Class;
    Method[] methods;
    if (isStatic) {
      methods = ((Class)domain).getDeclaredMethods();
    }
    else {
      methods = domain.getClass().getMethods();
    }
    for (Method method : methods) {
      if (method.getName().equals(command)) {
        method.setAccessible(true);
        Object result = method.invoke(isStatic ? null : domain, parameters);
        if (messageId != -1) {
          client.send(encodeMessage(client.getByteBufAllocator(), messageId, null, null, null, new Object[]{result}));
        }
        return;
      }
    }

    throw new NoSuchMethodException(command);
  }
  catch (Throwable e) {
    throw new IOException(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:82,代码来源:JsonRpcServer.java


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