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


Java NotNull类代码示例

本文整理汇总了Java中org.jetbrains.annotations.NotNull的典型用法代码示例。如果您正苦于以下问题:Java NotNull类的具体用法?Java NotNull怎么用?Java NotNull使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: addRecordTargetVariablesRecursive

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
private static void addRecordTargetVariablesRecursive(@NotNull AppleScriptTargetRecordLiteral targetRecord, 
                                                      @NotNull List<AppleScriptTargetVariable> targetVariables) {

  for (AppleScriptObjectTargetPropertyDeclaration property : targetRecord.getObjectTargetPropertyDeclarationList()) {
    AppleScriptTargetVariable innerVariable = property.getTargetVariable();
    AppleScriptTargetListLiteral innerList = property.getTargetListLiteral();
    AppleScriptTargetRecordLiteral innerRecord = property.getTargetRecordLiteral();
    if (innerVariable != null) {
      targetVariables.add(innerVariable);
    }
    if (innerList != null) {
      targetVariables.addAll(innerList.getTargetVariableList());
    }
    if (innerRecord != null) {
      addRecordTargetVariablesRecursive(innerRecord, targetVariables);
    }
  }
}
 
开发者ID:ant-druha,项目名称:AppleScript-IDEA,代码行数:19,代码来源:AppleScriptPsiImplUtil.java

示例2: copyFile

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
private static void copyFile(@NotNull File source, @NotNull File dir) throws IOException
{
    //noinspection ResultOfMethodCallIgnored
    dir.mkdirs();
    File dest = new File(dir, source.getName());
    if (dest.exists())
    {
        //noinspection ResultOfMethodCallIgnored
        dest.delete();
    }
    //noinspection ResultOfMethodCallIgnored
    dest.createNewFile();
    try (InputStream is = new FileInputStream(source); OutputStream os = new FileOutputStream(dest))
    {
        byte[] buffer = new byte[BUFFER_SIZE];
        int length;
        while ((length = is.read(buffer)) > 0)
        {
            os.write(buffer, 0, length);
        }
    }
}
 
开发者ID:miche-atucha,项目名称:devenv,代码行数:23,代码来源:IO.java

示例3: registerReferenceProviders

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
	// TODO
	registrar.registerReferenceProvider(PlatformPatterns.psiElement(PsiLiteralExpression.class),
		new PsiReferenceProvider() {
			@NotNull
			@Override
			public PsiReference[] getReferencesByElement(@NotNull PsiElement element,
			                                             @NotNull ProcessingContext
				                                             context) {
				PsiLiteralExpression literalExpression = (PsiLiteralExpression) element;
				String value = literalExpression.getValue() instanceof String ?
					(String) literalExpression.getValue() : null;
				if (value != null && value.startsWith("simple" + ":")) {
					return new PsiReference[]{
						new CptReference(element, new TextRange(8, value.length() + 1))};
				}
				return PsiReference.EMPTY_ARRAY;
			}
		});
}
 
开发者ID:xylo,项目名称:intellij-postfix-templates,代码行数:22,代码来源:CptReferenceContributor.java

示例4: visit

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@NotNull
@Override
public Type visit(For node, State s) {
    bindIter(s, node.target, node.iter, SCOPE);
    Type t1 = Types.UNKNOWN;
    Type t2 = Types.UNKNOWN;
    Type t3 = Types.UNKNOWN;

    State s1 = s.copy();
    State s2 = s.copy();

    if (node.body != null) {
        t1 = visit(node.body, s1);
        s.merge(s1);
        t2 = visit(node.body, s1);
        s.merge(s1);
    }

    if (node.orelse != null) {
        t3 = visit(node.orelse, s2);
        s.merge(s2);
    }

    return UnionType.union(UnionType.union(t1, t2), t3);
}
 
开发者ID:lebronzj,项目名称:pysonar2,代码行数:26,代码来源:TypeInferencer.java

