org.sweble.wikitext.lazy.parser.XmlElementEmpty Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swc-parser-lazy Show documentation
Show all versions of swc-parser-lazy Show documentation
A parser for MediaWiki's Wikitext.
/*
* This file is auto-generated.
* DO NOT MODIFY MANUALLY!
*
* Generated by AstNodeGenerator.
* Last generated: 2014-09-12 00:37:37.
*/
package org.sweble.wikitext.lazy.parser;
import de.fau.cs.osr.ptk.common.ast.*;
/**
* Empty XML Element
*/
public class XmlElementEmpty
extends InnerNode.InnerNode1
implements NamedXmlElement
{
private static final long serialVersionUID = 1L;
// =========================================================================
public XmlElementEmpty()
{
super(new NodeList());
}
public XmlElementEmpty(String name, NodeList xmlAttributes)
{
super(xmlAttributes);
setName(name);
}
@Override
public int getNodeType()
{
return org.sweble.wikitext.lazy.AstNodeTypes.NT_XML_TAG_EMPTY;
}
// =========================================================================
// Properties
private String name;
public final String getName()
{
return this.name;
}
public final String setName(String name)
{
String old = this.name;
this.name = name;
return old;
}
@Override
public final int getPropertyCount()
{
return 1;
}
@Override
public final AstNodePropertyIterator propertyIterator()
{
return new AstNodePropertyIterator()
{
@Override
protected int getPropertyCount()
{
return 1;
}
@Override
protected String getName(int index)
{
switch (index)
{
case 0:
return "name";
default:
throw new IndexOutOfBoundsException();
}
}
@Override
protected Object getValue(int index)
{
switch (index)
{
case 0:
return XmlElementEmpty.this.getName();
default:
throw new IndexOutOfBoundsException();
}
}
@Override
protected Object setValue(int index, Object value)
{
switch (index)
{
case 0:
return XmlElementEmpty.this.setName((String) value);
default:
throw new IndexOutOfBoundsException();
}
}
};
}
// =========================================================================
// Children
public final void setXmlAttributes(NodeList xmlAttributes)
{
set(0, xmlAttributes);
}
public final NodeList getXmlAttributes()
{
return (NodeList) get(0);
}
private static final String[] CHILD_NAMES = new String[] {"xmlAttributes"};
public final String[] getChildNames()
{
return CHILD_NAMES;
}
// =========================================================================
}