
package org.apache.fop.fo.properties;

import org.apache.fop.datatypes.*;
import org.apache.fop.fo.*;
import org.apache.fop.apps.FOPException;
import org.apache.fop.messaging.MessageHandler;

public class GenericUnits extends  EnumProperty.Maker {



  public interface Enums {

    int USER_SPACE_ON_USE = 1;

    int OBJECT_BOUNDING_BOX = 2;

  }

  protected final static EnumProperty s_propUSER_SPACE_ON_USE = new EnumProperty(Enums.USER_SPACE_ON_USE);

  protected final static EnumProperty s_propOBJECT_BOUNDING_BOX = new EnumProperty(Enums.OBJECT_BOUNDING_BOX);


    static public Property.Maker maker(String propName) {
	return new GenericUnits(propName);
    }

    protected GenericUnits(String name) {
	super(name);

    }


   public boolean isInherited() { return false; }

    public Property checkEnumValues(String value) {
    
      if (value.equals("userSpaceOnUse")) { return s_propUSER_SPACE_ON_USE; }
    
      if (value.equals("objectBoundingBox")) { return s_propOBJECT_BOUNDING_BOX; }
    
	return super.checkEnumValues(value);
    }

    private Property m_defaultProp=null;
  
    public Property make(PropertyList propertyList) throws FOPException {
      
        if (m_defaultProp == null) {
            m_defaultProp=make(propertyList, "userSpaceOnUse", propertyList.getParentFObj());
	}
        return m_defaultProp;
	
    }

}