示例5: KubeCloudClient

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
public KubeCloudClient(@Nullable String serverUuid,
                       @NotNull String cloudProfileId,
                       @NotNull KubeApiConnector apiConnector,
                       @NotNull List<KubeCloudImage> images,
                       @NotNull KubeCloudClientParametersImpl kubeClientParams,
                       @NotNull BuildAgentPodTemplateProviders podTemplateProviders,
                       @NotNull KubeDataCache cache,
                       @NotNull KubeBackgroundUpdater updater) {
    myServerUuid = serverUuid;
    myCloudProfileId = cloudProfileId;
    myApiConnector = apiConnector;
    myImageIdToImageMap = new ConcurrentHashMap<>(Maps.uniqueIndex(images, CloudImage::getId));
    myKubeClientParams = kubeClientParams;
    myPodTemplateProviders = podTemplateProviders;
    myCache = cache;
    myUpdater = updater;
    myUpdater.registerClient(this);
}
 
开发者ID:JetBrains,项目名称:teamcity-kubernetes-plugin,代码行数:19,代码来源:KubeCloudClient.java

示例6: createItem

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@NotNull
@Override
public TransformationMenuItem createItem(@NotNull TransformationMenuContext context) {
  String description;
  try {
    description = "submenu " + getText(context);
  } catch (Throwable t) {
    return super.createItem(context);
  }
  context.getEditorMenuTrace().pushTraceInfo();
  context.getEditorMenuTrace().setDescriptor(new EditorMenuDescriptorBase(description, new SNodePointer("r:7c1e5bbb-2d18-4cf3-a11d-502be6b13261(jetbrains.mps.samples.VoiceMenu.editor)", "8517997849287913434")));
  try {
    return super.createItem(context);
  } finally {
    context.getEditorMenuTrace().popTraceInfo();
  }
}
 
开发者ID:vaclav,项目名称:voicemenu,代码行数:18,代码来源:WorkSpace_TransformationMenu.java

示例7: getPresentation

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@NotNull
@Override
public ItemPresentation getPresentation() {
    return new ItemPresentation() {
        @Nullable
        @Override
        public String getPresentableText() {
            return presText;
        }

        @Nullable
        @Override
        public String getLocationString() {
            return null;
        }

        @Nullable
        @Override
        public Icon getIcon(boolean b) {
            return PlatformIcons.CLASS_ICON;
        }
    };
}
 
开发者ID:datathings,项目名称:greycat-idea-plugin,代码行数:24,代码来源:GCMStructureViewClassElement.java

