org.sweble.wikitext.lazy.preprocessor.TemplateArgument 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.preprocessor;
import de.fau.cs.osr.ptk.common.ast.*;
/**
* TemplateArgument
* Grammar
*/
public class TemplateArgument
extends InnerNode.InnerNode2
{
private static final long serialVersionUID = 1L;
// =========================================================================
public TemplateArgument()
{
super(new NodeList(), new NodeList());
}
public TemplateArgument(NodeList value, boolean hasName)
{
super(new NodeList(), value);
setHasName(hasName);
}
public TemplateArgument(NodeList name, NodeList value, boolean hasName)
{
super(name, value);
setHasName(hasName);
}
@Override
public int getNodeType()
{
return org.sweble.wikitext.lazy.AstNodeTypes.NT_TEMPLATE_ARGUMENT;
}
// =========================================================================
// Properties
private boolean hasName;
public final boolean getHasName()
{
return this.hasName;
}
public final boolean setHasName(boolean hasName)
{
boolean old = this.hasName;
this.hasName = hasName;
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 "hasName";
default:
throw new IndexOutOfBoundsException();
}
}
@Override
protected Object getValue(int index)
{
switch (index)
{
case 0:
return TemplateArgument.this.getHasName();
default:
throw new IndexOutOfBoundsException();
}
}
@Override
protected Object setValue(int index, Object value)
{
switch (index)
{
case 0:
return TemplateArgument.this.setHasName((Boolean) value);
default:
throw new IndexOutOfBoundsException();
}
}
};
}
// =========================================================================
// Children
public final void setName(NodeList name)
{
set(0, name);
}
public final NodeList getName()
{
return (NodeList) get(0);
}
public final void setValue(NodeList value)
{
set(1, value);
}
public final NodeList getValue()
{
return (NodeList) get(1);
}
private static final String[] CHILD_NAMES = new String[] {"name", "value"};
public final String[] getChildNames()
{
return CHILD_NAMES;
}
// =========================================================================
}