Enum SafeMode

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<SafeMode>

    public enum SafeMode
    extends java.lang.Enum<SafeMode>
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      SAFE
      A safe mode level that closely parallels safe mode in AsciiDoc.
      SECURE
      A safe mode level that disallows the document from attempting to read files from the file system and including the contents of them into the document, in additional to all the security features of SafeMode::SERVER.
      SERVER
      A safe mode level that disallows the document from setting attributes that would affect the rendering of the document, in addition to all the security features of SafeMode::SAFE.
      UNSAFE
      A safe mode level that disables any of the security features enforced by Asciidoctor (Ruby is still subject to its own restrictions).
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getLevel()  
      static SafeMode safeMode​(int level)  
      static SafeMode valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static SafeMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • UNSAFE

        public static final SafeMode UNSAFE
        A safe mode level that disables any of the security features enforced by Asciidoctor (Ruby is still subject to its own restrictions).
      • SAFE

        public static final SafeMode SAFE
        A safe mode level that closely parallels safe mode in AsciiDoc. This value prevents access to files which reside outside of the parent directory of the source file and disables any macro other than the include::[] macro.
      • SERVER

        public static final SafeMode SERVER
        A safe mode level that disallows the document from setting attributes that would affect the rendering of the document, in addition to all the security features of SafeMode::SAFE. For instance, this level disallows changing the backend or the source-highlighter using an attribute defined in the source document. This is the most fundamental level of security for server-side deployments (hence the name).
      • SECURE

        public static final SafeMode SECURE
        A safe mode level that disallows the document from attempting to read files from the file system and including the contents of them into the document, in additional to all the security features of SafeMode::SERVER. For instance, this level disallows use of the include::[] macro and the embedding of binary content (data uri), stylesheets and JavaScripts referenced by the document.(Asciidoctor and trusted extensions may still be allowed to embed trusted content into the document). Since Asciidoctor is aiming for wide adoption, this level is the default and is recommended for server-side deployments.
    • Method Detail

      • values

        public static SafeMode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (SafeMode c : SafeMode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static SafeMode valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getLevel

        public int getLevel()
      • safeMode

        public static final SafeMode safeMode​(int level)