示例8: getTargetPlaceholder

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@Override
protected AnswerPlaceholder getTargetPlaceholder(@NotNull final TaskFile taskFile, int offset) {
  final AnswerPlaceholder selectedAnswerPlaceholder = taskFile.getAnswerPlaceholder(offset);
  final List<AnswerPlaceholder> placeholders = taskFile.getActivePlaceholders();
  if (selectedAnswerPlaceholder == null) {
    for (AnswerPlaceholder placeholder : placeholders) {
      if (placeholder.getOffset() > offset) {
        return placeholder;
      }
    }
  }
  else {
    int index = selectedAnswerPlaceholder.getIndex();
    if (StudyUtils.indexIsValid(index, placeholders)) {
      int newIndex = index + 1;
      return placeholders.get(newIndex == placeholders.size() ? 0 : newIndex);
    }
  }
  return null;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:21,代码来源:StudyNextWindowAction.java

示例9: getExpandedRows

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@NotNull
private Set<Integer> getExpandedRows() {
    Set<Integer> expanded = new HashSet<>(tree1.getRowCount());
    for (int i = 0; i < tree1.getRowCount(); i++) {
        if (tree1.isExpanded(i)) {
            expanded.add(i);
        }
    }
    return expanded;
}
 
开发者ID:waarneembemiddeling,项目名称:intellij-circleci-integration,代码行数:11,代码来源:RecentBuildsToolWindowFactory.java

示例10: createContent

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@Override
@FXThread
protected void createContent(@NotNull final VBox root) {

    imageView = new ImageView();

    FXUtils.addToPane(imageView, root);
    FXUtils.addClassTo(root, CSSClasses.IMAGE_VIEW_EDITOR_CONTAINER);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:10,代码来源:ImageViewerEditor.java

示例11: begin

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@Override
public @NotNull Stopwatch begin(@NotNull Stopwatch submittedStopwatch) {
  tasks.queued.dec();
  tasks.used.inc();
  time.delay.observe(submittedStopwatch.stop());
  return submittedStopwatch;
}
 
开发者ID:nolequen,项目名称:vertx-prometheus-metrics,代码行数:8,代码来源:PoolPrometheusMetrics.java

示例12: invokeSpecial0

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@Override
protected <T> T invokeSpecial0(@NotNull SNode node, @NotNull SMethod<T> method, @Nullable Object[] parameters) {
  int methodIndex = BH_METHODS.indexOf(method);
  if (methodIndex < 0) {
    throw new BHMethodNotFoundException(this, method);
  }
  switch (methodIndex) {
    case 0:
      return (T) ((SNode) GeefOvergang_id2hDGrbWPFpO(node));
    default:
      throw new BHMethodNotFoundException(this, method);
  }
}
 
开发者ID:diederikd,项目名称:DeBrug,代码行数:14,代码来源:ZwakkeAanspraakZwakkePlicht__BehaviorDescriptor.java

示例13: getPrevNonWhitespaceElement

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@Nullable
@Contract(pure = true)
public static PsiElement getPrevNonWhitespaceElement(@NotNull final PsiElement element) {
    Validate.notNull(element);

    PsiElement prevSibling = element.getPrevSibling();

    while (null != prevSibling && (isWhiteSpace(prevSibling) || isLineBreak(prevSibling))) {
        prevSibling = prevSibling.getPrevSibling();
    }

    return prevSibling;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:14,代码来源:ImpexPsiUtils.java

示例14: collectPluginOptionKeys

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
@NotNull
private static Set<String> collectPluginOptionKeys() {
    Set<String> result = new HashSet<>();
    for (Field field : TrauteConstants.class.getFields()) {
        int modifiers = field.getModifiers();
        if ((modifiers & PUBLIC) == 0 || (modifiers & STATIC) == 0 || (modifiers & FINAL) == 0
            || field.getType() != String.class)
        {
            continue;
        }
        try {
            String value = field.get(null).toString();
            if (!value.contains("traute")) {
                continue;
            }
            if (field.getName().contains("PREFIX")) {
                for (InstrumentationType type : InstrumentationType.values()) {
                    result.add(value + type.getShortName());
                }
            } else {
                result.add(value);
            }
        } catch (IllegalAccessException e) {
            throw new RuntimeException(String.format(
                    "Unexpected exception on attempt to collect plugin option keys for %s.%s",
                    TrauteConstants.class.getName(), field.getName()
            ), e);
        }
    }
    return result;
}
 
开发者ID:denis-zhdanov,项目名称:traute,代码行数:32,代码来源:TrauteJavacPlugin.java

示例15: printInstrumentationResults

import org.jetbrains.annotations.NotNull; //导入依赖的package包/类
private void printInstrumentationResults(@NotNull JavaFileObject file,
                                         @NotNull StatsCollector statsCollector,
                                         @NotNull TrautePluginLogger logger)
{

    ConcurrentMap<InstrumentationType, Long> stats = statsCollector.getStats();
    long totalInstrumentationsNumber = stats.entrySet()
                                            .stream()
                                            .mapToLong(Map.Entry::getValue)
                                            .sum();
    if (totalInstrumentationsNumber <= 0) {
        return;
    }
    StringBuilder details = new StringBuilder();
    for (InstrumentationType type : InstrumentationType.values()) {
        Long count = stats.get(type);
        if (count != null) {
            details.append(type).append(": ").append(count).append(", ");
        }
    }
    details.setLength(details.length() - 2);

    String fileName = file.toUri().getSchemeSpecificPart();
    while (fileName.startsWith("//")) {
        fileName = fileName.substring(1);
    }
    logger.info(String.format(
            "added %d instrumentation%s to the class %s - %s",
            totalInstrumentationsNumber, totalInstrumentationsNumber > 1 ? "s" : "", fileName, details)
    );
}
 
开发者ID:denis-zhdanov,项目名称:traute,代码行数:32,代码来源:TrauteJavacPlugin.java


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