001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     * 
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017     
018    package org.apache.commons.betwixt.io;
019    
020    import org.apache.commons.betwixt.ElementDescriptor;
021    
022    /**
023     * <p>Context against which content should be written.</p>
024     * <p>
025     * <strong>Usage:</strong>
026     * This (logical) interface is a <em>Parameter Object</em>
027     * allowing additional, <code>Betwixt</code>-specific information
028     * to be passed through the SAX-inspired writing API.
029     * </p> 
030     * <p>
031     * It is likely that access will be required to methods in the
032     * <code>Context</code> used by the {@link AbstractBeanWriter}
033     * but it seems better to add these as neccessary using delegation
034     * rather than extending {@link org.apache.commons.betwixt.expression.Context}.
035     * </p>
036     * @author <a href='http://commons.apache.org/'>Apache Commons Team</a>
037     * @since 0.5
038     */
039    public abstract class WriteContext {
040        
041        /**
042         * Gets the descriptor for the element who content 
043         * is currently being created. 
044         * 
045         * @return the <code>ElementDescriptor</code> for the 
046         * current element (or null if there is no current element) 
047         */
048        public abstract ElementDescriptor getCurrentDescriptor();
049        
050    }