EmptyTypeImpl.java
package org.jboss.shrinkwrap.descriptor.impl.j2ee14;
import org.jboss.shrinkwrap.descriptor.spi.node.Node;
import org.jboss.shrinkwrap.descriptor.api.j2ee14.EmptyType;
import java.util.ArrayList;
import java.util.List;
import org.jboss.shrinkwrap.descriptor.api.Child;
import org.jboss.shrinkwrap.descriptor.impl.base.XMLDate;
import org.jboss.shrinkwrap.descriptor.impl.base.Strings;
import org.jboss.shrinkwrap.descriptor.api.DescriptorExporter;
/**
* This class implements the <code> emptyType </code> xsd type
*/
public class EmptyTypeImpl<T> implements Child<T>, EmptyType<T>
{
// -------------------------------------------------------------------------------------||
// Instance Members
// -------------------------------------------------------------------------------------||
private T t;
private Node childNode;
// -------------------------------------------------------------------------------------||
// Constructor
// -------------------------------------------------------------------------------------||
public EmptyTypeImpl(T t, String nodeName, Node node) {
this.t = t;
this.childNode = node.createChild(nodeName);
}
public EmptyTypeImpl(T t, String nodeName, Node node, Node childNode) {
this.t = t;
this.childNode = childNode;
}
public T up()
{
return t;
}
// --------------------------------------------------------------------------------------------------------||
// ClassName: EmptyType ElementName: xsd:ID ElementType : id
// MaxOccurs: - isGeneric: true isAttribute: true isEnum: false isDataType: true
// --------------------------------------------------------------------------------------------------------||
/**
* Sets the <code>id</code> attribute
* @param id the value for the attribute <code>id</code>
* @return the current instance of <code>EmptyType<T></code>
*/
public EmptyType<T> id(String id)
{
childNode.attribute("id", id);
return this;
}
/**
* Returns the <code>id</code> attribute
* @return the value defined for the attribute <code>id</code>
*/
public String getId()
{
return childNode.getAttribute("id");
}
/**
* Removes the <code>id</code> attribute
* @return the current instance of <code>EmptyType<T></code>
*/
public EmptyType<T> removeId()
{
childNode.removeAttribute("id");
return this;
}
}