Interface CardFactory.Config

  • Enclosing class:
    CardFactory

    public static interface CardFactory.Config
    CardFactory configuration.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean allowHierarch()
      Determines whether the HIERARCH keyword convention is permitted.
      boolean allowTrim()
      Determines whether overlength string values will be trimmed to fits card constraints.
      java.lang.String sanitiseText​(java.lang.String txt)
      This method is called on uncontrolled text inputs that will end up as text or comment content in output cards.
    • Method Detail

      • allowHierarch

        boolean allowHierarch()
        Determines whether the HIERARCH keyword convention is permitted. If true, overlength keywords starting "HIERARCH " are allowed.
        Returns:
        true iff HIERARCH is allowed
      • allowTrim

        boolean allowTrim()
        Determines whether overlength string values will be trimmed to fits card constraints. If true, strings will be silently truncated, if false overlength values will provoke a RuntimeException.
        Returns:
        true iff overlength string values may be truncated
      • sanitiseText

        java.lang.String sanitiseText​(java.lang.String txt)
        This method is called on uncontrolled text inputs that will end up as text or comment content in output cards. The output value must contain only legal FITS header characters, that is in the range 0x20-0x7e inclusive (see FitsUtil.isFitsCharacter(int)). If the input text contains no illegal characters, it should be returned unchanged. If it does contain illegal characters, it should be adjusted in some way to remove them, or a RuntimeException may be thrown.

        Example implementations are provided in sanitiseAsReplacement and sanitiseAsError.

        Parameters:
        txt - non-null free text string
        Returns:
        string like input but containing only legal FITS characters
        Throws:
        java.lang.IllegalArgumentException - if this config is unable or unwilling to sanitise