001/*
002 *  Copyright 2011 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016
017package org.ametys.cms.transformation.dom;
018
019import java.util.HashMap;
020import java.util.Map;
021
022import org.w3c.dom.Node;
023
024import org.ametys.core.util.dom.AbstractWrappingAmetysElement;
025import org.ametys.core.util.dom.AmetysAttribute;
026
027/**
028 * DOM element representing a tag.
029 */
030public class TagElement extends AbstractWrappingAmetysElement<String>
031{
032    /**
033     * Constructor.
034     * @param name the tag name.
035     */
036    public TagElement(String name)
037    {
038        super(name);
039    }
040
041    @Override
042    public String getTagName()
043    {
044        return "tag";
045    }
046    
047    @Override
048    protected Map<String, AmetysAttribute> _lookupAttributes()
049    {
050        Map<String, AmetysAttribute> result = new HashMap<>();
051        
052        result.put("name", new AmetysAttribute("name", "name", null, _object, this));
053        
054        return result;
055    }
056    
057    @Override
058    public boolean hasChildNodes()
059    {
060        return false;
061    }
062    
063    @Override
064    public Node getFirstChild()
065    {
066        return null;
067    }
068    
069    @Override
070    public Node getNextSibling()
071    {
072        return null;
073    }
074}