本文整理汇总了Java中com.intellij.openapi.util.NotNullLazyValue.createValue方法的典型用法代码示例。如果您正苦于以下问题:Java NotNullLazyValue.createValue方法的具体用法?Java NotNullLazyValue.createValue怎么用?Java NotNullLazyValue.createValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.util.NotNullLazyValue
的用法示例。
在下文中一共展示了NotNullLazyValue.createValue方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: LambdaResult
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@RequiredReadAction
public LambdaResult(@NotNull PsiElement scope, @NotNull CSharpMethodDeclaration element, @NotNull DotNetGenericExtractor extractor)
{
super(element, extractor);
myScope = scope;
myParameterInfosValue = NotNullLazyValue.createValue(() ->
{
CSharpSimpleParameterInfo[] parameterInfos = myElement.getParameterInfos();
if(myExtractor == DotNetGenericExtractor.EMPTY)
{
return parameterInfos;
}
CSharpSimpleParameterInfo[] temp = new CSharpSimpleParameterInfo[parameterInfos.length];
for(int i = 0; i < parameterInfos.length; i++)
{
CSharpSimpleParameterInfo parameterInfo = parameterInfos[i];
DotNetTypeRef typeRef = GenericUnwrapTool.exchangeTypeRef(parameterInfo.getTypeRef(), getGenericExtractor(), myScope);
temp[i] = new CSharpSimpleParameterInfo(parameterInfo.getIndex(), parameterInfo.getName(), parameterInfo.getElement(), typeRef);
}
return temp;
});
myElementValue = NotNullLazyValue.createValue(() -> CSharpLambdaResolveResultUtil.createTypeFromDelegate(myElement, myExtractor));
myReturnTypRefValue = NotNullLazyValue.createValue(() -> GenericUnwrapTool.exchangeTypeRef(myElement.getReturnTypeRef(), getGenericExtractor(), scope));
}
示例2: MsilMethodAsCSharpLikeMethodDeclaration
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@RequiredReadAction
public MsilMethodAsCSharpLikeMethodDeclaration(PsiElement parent, @NotNull CSharpModifier[] modifiers, MsilMethodEntry methodEntry)
{
super(parent, methodEntry);
myModifierList = new MsilModifierListToCSharpModifierList(modifiers, this, methodEntry.getModifierList());
myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.getReturnTypeRef(), myOriginal));
myParameterTypeRefsValue = NotNullLazyValue.createValue(() ->
{
DotNetTypeRef[] parameters = myOriginal.getParameterTypeRefs();
DotNetTypeRef[] refs = new DotNetTypeRef[parameters.length];
for(int i = 0; i < parameters.length; i++)
{
refs[i] = MsilToCSharpUtil.extractToCSharp(parameters[i], myOriginal);
}
return refs;
});
}
示例3: CSharpLightTypeDeclaration
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
public CSharpLightTypeDeclaration(CSharpTypeDeclaration original, DotNetGenericExtractor extractor)
{
super(original);
myExtractor = extractor;
myMembersValue = NotNullLazyValue.createValue(() ->
{
DotNetNamedElement[] originalMembers = myOriginal.getMembers();
DotNetNamedElement[] members = new DotNetNamedElement[originalMembers.length];
for(int i = 0; i < originalMembers.length; i++)
{
members[i] = GenericUnwrapTool.extract(originalMembers[i], myExtractor, CSharpLightTypeDeclaration.this);
}
return members;
});
}
示例4: MethodParameterResolveContext
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
public MethodParameterResolveContext(DotNetParameterListOwner parameterListOwner, PsiElement scope, boolean resolveFromParent)
{
myScope = scope;
myResolveFromParent = resolveFromParent;
myParameters = parameterListOwner.getParameters();
myParamsParameter = ArrayUtil.getLastElement(myParameters);
if(myParamsParameter != null && !myParamsParameter.hasModifier(CSharpModifier.PARAMS))
{
myParamsParameter = null;
}
myInnerParamsParameterTypeRefValue = NotNullLazyValue.createValue(() -> myParamsParameter == null ? DotNetTypeRef.ERROR_TYPE : CSharpResolveUtil.resolveIterableType(myScope,
getParamsParameterTypeRef()));
myParamsParameterTypeRefValue = NotNullLazyValue.createValue(() -> myParamsParameter == null ? DotNetTypeRef.ERROR_TYPE : myParamsParameter.toTypeRef(true));
}
示例5: MsilClassAsCSharpTypeDefinition
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@RequiredReadAction
public MsilClassAsCSharpTypeDefinition(@Nullable PsiElement parent, MsilClassEntry classEntry, @NotNull GenericParameterContext genericParameterContext)
{
super(parent, classEntry);
myGenericParameterContext = genericParameterContext;
myModifierList = new MsilModifierListToCSharpModifierList(this, classEntry.getModifierList());
DotNetGenericParameterList genericParameterList = classEntry.getGenericParameterList();
myGenericParameterList = MsilGenericParameterListAsCSharpGenericParameterList.build(this, genericParameterList, genericParameterContext);
myExtendTypeRefsValue = NotNullLazyValue.createValue(() ->
{
String vmQName = getVmQName();
// hack
if(DotNetTypes.System.Object.equals(vmQName))
{
return DotNetTypeRef.EMPTY_ARRAY;
}
DotNetTypeRef[] extendTypeRefs = myOriginal.getExtendTypeRefs();
if(extendTypeRefs.length == 0)
{
return DotNetTypeRef.EMPTY_ARRAY;
}
DotNetTypeRef[] typeRefs = new DotNetTypeRef[extendTypeRefs.length];
for(int i = 0; i < typeRefs.length; i++)
{
typeRefs[i] = MsilToCSharpUtil.extractToCSharp(extendTypeRefs[i], myOriginal);
}
return typeRefs;
});
myTypeRefForEnumConstantsValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.getTypeRefForEnumConstants(), myOriginal));
}
示例6: MsilMethodAsCSharpConversionMethodDeclaration
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
public MsilMethodAsCSharpConversionMethodDeclaration(PsiElement parent, MsilMethodEntry methodEntry)
{
super(parent, methodEntry);
myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.getReturnTypeRef(), myOriginal));
}
示例7: MsilPropertyAsCSharpIndexMethodDeclaration
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@RequiredReadAction
public MsilPropertyAsCSharpIndexMethodDeclaration(PsiElement parent, MsilPropertyEntry propertyEntry, List<Pair<DotNetXXXAccessor, MsilMethodEntry>> pairs)
{
super(parent, propertyEntry);
myAccessors = MsilPropertyAsCSharpPropertyDeclaration.buildAccessors(this, pairs);
myModifierList = new MsilModifierListToCSharpModifierList(MsilPropertyAsCSharpPropertyDeclaration.getAdditionalModifiers(propertyEntry, pairs), this, propertyEntry.getModifierList());
String name = getName();
if(!Comparing.equal(name, DotNetPropertyDeclaration.DEFAULT_INDEX_PROPERTY_NAME))
{
CSharpLightAttributeBuilder attribute = new CSharpLightAttributeBuilder(propertyEntry, DotNetTypes.System.Runtime.CompilerServices.IndexerName);
attribute.addParameterExpression(name);
myModifierList.addAdditionalAttribute(attribute);
}
Pair<DotNetXXXAccessor, MsilMethodEntry> p = pairs.get(0);
DotNetParameter firstParameter = p.getSecond().getParameters()[0];
myParameters = new DotNetParameter[]{new MsilParameterAsCSharpParameter(this, firstParameter, this, 0)};
myTypeForImplementValue = NullableLazyValue.of(() ->
{
String nameFromBytecode = myOriginal.getNameFromBytecode();
String typeBeforeDot = StringUtil.getPackageName(nameFromBytecode);
SomeType someType = SomeTypeParser.parseType(typeBeforeDot, nameFromBytecode);
if(someType != null)
{
return new DummyType(getProject(), MsilPropertyAsCSharpIndexMethodDeclaration.this, someType);
}
return null;
});
myReturnTypeRefValue = NotNullLazyValue.createValue(() -> MsilToCSharpUtil.extractToCSharp(myOriginal.toTypeRef(false), myOriginal));
myParameterTypeRefsValue = NotNullLazyValue.createValue(() ->
{
DotNetParameter[] parameters = getParameters();
DotNetTypeRef[] typeRefs = new DotNetTypeRef[parameters.length];
for(int i = 0; i < parameters.length; i++)
{
DotNetParameter parameter = parameters[i];
typeRefs[i] = parameter.toTypeRef(false);
}
return typeRefs;
});
}
示例8: MsilGenericParameterAsCSharpGenericParameter
import com.intellij.openapi.util.NotNullLazyValue; //导入方法依赖的package包/类
@RequiredReadAction
public MsilGenericParameterAsCSharpGenericParameter(@NotNull PsiElement parent, DotNetGenericParameter msilElement)
{
super(parent, msilElement);
myExtendTypeRefsValue = NotNullLazyValue.createValue(() -> CSharpGenericConstraintUtil.getExtendTypes(this));
}