content: /**
   * <copyright>
   *
   * Copyright (c) 2009 IBM Corporation and others.
   * All rights reserved.   This program and the accompanying materials
   * are made available under the terms of the Eclipse Public License v1.0
   * which accompanies this distribution, and is available at
   * http://www.eclipse.org/legal/epl-v10.html
   * 
   * Contributors: 
   *   IBM - Initial API and implementation
   *
   * </copyright>
   *
   * $Id: DeepContentTag.java,v 1.1 2009/03/16 14:42:30 pelder Exp $
   */
  package org.eclipse.jet.internal.taglib.control;
  
  import org.eclipse.jet.BufferedJET2Writer;
  import org.eclipse.jet.JET2Context;
  import org.eclipse.jet.JET2Writer;
  import org.eclipse.jet.taglib.AbstractEmptyTag;
  import org.eclipse.jet.taglib.CustomTag;
  import org.eclipse.jet.taglib.JET2TagException;
  import org.eclipse.jet.taglib.TagInfo;
  
  /**
   * @author pelder
   */
  public class DeepContentTag extends AbstractEmptyTag
  {
  
    /**
     * 
     */
    public DeepContentTag()
    {
    }
  
    /* (non-Javadoc)
     * @see org.eclipse.jet.taglib.EmptyTag#doAction(org.eclipse.jet.taglib.TagInfo, org.eclipse.jet.JET2Context, org.eclipse.jet.JET2Writer)
     */
    public void doAction(TagInfo td, JET2Context context, JET2Writer out) throws JET2TagException
    {
      for(CustomTag parent = getParent(); parent != null; parent = parent.getParent()) {
        if(parent instanceof DeepIterateTag) {
          ((DeepIterateTag)parent).markContentInsertionPoint((BufferedJET2Writer)out);
          return;
        }
      }
      throw new JET2TagException(Messages.DeepContentTag_MustBeContainedByDeepIterate);
    }
  
  }
  