Example #1
0
    /**
     * Create an empty $sequenceClassname. This method is intended to avoid disambiguation for the
     * newInstance() with variable list of blocks or tags
     *
     * @since 7.6
     */
    public static SequenceA newInstance() {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      result.addTag(END_TAG);

      return result;
    }
Example #2
0
    /**
     * Create a new instance of $sequenceClassname and add the contents of all sequences given
     * inside. Mainly intended to create a sequence by adding subsequences
     *
     * @since 7.6
     */
    public static SequenceA newInstance(final SwiftTagListBlock... sequences) {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      if (sequences != null && sequences.length > 0) {
        for (final SwiftTagListBlock s : sequences) {
          result.addTags(s.getTags());
        }
      }

      result.addTag(END_TAG);

      return result;
    }
Example #3
0
    /**
     * Creates a new instance of this sequence with the given tags inside.
     *
     * @param tags may be null, an empty sequence containing only start and end sequence tags will
     *     be returned
     */
    public static SequenceA newInstance(final Tag... tags) {
      final SequenceA result = new SequenceA();

      result.addTag(START_TAG);

      if (tags != null && tags.length > 0) {
        for (final Tag t : tags) {
          result.addTag(t);
        }
      }

      result.addTag(END_TAG);

      return result;
    }