本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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);
}
}