Esempio n. 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 SequenceA1 newInstance() {
      final SequenceA1 result = new SequenceA1();

      result.addTag(START_TAG);

      result.addTag(END_TAG);

      return result;
    }
Esempio n. 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 SequenceA1 newInstance(final SwiftTagListBlock... sequences) {
      final SequenceA1 result = new SequenceA1();

      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;
    }
Esempio n. 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 SequenceA1 newInstance(final Tag... tags) {
      final SequenceA1 result = new SequenceA1();

      result.addTag(START_TAG);

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

      result.addTag(END_TAG);

      return result;
    }