Tabnine Logo
de.smartics.maven.util.report.link
Code IndexAdd Tabnine to your IDE (free)

How to use de.smartics.maven.util.report.link

Best Java code snippets using de.smartics.maven.util.report.link (Showing top 20 results out of 315)

origin: de.smartics.util/smartics-maven-utils

/**
 * Returns the key to the label to use as a label for the rendered link.
 *
 * @return the key to the label to use as a label for the rendered link.
 */
public String getLabelKey()
{
 return strategy.getConfig().getLabelKey();
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Default constructor.
 *
 * @param config the configuration of this strategy instance.
 * @throws NullArgumentException if <code>config</code> is <code>null</code>.
 */
protected AbstractLinkConstructorStrategy(
  final LinkConstructorStrategyConfig config) throws NullArgumentException
{
 checkArguments(config);
 this.config = config;
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Constructs a link to the given Java element.
 *
 * @param packageName packageName the name of the package.
 * @param typeName typeName the name of the Java type.
 * @param method the test method to link to.
 * @return the requested relative link.
 */
public String constructLink(final String packageName, final String typeName,
  final MethodInfo method)
{
 final JavaElementRef ref =
   new JavaElementRef(packageName, typeName, method);
 return constructLink(ref);
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Constructs a path to the specified Java element.
 *
 * @param baseLink the base link to prepend.
 * @param ref the element in the report to reference.
 * @return the path to the element or <code>null</code> if the referenced
 *         element does not exit (only the existence of the file is checked,
 *         not the element within the file).
 */
public String constructLink(final String baseLink, final JavaElementRef ref)
{
 if (isReferencedReportExisting(ref))
 {
  final StringBuilder buffer = new StringBuilder(64);
  buffer.append(baseLink);
  appendBasePathSeparator(buffer);
  addQualifiedType(buffer, ref);
  final MethodInfo memberName = ref.getElementName();
  if (config.isReferenceMember() && memberName != null)
  {
   appendMemberPart(buffer, memberName);
  }
  return buffer.toString();
 }
 return null;
}
origin: de.smartics.testdoc/maven-testdoc-report-plugin

void renderTestMethodLink(final ExternalReport report)
{
 final String messageKey = report.getLabelKey();
 final Type type = getType();
 final String link =
   report.constructLink(type.getPackageName(), type.getTypeName(),
     getTestMethod());
 if (link != null)
 {
  sink.link(link);
  final String label = messages.getLabel(messageKey);
  sink.text(label);
  sink.link_();
 }
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Adds package and type part of the element reference.
 *
 * @param buffer the buffer to append to.
 * @param ref the element in the report to reference.
 */
protected void addQualifiedType(final StringBuilder buffer,
  final JavaElementRef ref)
{
 final String packageName = ref.getPackageName();
 if (StringUtils.isNotBlank(packageName))
 {
  addPackagePart(buffer, packageName);
 }
 final String typeName = ref.getTypeName();
 appendTypePart(buffer, typeName);
}
origin: de.smartics.util/smartics-maven-utils

private String createRelativeReportLocationLink(final ReportId reportId,
  final LinkConstructorStrategy strategy)
{
 final LinkConstructorStrategyConfig config = strategy.getConfig();
 final File reportLocation = config.getReportLocation();
 final String reportArtifactId = reportId.getReportArtifactId();
 final String location;
 if (reportLocation.exists() || isReportPluginRegistered(reportArtifactId))
 {
  location = calcRelativePath(reportLocation);
 }
 else
 {
  location = null;
  if (log != null && log.isWarnEnabled())
  {
   log.warn("Cannot locate report of '" + reportArtifactId
        + "'. Disabling references to that report.");
  }
 }
 return location;
}
origin: de.smartics.testdoc/testdoc-maven-report-plugin

private ReportId provideLinkConstructor(
  // NOPMD
  final boolean addReport, final String reportArtifactId,
  final String reportType, final File location, final boolean linkToMember,
  final String labelKey) throws MavenReportException
{
 final LinkConstructorStrategy strategy =
   createStrategy(reportArtifactId, location, linkToMember, labelKey);
 final ReportId reportId = new ReportId(reportArtifactId, reportType);
 if (reports.registerReport(addReport, reportId, strategy))
 {
  return reportId;
 }
 return null;
}
origin: de.smartics.util/smartics-maven-utils

private boolean isReferencedReportExisting(final JavaElementRef ref)
{
 final File baseDir = config.getReportLocation();
 final StringBuilder buffer = new StringBuilder();
 constructFilePath(buffer, ref);
 final String filePath = buffer.toString();
 final File file = new File(baseDir, filePath);
 return file.exists();
}
origin: de.smartics.util/smartics-maven-utils

  factory.createExternalReport(reportId, strategy);
final boolean created = report != null;
if (created)
origin: de.smartics.util/smartics-maven-utils

/**
 * Adds package and type part of the element reference.
 *
 * @param buffer the buffer to append to.
 * @param ref the element in the report to reference.
 */
protected void constructFilePath(final StringBuilder buffer,
  final JavaElementRef ref)
{
 addQualifiedType(buffer, ref);
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Constructs a link to the given Java Element.
 *
 * @param ref the element to link to.
 * @return the requested relative link.
 */
public String constructLink(final JavaElementRef ref)
{
 return strategy.constructLink(basePath, ref);
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Default constructor.
 *
 * @param reportArtifactId the report artifact ID this strategy is constructed
 *          for.
 * @param reportType the type of report generated by the
 *          {@link #getReportArtifactId()} to reference.
 */
public ReportId(final String reportArtifactId, final String reportType)
{
 checkArguments(reportArtifactId, reportType);
 this.reportArtifactId = reportArtifactId;
 this.reportType = reportType;
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Default constructor.
 *
 * @param packageName the name of the package.
 * @param typeName the name of the Java class.
 * @param elementName the name of the element.
 * @throws IllegalArgumentException if <code>typeName</code> is blank or
 *           <code>packageName</code> is empty or consists only of
 *           whitespaces.
 * @todo All elements are currently provided to be fully URL encoded.
 */
public JavaElementRef(final String packageName, final String typeName,
  final MethodInfo elementName) throws IllegalArgumentException
{
 checkArguments(packageName, typeName);
 this.packageName = packageName;
 this.typeName = typeName;
 this.elementName = elementName;
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Default constructor.
 *
 * @param reportId the report ID this strategy is constructed for.
 * @param basePath the base path to the report to prefix the constructed link.
 * @param strategy the strategy to construct the link suffix to the base path.
 * @throws IllegalArgumentException if <code>helper</code> or
 *           <code>reportLocation</code> is <code>null</code> or
 *           <code>reportArtifactId</code> is blank.
 */
public ExternalReport(final ReportId reportId, final String basePath,
  final LinkConstructorStrategy strategy) throws IllegalArgumentException
{
 checkArguments(reportId, basePath, strategy);
 this.reportId = reportId;
 this.basePath = basePath;
 this.strategy = strategy;
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Adds the type part of the link.
 *
 * @param buffer the buffer to append to.
 * @param typeName the name of the package to render.
 * @impl The default implementation adds the extension separated by a dot.
 */
protected void appendTypePart(final StringBuilder buffer,
  final String typeName)
{
 buffer.append(typeName).append('.').append(config.getExtension());
}
origin: de.smartics.util/smartics-maven-utils

/**
 * Creates the congfiguration instance.
 *
 * @return the congfiguration instance.
 */
public LinkConstructorStrategyConfig build()
{
 if (reportLocation == null)
 {
  throw new IllegalArgumentException(
    "The report location must not be 'null'");
 }
 if (StringUtils.isBlank(labelKey))
 {
  throw new IllegalArgumentException(
    "The label for the link must not be blank.");
 }
 return new LinkConstructorStrategyConfig(this);
}
origin: de.smartics.util/smartics-maven-utils

/**
 * {@inheritDoc}
 */
public ExternalReport createExternalReport(final ReportId reportId,
  final LinkConstructorStrategy strategy)
{
 if (reportId == null)
 {
  throw new IllegalArgumentException("The report ID is required.");
 }
 if (strategy == null)
 {
  throw new IllegalArgumentException(
    "The link construction strategy is required.");
 }
 final String reportBasePath =
   createRelativeReportLocationLink(reportId, strategy);
 if (reportBasePath != null)
 {
  return new ExternalReport(reportId, reportBasePath, strategy);
 }
 else
 {
  return null;
 }
}
origin: de.smartics.testdoc/testdoc-maven-report-plugin

void renderTestMethodLink(final ExternalReport report)
{
 final String messageKey = report.getLabelKey();
 final Type type = getType();
 final String link =
   report.constructLink(type.getPackageName(), type.getTypeName(),
     getTestMethod());
 if (link != null)
 {
  sink.link(link);
  final String label = messages.getLabel(messageKey);
  sink.text(label);
  sink.link_();
 }
}
origin: de.smartics.testdoc/maven-testdoc-report-plugin

private ReportId provideLinkConstructor(
  // NOPMD
  final boolean addReport, final String reportArtifactId,
  final String reportType, final File location, final boolean linkToMember,
  final String labelKey) throws MavenReportException
{
 final LinkConstructorStrategy strategy =
   createStrategy(reportArtifactId, location, linkToMember, labelKey);
 final ReportId reportId = new ReportId(reportArtifactId, reportType);
 if (reports.registerReport(addReport, reportId, strategy))
 {
  return reportId;
 }
 return null;
}
de.smartics.maven.util.report.link

Most used classes

  • ExternalReport
    Helper to construct links from a given report instance to other Maven [http://maven-apache.org/] rep
  • ReportId
    Identifies a specific report of a project to reference to.
  • LineNumberDirectoryPathLinkConstructorStrategy
    A variation that uses the line number and not the member signature to construct the anchor.
  • ExternalReportFactory
    Factory to create external reports.
  • LinkConstructorStrategyConfig$Builder
    Builds instances of LinkConstructorStrategyConfig.
  • FilePathLinkConstructorStrategy,
  • SurefireLinkConstructorStrategy,
  • AbstractLinkConstructorStrategy,
  • JavaElementRef,
  • LinkConstructorStrategy,
  • LinkConstructorStrategyConfig
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now