@Override
  public List<Tag> createVisibilityExpTags(String visExpression) throws IOException {
    VisibilityLabelOrdinalProvider provider = new VisibilityLabelOrdinalProvider() {
      @Override
      public int getLabelOrdinal(String label) {
        Integer ordinal = null;
        ordinal = labels.get(label);
        if (ordinal != null) {
          return ordinal.intValue();
        }
        return VisibilityConstants.NON_EXIST_LABEL_ORDINAL;
      }

      @Override
      public String getLabel(int ordinal) {
        // Unused
        throw new UnsupportedOperationException(
          "getLabel should not be used in VisibilityExpressionResolver");
      }
    };
    return VisibilityUtils.createVisibilityExpTags(visExpression, true, false, null, provider);
  }
This implementation creates tags by expanding expression using label ordinal. Labels will be
serialized in sorted order of it's ordinal.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/DefaultVisibilityExpressionResolver.java