001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.acacia.client;
029
030/**
031 * Attribute handler interface.<p>
032 */
033public interface I_CmsAttributeHandler {
034
035    /**
036     * Returns the simple path.<p>
037     *
038     * @param childHandler the child attribute handler
039     *
040     * @return the simple path
041     */
042    String collectSimplePath(I_CmsAttributeHandler childHandler);
043
044    /**
045     * Returns the attribute name.<p>
046     *
047     * @return the attribute name
048     */
049    String getAttributeName();
050
051    /**
052     * Returns the handler for the given attribute at the given index.<p>
053     *
054     * @param attributeName the attribute name
055     * @param index the value index
056     *
057     * @return the handler
058     */
059    CmsAttributeHandler getChildHandler(String attributeName, int index);
060
061    /**
062     * Returns the child handler by simple name.<p>
063     *
064     * @param name the name
065     * @param index the value index
066     *
067     * @return the child handler if present
068     */
069    CmsAttributeHandler getChildHandlerBySimpleName(String name, int index);
070
071    /**
072     * Inserts a handler map at the given index.<p>
073     *
074     * @param index the value index
075     */
076    void insertHandlers(int index);
077
078    /**
079     * Removes the handlers at the given index.<p>
080     *
081     * @param index the value index
082     */
083    void removeHandlers(int index);
084
085    /**
086     * Sets a child attribute handler.<p>
087     *
088     * @param index the value index
089     * @param attributeName the attribute name
090     * @param handler the handler
091     */
092    void setHandler(int index, String attributeName, CmsAttributeHandler handler);
093
094    /**
095     * Sets the handler by id.<p>
096     *
097     * @param attributeName the attribute name
098     * @param handler the handler
099     */
100    void setHandlerById(String attributeName, CmsAttributeHandler handler);
101}