Class BaseRepresenter

  • Direct Known Subclasses:
    Representer

    public abstract class BaseRepresenter
    extends Object
    Represent basic YAML structures: scalar, sequence, mapping
    • Field Detail

      • representers

        protected final Map<Class<?>,​Represent> representers
        represent the class without its subclasses
      • nullRepresenter

        protected Represent nullRepresenter
        in Java 'null' is not a type. So we have to keep the null representer separately otherwise it will coincide with the default representer which is stored with the key null.
      • multiRepresenters

        protected final Map<Class<?>,​Represent> multiRepresenters
        represent class and its children with common code
      • representedObjects

        protected final Map<Object,​Node> representedObjects
        Keep references of already represented instances
      • objectToRepresent

        protected Object objectToRepresent
        object to create the Node for
    • Constructor Detail

      • BaseRepresenter

        public BaseRepresenter()
    • Method Detail

      • represent

        public Node represent​(Object data)
      • representData

        protected final Node representData​(Object data)
      • representScalar

        protected Node representScalar​(Tag tag,
                                       String value,
                                       DumperOptions.ScalarStyle style)
        Create scalar node for the provided string object.
        Parameters:
        tag - - the tag to emit
        value - - the value to emit
        style - - scalar style when preferred
        Returns:
        Node to emit
      • representScalar

        protected Node representScalar​(Tag tag,
                                       String value)
      • setPropertyUtils

        public void setPropertyUtils​(PropertyUtils propertyUtils)
      • getPropertyUtils

        public final PropertyUtils getPropertyUtils()
        getter
        Returns:
        utils or create if null
      • isExplicitPropertyUtils

        public final boolean isExplicitPropertyUtils()