001 package org.apache.tapestry.internal;
002
003 import org.apache.tapestry.IRender;
004
005 /**
006 * Represents the <em>internal</em> component api exposed for use by core framework code only.
007 *
008 * <p>
009 * Use at your own risk as everything in this API is subject to change without notice from release to
010 * release.
011 * </p>
012 */
013 public interface Component {
014
015 /**
016 * Returns the list of of {@link IRender} elements contained by this component. Ie whatever
017 * has been added via {@link org.apache.tapestry.IComponent#addBody(IRender)}.
018 *
019 * @return The values, if any. Null otherwise.
020 */
021 IRender[] getContainedRenderers();
022
023 /**
024 * In some rare cases a component has both outer and inner renderers - such as with {@link org.apache.tapestry.BaseComponent}. This
025 * value should return the normal inner renderers most components do in those instances while the other
026 * {@link #getContainedRenderers()} should return the outer renderers.
027 *
028 * @return The inner renderers if this component supports more than one type, null otherwise.
029 */
030 IRender[] getInnerRenderers();
031
032 /**
033 * Checks if this component has been targeted / connected to for client side
034 * event listening via @EventListener.
035 *
036 * @return True if anything has targeted this component, false otherwise.
037 */
038 boolean hasEvents();
039
040 /**
041 * Sets whether or not this component has events.
042 *
043 * @param hasEvents Whether or not this component has connected events.
044 */
045 void setHasEvents(boolean hasEvents);
046 }