Class MixinUtil


  • public class MixinUtil
    extends Object
    Utility class for mixin related actions
    Author:
    Bart Thierens
    • Method Detail

      • hasMixin

        public static boolean hasMixin​(@Nonnull
                                       javax.jcr.Node node,
                                       @Nonnull
                                       String mixin)
                                throws javax.jcr.RepositoryException
        Checks if a mixin is present on a node
        Parameters:
        node - the non-null node to check
        mixin - the non-null mixin to check (can be a non-existing mixin type)
        Returns:
        true if the mixin is present on the node, otherwise false
        Throws:
        javax.jcr.RepositoryException - if an exception occurs while performing repository operations
      • ensureMixin

        public static void ensureMixin​(@Nonnull
                                       javax.jcr.Node node,
                                       @Nonnull
                                       String mixin)
                                throws javax.jcr.RepositoryException
        Ensures a mixin is set on a node if it wasn't already
        Parameters:
        node - the non-null node to add the mixin to
        mixin - the non-null mixin to add
        Throws:
        javax.jcr.RepositoryException - if an exception occurs while performing repository operations