org.eclipse.jdt.internal.core.util.Util.getProblemArgumentsFromMarker()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(12.7k)|赞(0)|评价(0)|浏览(176)

本文整理了Java中org.eclipse.jdt.internal.core.util.Util.getProblemArgumentsFromMarker()方法的一些代码示例,展示了Util.getProblemArgumentsFromMarker()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getProblemArgumentsFromMarker()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.core.util.Util
类名称:Util
方法名:getProblemArgumentsFromMarker

Util.getProblemArgumentsFromMarker介绍

[英]Separate all the arguments of a String made by getProblemArgumentsForMarker
[中]

代码示例

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

  1. /**
  2. * Helper method for decoding problem marker attributes. Returns an array of String arguments
  3. * extracted from the problem marker "arguments" attribute, or <code>null</code> if the marker
  4. * "arguments" attribute is missing or ill-formed.
  5. *
  6. * @param problemMarker
  7. * the problem marker to decode arguments from.
  8. * @return an array of String arguments, or <code>null</code> if unable to extract arguments
  9. * @since 2.1
  10. */
  11. public static String[] getProblemArguments(IMarker problemMarker){
  12. String argumentsString = problemMarker.getAttribute(IJavaModelMarker.ARGUMENTS, null);
  13. return Util.getProblemArgumentsFromMarker(argumentsString);
  14. }

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

  1. /**
  2. * Helper method for decoding problem marker attributes. Returns an array of String arguments
  3. * extracted from the problem marker "arguments" attribute, or <code>null</code> if the marker
  4. * "arguments" attribute is missing or ill-formed.
  5. *
  6. * @param problemMarker
  7. * the problem marker to decode arguments from.
  8. * @return an array of String arguments, or <code>null</code> if unable to extract arguments
  9. * @since 2.1
  10. */
  11. public static String[] getProblemArguments(IMarker problemMarker){
  12. String argumentsString = problemMarker.getAttribute(IJavaModelMarker.ARGUMENTS, null);
  13. return Util.getProblemArgumentsFromMarker(argumentsString);
  14. }

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

  1. /**
  2. * Helper method for decoding problem marker attributes. Returns an array of String arguments
  3. * extracted from the problem marker "arguments" attribute, or <code>null</code> if the marker
  4. * "arguments" attribute is missing or ill-formed.
  5. *
  6. * @param problemMarker
  7. * the problem marker to decode arguments from.
  8. * @return an array of String arguments, or <code>null</code> if unable to extract arguments
  9. * @since 2.1
  10. */
  11. public static String[] getProblemArguments(IMarker problemMarker){
  12. String argumentsString = problemMarker.getAttribute(IJavaModelMarker.ARGUMENTS, null);
  13. return Util.getProblemArgumentsFromMarker(argumentsString);
  14. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

  1. /**
  2. * Helper method for decoding problem marker attributes. Returns an array of String arguments
  3. * extracted from the problem marker "arguments" attribute, or <code>null</code> if the marker
  4. * "arguments" attribute is missing or ill-formed.
  5. *
  6. * @param problemMarker
  7. * the problem marker to decode arguments from.
  8. * @return an array of String arguments, or <code>null</code> if unable to extract arguments
  9. * @since 2.1
  10. */
  11. public static String[] getProblemArguments(IMarker problemMarker){
  12. String argumentsString = problemMarker.getAttribute(IJavaModelMarker.ARGUMENTS, null);
  13. return Util.getProblemArgumentsFromMarker(argumentsString);
  14. }

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

  1. /**
  2. * Helper method for decoding problem marker attributes. Returns an array of String arguments
  3. * extracted from the problem marker "arguments" attribute, or <code>null</code> if the marker
  4. * "arguments" attribute is missing or ill-formed.
  5. *
  6. * @param problemMarker
  7. * the problem marker to decode arguments from.
  8. * @return an array of String arguments, or <code>null</code> if unable to extract arguments
  9. * @since 2.1
  10. */
  11. public static String[] getProblemArguments(IMarker problemMarker){
  12. String argumentsString = problemMarker.getAttribute(IJavaModelMarker.ARGUMENTS, null);
  13. return Util.getProblemArgumentsFromMarker(argumentsString);
  14. }

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

  1. /**
  2. * Helper method for decoding problem marker attributes. Returns an array of String arguments
  3. * extracted from the problem marker "arguments" attribute, or <code>null</code> if the marker
  4. * "arguments" attribute is missing or ill-formed.
  5. *
  6. * @param problemMarker
  7. * the problem marker to decode arguments from.
  8. * @return an array of String arguments, or <code>null</code> if unable to extract arguments
  9. * @since 2.1
  10. */
  11. public static String[] getProblemArguments(IMarker problemMarker){
  12. String argumentsString = problemMarker.getAttribute(IJavaModelMarker.ARGUMENTS, null);
  13. return Util.getProblemArgumentsFromMarker(argumentsString);
  14. }

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

  1. /**
  2. * Performs code correction for the given marker,
  3. * reporting results to the given correction requestor.
  4. *
  5. * Correction results are answered through a requestor.
  6. *
  7. * @param marker
  8. * the marker which describe the problem to correct.
  9. * @param targetUnit
  10. * replace the compilation unit given by the marker. Ignored if null.
  11. * @param positionOffset
  12. * the offset of position given by the marker.
  13. * @param requestor
  14. * the given correction requestor
  15. * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
  16. * @exception JavaModelException currently this exception is never thrown, but the opportunity to thrown an exception
  17. * when the correction failed is kept for later.
  18. * @since 2.0
  19. */
  20. public void computeCorrections(IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaModelException {
  21. IJavaElement element = targetUnit == null ? JavaCore.create(marker.getResource()) : targetUnit;
  22. if(!(element instanceof ICompilationUnit))
  23. return;
  24. ICompilationUnit unit = (ICompilationUnit) element;
  25. int id = marker.getAttribute(IJavaModelMarker.ID, -1);
  26. String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaModelMarker.ARGUMENTS, "")); //$NON-NLS-1$
  27. int start = marker.getAttribute(IMarker.CHAR_START, -1);
  28. int end = marker.getAttribute(IMarker.CHAR_END, -1);
  29. computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor);
  30. }

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

  1. /**
  2. * Performs code correction for the given marker,
  3. * reporting results to the given correction requestor.
  4. *
  5. * Correction results are answered through a requestor.
  6. *
  7. * @param marker
  8. * the marker which describe the problem to correct.
  9. * @param targetUnit
  10. * replace the compilation unit given by the marker. Ignored if null.
  11. * @param positionOffset
  12. * the offset of position given by the marker.
  13. * @param requestor
  14. * the given correction requestor
  15. * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
  16. * @exception JavaModelException currently this exception is never thrown, but the opportunity to thrown an exception
  17. * when the correction failed is kept for later.
  18. * @since 2.0
  19. */
  20. public void computeCorrections(IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaModelException {
  21. IJavaElement element = targetUnit == null ? JavaCore.create(marker.getResource()) : targetUnit;
  22. if(!(element instanceof ICompilationUnit))
  23. return;
  24. ICompilationUnit unit = (ICompilationUnit) element;
  25. int id = marker.getAttribute(IJavaModelMarker.ID, -1);
  26. String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaModelMarker.ARGUMENTS, "")); //$NON-NLS-1$
  27. int start = marker.getAttribute(IMarker.CHAR_START, -1);
  28. int end = marker.getAttribute(IMarker.CHAR_END, -1);
  29. computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor);
  30. }

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

  1. /**
  2. * Performs code correction for the given marker,
  3. * reporting results to the given correction requestor.
  4. *
  5. * Correction results are answered through a requestor.
  6. *
  7. * @param marker
  8. * the marker which describe the problem to correct.
  9. * @param targetUnit
  10. * replace the compilation unit given by the marker. Ignored if null.
  11. * @param positionOffset
  12. * the offset of position given by the marker.
  13. * @param requestor
  14. * the given correction requestor
  15. * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
  16. * @exception JavaModelException currently this exception is never thrown, but the opportunity to thrown an exception
  17. * when the correction failed is kept for later.
  18. * @since 2.0
  19. */
  20. public void computeCorrections(IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaModelException {
  21. IJavaElement element = targetUnit == null ? JavaCore.create(marker.getResource()) : targetUnit;
  22. if(!(element instanceof ICompilationUnit))
  23. return;
  24. ICompilationUnit unit = (ICompilationUnit) element;
  25. int id = marker.getAttribute(IJavaModelMarker.ID, -1);
  26. String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaModelMarker.ARGUMENTS, "")); //$NON-NLS-1$
  27. int start = marker.getAttribute(IMarker.CHAR_START, -1);
  28. int end = marker.getAttribute(IMarker.CHAR_END, -1);
  29. computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor);
  30. }

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

  1. /**
  2. * Performs code correction for the given marker,
  3. * reporting results to the given correction requestor.
  4. *
  5. * Correction results are answered through a requestor.
  6. *
  7. * @param marker
  8. * the marker which describe the problem to correct.
  9. * @param targetUnit
  10. * replace the compilation unit given by the marker. Ignored if null.
  11. * @param positionOffset
  12. * the offset of position given by the marker.
  13. * @param requestor
  14. * the given correction requestor
  15. * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
  16. * @exception JavaModelException currently this exception is never thrown, but the opportunity to thrown an exception
  17. * when the correction failed is kept for later.
  18. * @since 2.0
  19. */
  20. public void computeCorrections(IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaModelException {
  21. IJavaElement element = targetUnit == null ? JavaCore.create(marker.getResource()) : targetUnit;
  22. if(!(element instanceof ICompilationUnit))
  23. return;
  24. ICompilationUnit unit = (ICompilationUnit) element;
  25. int id = marker.getAttribute(IJavaModelMarker.ID, -1);
  26. String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaModelMarker.ARGUMENTS, "")); //$NON-NLS-1$
  27. int start = marker.getAttribute(IMarker.CHAR_START, -1);
  28. int end = marker.getAttribute(IMarker.CHAR_END, -1);
  29. computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor);
  30. }

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

  1. /**
  2. * Performs code correction for the given marker,
  3. * reporting results to the given correction requestor.
  4. *
  5. * Correction results are answered through a requestor.
  6. *
  7. * @param marker
  8. * the marker which describe the problem to correct.
  9. * @param targetUnit
  10. * replace the compilation unit given by the marker. Ignored if null.
  11. * @param positionOffset
  12. * the offset of position given by the marker.
  13. * @param requestor
  14. * the given correction requestor
  15. * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
  16. * @exception JavaModelException currently this exception is never thrown, but the opportunity to thrown an exception
  17. * when the correction failed is kept for later.
  18. * @since 2.0
  19. */
  20. public void computeCorrections(IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaModelException {
  21. IJavaElement element = targetUnit == null ? JavaCore.create(marker.getResource()) : targetUnit;
  22. if(!(element instanceof ICompilationUnit))
  23. return;
  24. ICompilationUnit unit = (ICompilationUnit) element;
  25. int id = marker.getAttribute(IJavaModelMarker.ID, -1);
  26. String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaModelMarker.ARGUMENTS, "")); //$NON-NLS-1$
  27. int start = marker.getAttribute(IMarker.CHAR_START, -1);
  28. int end = marker.getAttribute(IMarker.CHAR_END, -1);
  29. computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor);
  30. }

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

  1. /**
  2. * Performs code correction for the given marker,
  3. * reporting results to the given correction requestor.
  4. *
  5. * Correction results are answered through a requestor.
  6. *
  7. * @param marker
  8. * the marker which describe the problem to correct.
  9. * @param targetUnit
  10. * replace the compilation unit given by the marker. Ignored if null.
  11. * @param positionOffset
  12. * the offset of position given by the marker.
  13. * @param requestor
  14. * the given correction requestor
  15. * @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
  16. * @exception JavaModelException currently this exception is never thrown, but the opportunity to thrown an exception
  17. * when the correction failed is kept for later.
  18. * @since 2.0
  19. */
  20. public void computeCorrections(IMarker marker, ICompilationUnit targetUnit, int positionOffset, ICorrectionRequestor requestor) throws JavaModelException {
  21. IJavaElement element = targetUnit == null ? JavaCore.create(marker.getResource()) : targetUnit;
  22. if(!(element instanceof ICompilationUnit))
  23. return;
  24. ICompilationUnit unit = (ICompilationUnit) element;
  25. int id = marker.getAttribute(IJavaModelMarker.ID, -1);
  26. String[] args = Util.getProblemArgumentsFromMarker(marker.getAttribute(IJavaModelMarker.ARGUMENTS, "")); //$NON-NLS-1$
  27. int start = marker.getAttribute(IMarker.CHAR_START, -1);
  28. int end = marker.getAttribute(IMarker.CHAR_END, -1);
  29. computeCorrections(unit, id, start + positionOffset, end + positionOffset, args, requestor);
  30. }

相关文章

Util类方法