/*
 * JBoss, Home of Professional Open Source
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

package org.jboss.test.xml.mbeanserver;

import javax.xml.namespace.NamespaceContext;

/**
 * @author Scott.Stark@jboss.org
 * @version $Revision: 1.5 $
 */
public class MBeanAttribute
{
   /** The attribute name */
   private String name;
   /** The text value for a text based attribute element */
   private String text;
   /** The object value for an unmarshalled element */
   private Object value;
   /** The property replacement flag */
   private boolean replace;

   public String getName()
   {
      return name;
   }

   public void setName(String name)
   {
      //System.out.println("MBeanAttribute.name="+name);
      this.name = name;
   }

   public boolean getReplace()
   {
      return replace;
   }
   public void setReplace(boolean replace)
   {
      this.replace = replace;
   }

   public String getText()
   {
      return text;
   }
   public void setText(String text)
   {
      //System.out.println("MBeanAttribute("+name+").setText="+text);
      this.text = text;
   }

   public Object getValue()
   {
      return value;
   }
   public void setValue(Object value)
   {
      //System.out.println("MBeanAttribute("+name+").setValue="+value);
      this.value = value;
   }

   public static Object unmarshalStringValue(String text, NamespaceContext ctx)
   {
      //System.out.println("unmarshalStringValue, text"+text);
      return text == null ? null : text;
   }
}
