//----------------------------BEGIN LICENSE----------------------------
/* 
 * Willow : the Open Source WorkFlow Project
 * Distributable under GNU LGPL license by gun.org
 *
 * Copyright (C) 2004-2010 huihoo.org 
 * Copyright (C) 2004-2010  ZosaTapo <dertyang@hotmail.com> 
 * 
 * ====================================================================
 * Project Homepage : http://www.huihoo.org/willow
 * Source Forge     : http://sourceforge.net/projects/huihoo
 * Mailing list     : willow@lists.sourceforge.net 
 */
//----------------------------END  LICENSE-----------------------------
package org.huihoo.workflow.xpdl;

import org.huihoo.workflow.WorkflowSimpleComponent;
import org.huihoo.workflow.WorkflowXPDLComponent;

public class ExtendedAttribute extends WorkflowSimpleComponent implements WorkflowXPDLComponent
{
	protected String value;
  
	/** 
	 * Construct a new ExtendedAttribute.
	 */
	public ExtendedAttribute()
	{
		this(null, null);
	}

	/** 
	 * Construct a new ExtendedAttribute.
	 *
	 * @param uuid_ The element ID
	 * @param name The element name
	 */
	public ExtendedAttribute(String name, String value)
	{
		this(name,name, value);
	}

	/** 
	 * Construct a new ExtendedAttribute.
	 *
	 * @param uuid_       The element ID
	 * @param name        The element name
	 * @param value       The element value
	 */
	public ExtendedAttribute(String uuid_, String name, String value)
	{
		this(uuid_,name,value,null);
	}

	/** 
	 * Construct a new ExtendedAttribute.
	 *
	 * @param uuid_       The element ID
	 * @param name        The element name
	 * @param value       The element value
	 * @param description The element description
	 */
	public ExtendedAttribute(String uuid_, String name, String value,String description)
	{
		super(uuid_,name,description);
		this.value=value;
	}
		
  public void setValue(String value_)
  {
    this.value=value_;
  }
  
  public String getValue()
  {
    return (this.value);
  }
  
  public String toString()
 	{
 		StringBuffer buffer=new StringBuffer();
 		
 		if(uuid != null)
 		{
			buffer.append(" UUID = "+uuid);
 		}
 		else
 		{
			buffer.append(" UUID = <NULL>");
 		}
 		
		buffer.append(" ; ");
		
		if(name != null)
		{
			buffer.append(" Name = "+name);
		}
		else
		{
			buffer.append(" Name = <NULL>");
		}
		buffer.append(" ; ");

		if(value != null)
		{
			buffer.append(" Value = "+value);
		}
		else
		{
			buffer.append(" Value = <NULL>");
		}
						
 		return buffer.toString();
 	}


	public String getTagName()
	{
		return "ExtendedAttribute";
	}
}
