// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
// 
// 	String getId();
// 	
// 	String getTitle();
// 	Attribute setTitle(String title);
// 	
// 	AttributeType getAttributeType();
// 	
// 	boolean hasDefaultValue();
// 	Attribute clearDefaultValue();
// 	String getDefaultValue();
// 	Attribute setDefaultValue(String defaultValue);
// 	
// 	List<String> getOptions();
// 	
// 	AttributeValue createValue(String value);
// }
// 
// Path: src/main/java/com/ojn/gexf4j/core/data/AttributeList.java
// public interface AttributeList extends List<Attribute>, Dynamic<AttributeList> {
// 	
// 	AttributeClass getAttributeClass();
// 	
// 	Mode getMode();
// 	AttributeList setMode(Mode mode);
// 	
// 	Attribute createAttribute(AttributeType type, String title);
// 	Attribute createAttribute(String id, AttributeType type, String title);
// 	
// 	AttributeList addAttribute(AttributeType type, String title);
// 	AttributeList addAttribute(String id, AttributeType type, String title);
// }


import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeList;
package com.ojn.gexf4j.core.impl.writer;



public class AttributesEntityWriter extends DynamicEntityWriter<AttributeList> {
	private static final String ENTITY = "attributes";
	private static final String ATTRIB_CLASS = "class";
	private static final String ATTRIB_MODE = "mode";
	
	public AttributesEntityWriter(XMLStreamWriter writer, AttributeList entity) {
		super(writer, entity);
		
		if (!entity.isEmpty()) {
			write();
		}
	}

	@Override
	protected String getElementName() {
		return ENTITY;
	}

	@Override
	protected void writeAttributes() throws XMLStreamException {
		writer.writeAttribute(
				ATTRIB_CLASS,
				entity.getAttributeClass().toString().toLowerCase());

		writer.writeAttribute(
				ATTRIB_MODE,
				entity.getMode().toString().toLowerCase());
	}

	@Override
	protected void writeElements() throws XMLStreamException {
// Path: src/main/java/com/ojn/gexf4j/core/data/Attribute.java
// public interface Attribute {
// 
// 	String getId();
// 	
// 	String getTitle();
// 	Attribute setTitle(String title);
// 	
// 	AttributeType getAttributeType();
// 	
// 	boolean hasDefaultValue();
// 	Attribute clearDefaultValue();
// 	String getDefaultValue();
// 	Attribute setDefaultValue(String defaultValue);
// 	
// 	List<String> getOptions();
// 	
// 	AttributeValue createValue(String value);
// }
// 
// Path: src/main/java/com/ojn/gexf4j/core/data/AttributeList.java
// public interface AttributeList extends List<Attribute>, Dynamic<AttributeList> {
// 	
// 	AttributeClass getAttributeClass();
// 	
// 	Mode getMode();
// 	AttributeList setMode(Mode mode);
// 	
// 	Attribute createAttribute(AttributeType type, String title);
// 	Attribute createAttribute(String id, AttributeType type, String title);
// 	
// 	AttributeList addAttribute(AttributeType type, String title);
// 	AttributeList addAttribute(String id, AttributeType type, String title);
// }


// Path: src/main/java/com/ojn/gexf4j/core/impl/writer/AttributesEntityWriter.java
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
import com.ojn.gexf4j.core.data.Attribute;
import com.ojn.gexf4j.core.data.AttributeList;

package com.ojn.gexf4j.core.impl.writer;



public class AttributesEntityWriter extends DynamicEntityWriter<AttributeList> {
	private static final String ENTITY = "attributes";
	private static final String ATTRIB_CLASS = "class";
	private static final String ATTRIB_MODE = "mode";
	
	public AttributesEntityWriter(XMLStreamWriter writer, AttributeList entity) {
		super(writer, entity);
		
		if (!entity.isEmpty()) {
			write();
		}
	}

	@Override
	protected String getElementName() {
		return ENTITY;
	}

	@Override
	protected void writeAttributes() throws XMLStreamException {
		writer.writeAttribute(
				ATTRIB_CLASS,
				entity.getAttributeClass().toString().toLowerCase());

		writer.writeAttribute(
				ATTRIB_MODE,
				entity.getMode().toString().toLowerCase());
	}

	@Override
	protected void writeElements() throws XMLStreamException {
		for (Attribute attrib : entity) {