Class JoinProperty

  • All Implemented Interfaces:
    Action

    public class JoinProperty
    extends Object
    implements Action
    Joins a multi-value property to single values.
    Author:
    Yves De Bruyne
    • Field Detail

      • separator

        protected String separator
      • emptyValue

        protected Object emptyValue
    • Constructor Detail

      • JoinProperty

        public JoinProperty​(@Nonnull
                            String name)
        Constructor
        Parameters:
        name - property name
      • JoinProperty

        public JoinProperty​(@Nonnull
                            String name,
                            Object emptyValue)
        Constructor
        Parameters:
        name - property name
        emptyValue - value to set for empty arrays
      • JoinProperty

        public JoinProperty​(@Nonnull
                            String name,
                            Object emptyValue,
                            @Nonnull
                            String separator)
        Constructor
        Parameters:
        name - property name
        emptyValue - value to set for empty arrays
        separator - separator text for joining
    • Method Detail

      • doAction

        public String doAction​(@Nonnull
                               org.apache.sling.api.resource.Resource resource)
                        throws org.apache.sling.api.resource.PersistenceException
        Description copied from interface: Action
        Runs an action.
        Specified by:
        doAction in interface Action
        Parameters:
        resource - resource to run action on
        Returns:
        output message
        Throws:
        org.apache.sling.api.resource.PersistenceException - error saving to JCR