org.sweble.wikitext.lazy.parser.Section 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.*;
/**
* Section
*/
public class Section
extends InnerNode.InnerNode2
{
private static final long serialVersionUID = 1L;
// =========================================================================
public Section()
{
super(new NodeList(), new NodeList());
}
public Section(int level, NodeList title, NodeList body)
{
super(title, body);
setLevel(level);
}
@Override
public int getNodeType()
{
return org.sweble.wikitext.lazy.AstNodeTypes.NT_SECTION;
}
// =========================================================================
// Properties
private int level;
public final int getLevel()
{
return this.level;
}
public final int setLevel(int level)
{
int old = this.level;
this.level = level;
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 "level";
default:
throw new IndexOutOfBoundsException();
}
}
@Override
protected Object getValue(int index)
{
switch (index)
{
case 0:
return Section.this.getLevel();
default:
throw new IndexOutOfBoundsException();
}
}
@Override
protected Object setValue(int index, Object value)
{
switch (index)
{
case 0:
return Section.this.setLevel((Integer) value);
default:
throw new IndexOutOfBoundsException();
}
}
};
}
// =========================================================================
// Children
public final void setTitle(NodeList title)
{
set(0, title);
}
public final NodeList getTitle()
{
return (NodeList) get(0);
}
public final void setBody(NodeList body)
{
set(1, body);
}
public final NodeList getBody()
{
return (NodeList) get(1);
}
private static final String[] CHILD_NAMES = new String[] {"title", "body"};
public final String[] getChildNames()
{
return CHILD_NAMES;
}
// =========================================================================
}