
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 SpreadMethodMaker extends  EnumProperty.Maker implements SpreadMethod {



  protected final static EnumProperty s_propPAD = new EnumProperty(PAD);

  protected final static EnumProperty s_propREFLECT = new EnumProperty(REFLECT);

  protected final static EnumProperty s_propREPEAT = new EnumProperty(REPEAT);


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

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

    }


   public boolean isInherited() { return false; }

    public Property checkEnumValues(String value) {
    
      if (value.equals("pad")) { return s_propPAD; }
    
      if (value.equals("reflect")) { return s_propREFLECT; }
    
      if (value.equals("repeat")) { return s_propREPEAT; }
    
	return super.checkEnumValues(value);
    }

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

}
