Klasse MessageFormatExtension

Object
de.sayayi.plugin.gradle.message.MessageFormatExtension

public abstract class MessageFormatExtension extends Object
Gradle extension messageFormat for configuring the messageFormatPack task.

This extension allows configuring the pack filename, compression, duplicate message handling strategy, template validation, source sets to scan and include/exclude filters for message codes.

Seit:
0.8.0
Siehe auch:
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
     
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    void
    exclude(String... regex)
    Exclude messages that match the given regular expressions.
    abstract org.gradle.api.provider.Property<@NotNull Boolean>
    Compress property stating whether the message pack must be compressed or not.
    abstract org.gradle.api.provider.Property<@NotNull Object>
    Property containing the strategy to use in case a duplicate message code or template name (with different message definition) is found.
    Return a list of regular expressions which will be matched against each message code.
    Return a list of regular expressions which will be matched against each message code.
    abstract org.gradle.api.provider.Property<@NotNull String>
    Return the pack filename property.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Returns a collection of source files to scan for message and template annotations.
    abstract org.gradle.api.provider.Property<@NotNull Boolean>
    Property containing a boolean stating whether to validate referenced templates.
    void
    include(String... regex)
    Include messages that match the given regular expressions.
    void
    sourceSet(org.gradle.api.tasks.SourceSet sourceSet)
    Add all outputs for the given sourceSet to the collection of sources.

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • MessageFormatExtension

      public MessageFormatExtension()
  • Methodendetails

    • getIncludeRegexFilters

      public List<String> getIncludeRegexFilters()
      Return a list of regular expressions which will be matched against each message code. If it matches, the message will be included in the packed message file. If it doesn't match the message is skipped.

      If the list is empty, all messages are included, unless they're explicitly excluded.

      Gibt zurück:
      list of regular expressions for message inclusion, never null
      Seit:
      0.8.0 (renamed in 0.9.1)
      Siehe auch:
    • getExcludeRegexFilters

      public List<String> getExcludeRegexFilters()
      Return a list of regular expressions which will be matched against each message code. If it matches, the message will be excluded from the packed message file. If it doesn't match the message is included.
      Gibt zurück:
      list of regular expressions for message exclusion, never null
      Seit:
      0.8.0 (renamed in 0.9.1)
      Siehe auch:
    • getPackFilename

      public abstract org.gradle.api.provider.Property<@NotNull String> getPackFilename()
      Return the pack filename property. The default value is messages.mfp.
      Gibt zurück:
      pack filename property, never null
      Seit:
      0.8.0
    • getCompress

      public abstract org.gradle.api.provider.Property<@NotNull Boolean> getCompress()
      Compress property stating whether the message pack must be compressed or not. The default value is false.
      Gibt zurück:
      compress property, never null
    • getSources

      public abstract org.gradle.api.file.ConfigurableFileCollection getSources()
      Returns a collection of source files to scan for message and template annotations.

      There's no restriction on what kind of files are in the collection. Only class (*.class) files will be used for annotation scanning.

      The default value is the output of the main/java source set, which contains all compiled java classes.

      Gibt zurück:
      class files to be scanned for messages and templates, never null
      Siehe auch:
    • getDuplicateMsgStrategy

      public abstract org.gradle.api.provider.Property<@NotNull Object> getDuplicateMsgStrategy()
      Property containing the strategy to use in case a duplicate message code or template name (with different message definition) is found. The default strategy is IGNORE_AND_WARN.

      This property accepts various formats:

      A duplicate is either a message with an already known message code or a template with an already known template name and a different message definition. This means that if the same message or template is encountered twice, it is not considered a duplicate.

      Gibt zurück:
      duplicate message strategy property, never null
      Siehe auch:
    • getValidateReferencedTemplates

      public abstract org.gradle.api.provider.Property<@NotNull Boolean> getValidateReferencedTemplates()
      Property containing a boolean stating whether to validate referenced templates. The default value resolves to true.

      If the property resolves to true the task will check whether all referenced templates (including nested templates) are available and included in the packed message file.

      If the property resolves to false no checks are performed. This may lead to a situation where a message cannot be formatted if the referenced template is missing from the message support.

      Gibt zurück:
      validate referenced templates property, never null
    • include

      public void include(String... regex)
      Include messages that match the given regular expressions.
      Parameter:
      regex - array of regular expressions, not null
      Seit:
      0.8.0
      Siehe auch:
    • exclude

      public void exclude(String... regex)
      Exclude messages that match the given regular expressions.
      Parameter:
      regex - array of regular expressions, not null
      Seit:
      0.8.0
      Siehe auch:
    • sourceSet

      public void sourceSet(org.gradle.api.tasks.SourceSet sourceSet)
      Add all outputs for the given sourceSet to the collection of sources.
      Parameter:
      sourceSet - source set to include in message/template scanning
      Siehe auch: