Class LocalizationDirectives


  • public class LocalizationDirectives
    extends Object
    Processes localization directives.
    • Constructor Summary

      Constructors 
      Constructor Description
      LocalizationDirectives()
      Creates a new LocalizationDirectives object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isLocalizable​(boolean popSingle)
      Indicates if the current context is localizable or not.
      boolean isWithinScope()
      Indicates if the current context is inside the scope of a localization directive.
      boolean localizeOutside()
      Indicates if text outside the scope of localization directives should be extracted or not.
      void process​(String content)
      Evaluates a string that contain localization directives and update the object state based on the given instructions.
      void reset()
      Resets this localization directives processor.
      void setOptions​(boolean useLD, boolean localizeOutside)
      Sets the options for this localization directives processor.
      boolean useLD()
      Indicates if localization directives are to be used or not.
    • Constructor Detail

      • LocalizationDirectives

        public LocalizationDirectives()
        Creates a new LocalizationDirectives object.
    • Method Detail

      • reset

        public void reset()
        Resets this localization directives processor.
      • useLD

        public boolean useLD()
        Indicates if localization directives are to be used or not.
        Returns:
        True if localization directives should be processed, false if they should not.
      • localizeOutside

        public boolean localizeOutside()
        Indicates if text outside the scope of localization directives should be extracted or not.
        Returns:
        True if text text outside the scope of localization directives is to be extracted, false if it should not.
      • isWithinScope

        public boolean isWithinScope()
        Indicates if the current context is inside the scope of a localization directive.
        Returns:
        True if the current context is inside the scope of a localization directive, false if it is outside.
      • isLocalizable

        public boolean isLocalizable​(boolean popSingle)
        Indicates if the current context is localizable or not.
        Parameters:
        popSingle - Indicates if non-group directives should be popped out of the context when calling this method.
        Returns:
        True if the current context is localizable, or if localization directives are not to be used.
      • setOptions

        public void setOptions​(boolean useLD,
                               boolean localizeOutside)
        Sets the options for this localization directives processor.
        Parameters:
        useLD - Indicates if localization directives are to be used or not.
        localizeOutside - Indicates if text outside the scope of localization directives should be extracted or not.
      • process

        public void process​(String content)
        Evaluates a string that contain localization directives and update the object state based on the given instructions.
        Parameters:
        content - The text to process.