1 51 package org.apache.fop.fo; 52 53 import org.apache.fop.apps.FOPException; 54 import org.apache.fop.messaging.MessageHandler; 55 56 public class EnumProperty extends Property { 57 58 public static class Maker extends Property.Maker { 59 60 protected Maker(String propName) { 61 super(propName); 62 } 63 64 65 68 public Property checkEnumValues(String value) { 69 MessageHandler.errorln("Unknown enumerated value for property '" 70 + getPropName() + "': " + value); 71 return null; 72 } 73 74 protected Property findConstant(String value) { 75 return null; 76 } 77 78 public Property convertProperty(Property p, 79 PropertyList propertyList, 80 FObj fo) throws FOPException { 81 if (p instanceof EnumProperty) 82 return p; 83 else 84 return null; 85 } 86 87 } 88 89 private int value; 90 91 public EnumProperty(int explicitValue) { 92 this.value = explicitValue; 93 } 94 95 public int getEnum() { 96 return this.value; 97 } 98 99 public Object getObject() { 100 return new Integer (this.value); 103 } 104 105 } 106 | Popular Tags |