wffweb/src/main/java/com/webfirmframework/wffweb/tag/html/AbstractHtml.java
public void prependChildren(final AbstractHtml... children) {

        final Lock lock = sharedObject.getLock(ACCESS_OBJECT).writeLock();

        boolean listenerInvoked = false;

        try {
            lock.lock();

            final Iterator<AbstractHtml> iterator = this.children.iterator();
            if (iterator.hasNext()) {
                final AbstractHtml firstChild = iterator.next();

                final AbstractHtml[] removedParentChildren = this.children
                        .toArray(new AbstractHtml[this.children.size()]);

                listenerInvoked = firstChild.insertBefore(removedParentChildren,
                        children);

                if (listenerInvoked) {
                    final InsertBeforeListener insertBeforeListener = sharedObject
                            .getInsertBeforeListener(ACCESS_OBJECT);
                    if (insertBeforeListener == null) {
                        listenerInvoked = false;
                    }
                }

            } else {

                // NB: similar impl is done in appendChildren(AbstractHtml...
                // children) so any improvements here will be applicable in
                // there also
                final Collection<ChildMovedEvent> movedOrAppended = new ArrayDeque<>(
                        children.length);

                for (final AbstractHtml child : children) {
                    final AbstractHtml previousParent = child.parent;

                    addChild(child, false);

                    final ChildMovedEvent event = new ChildMovedEvent(
                            previousParent, this, child);
                    movedOrAppended.add(event);

                }

                final ChildTagAppendListener listener = sharedObject
                        .getChildTagAppendListener(ACCESS_OBJECT);
                if (listener != null) {
                    listener.childrendAppendedOrMoved(movedOrAppended);
                    listenerInvoked = true;
                }

            }
        } finally {
            lock.unlock();
        }

        if (listenerInvoked) {
            final PushQueue pushQueue = sharedObject
                    .getPushQueue(ACCESS_OBJECT);
            if (pushQueue != null) {
                pushQueue.push();
            }
        }

    }
public void prependChildren(final AbstractHtml... children) {

        final Lock lock = sharedObject.getLock(ACCESS_OBJECT).writeLock();

        boolean listenerInvoked = false;

        try {
            lock.lock();

            final Iterator<AbstractHtml> iterator = this.children.iterator();
            if (iterator.hasNext()) {
                final AbstractHtml firstChild = iterator.next();

                final AbstractHtml[] removedParentChildren = this.children
                        .toArray(new AbstractHtml[this.children.size()]);

                listenerInvoked = firstChild.insertBefore(removedParentChildren,
                        children);

                if (listenerInvoked) {
                    final InsertBeforeListener insertBeforeListener = sharedObject
                            .getInsertBeforeListener(ACCESS_OBJECT);
                    if (insertBeforeListener == null) {
                        listenerInvoked = false;
                    }
                }

            } else {

                // NB: similar impl is done in appendChildren(AbstractHtml...
                // children) so any improvements here will be applicable in
                // there also
                final Collection<ChildMovedEvent> movedOrAppended = new ArrayDeque<>(
                        children.length);

                for (final AbstractHtml child : children) {
                    final AbstractHtml previousParent = child.parent;

                    addChild(child, false);

                    final ChildMovedEvent event = new ChildMovedEvent(
                            previousParent, this, child);
                    movedOrAppended.add(event);

                }

                final ChildTagAppendListener listener = sharedObject
                        .getChildTagAppendListener(ACCESS_OBJECT);
                if (listener != null) {
                    listener.childrendAppendedOrMoved(movedOrAppended);
                    listenerInvoked = true;
                }

            }
        } finally {
            lock.unlock();
        }

        if (listenerInvoked) {
            final PushQueue pushQueue = sharedObject
                    .getPushQueue(ACCESS_OBJECT);
            if (pushQueue != null) {
                pushQueue.push();
            }
        }

    }
prepends the given children to the first position of the current children
of this object. <br>
Eg:-

<pre>
Div div = new Div(null, new Id("one")) {
{
new Div(this, new Id("child1"));
}
};

Span span = new Span(null);

P p = new P(null);

Br br = new Br(null);

div.prependChildren(span, p, br);

System.out.println(div.toHtmlString());

</pre>

This prints

<pre>
&lt;div id=&quot;one&quot;&gt;
&lt;span&gt;&lt;/span&gt;
&lt;p&gt;&lt;/p&gt;
&lt;br/&gt;
&lt;div id=&quot;child1&quot;&gt;&lt;/div&gt;
&lt;/div&gt;
</pre>

@param children
children to prepend in this object's existing
children.
@author WFF
@since 3.0.1