Package org.jetbrains.lang.manifest.psi

Examples of org.jetbrains.lang.manifest.psi.HeaderValue


  private BundleVersionParser() { }

  @Override
  public boolean annotate(@NotNull Header header, @NotNull AnnotationHolder holder) {
    HeaderValue value = header.getHeaderValue();
    if (value instanceof HeaderValuePart) {
      try {
        new Version(value.getUnwrappedText());
      }
      catch (IllegalArgumentException e) {
        holder.createErrorAnnotation(OsgiPsiUtil.trimRange(value).shiftRight(value.getTextOffset()), e.getMessage());
        return true;
      }
    }

    return false;
View Full Code Here


  }

  @Nullable
  @Override
  public Object getConvertedValue(@NotNull Header header) {
    HeaderValue value = header.getHeaderValue();
    if (value instanceof HeaderValuePart) {
      try {
        return new Version(value.getUnwrappedText());
      }
      catch (IllegalArgumentException ignored) { }
    }

    return null;
View Full Code Here

  }

  public static void appendToHeader(@NotNull ManifestFile manifestFile, @NotNull String headerName, @NotNull String headerValue) {
    Header header = manifestFile.getHeader(headerName);
    if (header != null) {
      HeaderValue oldValue = header.getHeaderValue();
      if (oldValue != null) {
        String oldText = trimTrailing(header.getText().substring(oldValue.getStartOffsetInParent(), header.getTextLength()));
        if (!oldText.isEmpty()) oldText += ",\n ";
        headerValue = oldText + headerValue;
      }
      header.replace(createHeader(manifestFile.getProject(), headerName, headerValue));
    }
View Full Code Here

TOP

Related Classes of org.jetbrains.lang.manifest.psi.HeaderValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.