
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 TextAnchorMaker extends  EnumProperty.Maker implements TextAnchor {



  protected final static EnumProperty s_propSTART = new EnumProperty(START);

  protected final static EnumProperty s_propMIDDLE = new EnumProperty(MIDDLE);

  protected final static EnumProperty s_propEND = new EnumProperty(END);

  protected final static EnumProperty s_propINHERIT = new EnumProperty(INHERIT);


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

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

    }


   public boolean isInherited() { return true; }

    public Property checkEnumValues(String value) {
    
      if (value.equals("start")) { return s_propSTART; }
    
      if (value.equals("middle")) { return s_propMIDDLE; }
    
      if (value.equals("end")) { return s_propEND; }
    
      if (value.equals("inherit")) { return s_propINHERIT; }
    
	return super.checkEnumValues(value);
    }

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

}
