Package com.norconex.commons.lang.bean

# Enum Class BeanMapper.Format

java.lang.Object
java.lang.Enum<BeanMapper.Format>
com.norconex.commons.lang.bean.BeanMapper.Format

All Implemented Interfaces:
  `Serializable`, `Comparable<BeanMapper.Format>`, `Constable`

Enclosing class:
  `BeanMapper`

public static enum BeanMapper.Format extends Enum<BeanMapper.Format>

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `JSON`
  `XML`
  `YAML`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static BeanMapper.Format`
  `fromContent(String content)`
  Resolve the format based on supplied content.
  `static BeanMapper.Format`
  `fromContent(String content, BeanMapper.Format defaultFormat)`
  Resolve the format based on supplied content.
  `static BeanMapper.Format`
  `fromPath(Path path)`
  Resolve the format based on the file extension for a given path.
  `static BeanMapper.Format`
  `fromPath(Path path, BeanMapper.Format defaultFormat)`
  Resolve the format based on the file extension for a given path.
  `static BeanMapper.Format`
  `valueOf(String name)`
  Returns the enum constant of this class with the specified name.
  `static BeanMapper.Format[]`
  `values()`
  Returns an array containing the constants of this enum class, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### XML

    public static final BeanMapper.Format XML

  - ### JSON

    public static final BeanMapper.Format JSON

  - ### YAML

    public static final BeanMapper.Format YAML

- ## Method Details

  - ### values

    public static BeanMapper.Format[] values()
    Returns an array containing the constants of this enum class, in the order they are declared.
    Returns:
      an array containing the constants of this enum class, in the order they are declared

  - ### valueOf

    public static BeanMapper.Format valueOf(String name)
    Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      `IllegalArgumentException` - if this enum class has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### fromPath

    public static BeanMapper.Format fromPath(Path path)
    Resolve the format based on the file extension for a given path. Supported extensions are ".json", ".yaml", ".yml", and ".xml" (all case-insensitive).
    Parameters:
      `path` - the path to evaluate
    Returns:
      the detected format or `null` if path is `null` or does not have a supported extension.

  - ### fromPath

    public static BeanMapper.Format fromPath(Path path, BeanMapper.Format defaultFormat)
    Resolve the format based on the file extension for a given path. Supported extensions are ".json", ".yaml", ".yml", and ".xml" (all case-insensitive).
    Parameters:
      `path` - the path to evaluate
      `defaultFormat` - format returned if the path is `null` or does not have a supported extension
    Returns:
      the detected or default format

  - ### fromContent

    public static BeanMapper.Format fromContent(String content)
    Resolve the format based on supplied content.
    Parameters:
      `content` - the content to evaluate
    Returns:
      the detected format or `null` if the content is blank or the format could not be detected

  - ### fromContent

    public static BeanMapper.Format fromContent(String content, BeanMapper.Format defaultFormat)
    Resolve the format based on supplied content.
    Parameters:
      `content` - the content to evaluate
      `defaultFormat` - format returned if the content is blank or the format could not be detected
    Returns:
      the detected or default format