<xsl:variable name="lcletters" select="'abcdefghijklmnopqrstuvwxyz-:'" />
<xsl:variable name="ucletters" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ__'" />
<xsl:variable name="enum" select="translate($prop/name, $lcletters, $ucletters)"/>
-<xsl:text> </xsl:text><xsl:value-of select="$htname"/>[PR_<xsl:value-of select="$enum"/>] =<xsl:value-of select="$makerclass"/>.maker("<xsl:value-of select="$prop/name"/>");
+<xsl:text> </xsl:text><xsl:value-of select="$htname"/>[PR_<xsl:value-of select="$enum"/>] =<xsl:value-of select="$makerclass"/>.maker(PR_<xsl:value-of select="$enum"/>);
<xsl:text> addPropertyName("</xsl:text><xsl:value-of select="$prop/name"/>", PR_<xsl:value-of select="$enum"/>);
</xsl:template>
return i.intValue();
}
+ // returns a property, compound, or property.compound name
public static String getPropertyName(int id) {
- return (String) s_htPropIds.get(new Integer(id));
+ if (((id & Constants.COMPOUND_MASK) == 0)
+ || ((id & Constants.PROPERTY_MASK) == 0)) {
+ return (String) s_htPropIds.get(new Integer(id));
+ } else {
+ return (String) s_htPropIds.get(new Integer(
+ id & Constants.PROPERTY_MASK)) + "." + s_htPropIds.get(
+ new Integer(id & Constants.COMPOUND_MASK));
+ }
}
static {
<xsl:text> {
SP_</xsl:text>
<xsl:value-of select="$spname"/>
- <xsl:text>Maker(String sPropName) {
+ <xsl:text>Maker(int sPropName) {
super(sPropName);
}</xsl:text>
<xsl:for-each select="enumeration/value">
<xsl:value-of select="$spname"/>
<xsl:text>Maker =
new SP_</xsl:text><xsl:value-of select="$spname"/>
- <xsl:text>Maker("</xsl:text>
- <xsl:value-of select='../../name'/>
- <xsl:text>.</xsl:text>
- <xsl:value-of select='name'/>
- <xsl:text>");</xsl:text>
+ <xsl:text>Maker(</xsl:text>
+ <xsl:if test="not(../../@type = 'generic')">
+ <xsl:text>Constants.PR_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="../../name"/>
+ </xsl:call-template>
+ <xsl:text> | </xsl:text>
+ </xsl:if>
+ <xsl:text>Constants.CP_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="name"/>
+ </xsl:call-template>
+ <xsl:text>);</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>
<xsl:value-of select="$spname"/>
<xsl:text>Maker =
new </xsl:text><xsl:value-of select="$sp_superclass"/>
- <xsl:text>("</xsl:text>
- <xsl:value-of select='../../name'/>
- <xsl:text>.</xsl:text>
- <xsl:value-of select='name'/>
- <xsl:text>");</xsl:text>
+ <xsl:text>(</xsl:text>
+ <xsl:if test="not(../../@type = 'generic')">
+ <xsl:text>Constants.PR_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="../../name"/>
+ </xsl:call-template>
+ <xsl:text> | </xsl:text>
+ </xsl:if>
+ <xsl:text>Constants.CP_</xsl:text>
+ <xsl:call-template name="makeEnumConstant">
+ <xsl:with-param name="propstr" select="name"/>
+ </xsl:call-template>
+ <xsl:text>);</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text>
- static public Property.Maker maker(String propName) {
+ static public Property.Maker maker(int propertyId) {
return new </xsl:text>
<xsl:value-of select="$classname"/>
- <xsl:text>(propName);
+ <xsl:text>(propertyId);
}
protected </xsl:text>
<xsl:value-of select="$classname"/>
- <xsl:text>(String name) {
- super(name);</xsl:text>
+ <xsl:text>(int propId) {
+ super(propId);</xsl:text>
<xsl:if test="compound">
<xsl:text>
m_shorthandMaker= getSubpropMaker("</xsl:text>
public static class Maker extends Property.Maker {
- public Maker(String propName) {
- super(propName);
+ public Maker(int propId) {
+ super(propId);
}
public Property convertProperty(Property p,
/**
* @param propName name of property for which a Maker should be created
*/
- public Maker(String propName) {
- super(propName);
+ public Maker(int propId) {
+ super(propId);
}
public Property make(PropertyList propertyList, String value,
/**
* @param propName name of property for which a Maker should be created
*/
- public Maker(String propName) {
- super(propName);
+ public Maker(int propId) {
+ super(propId);
}
public Property convertProperty(Property p,
/**
* @param name of property for which a Maker should be created
*/
- public Maker(String name) {
- super(name);
+ public Maker(int propId) {
+ super(propId);
}
}
/**
* @param propName name of property for which a Maker should be created
*/
- protected Maker(String propName) {
- super(propName);
+ protected Maker(int propId) {
+ super(propId);
}
/**
/**
* @param name name of property for which Maker should be created
*/
- protected Maker(String name) {
- super(name);
+ protected Maker(int propId) {
+ super(propId);
}
}
/**
* @param name name of property for which this Maker should be created
*/
- protected Maker(String name) {
- super(name);
+ protected Maker(int propId) {
+ super(propId);
}
}
/**
* @param name name of property for which Maker should be created
*/
- public /* protected */ Maker(String name) {
- super(name);
+ public Maker(int propId) {
+ super(propId);
}
/**
/**
* @param name name of property for which to create Maker
*/
- protected Maker(String name) {
- super(name);
+ protected Maker(int propId) {
+ super(propId);
}
}
/**
* @param name name of property for which Maker should be created
*/
- public Maker(String name) {
- super(name);
+ public Maker(int propId) {
+ super(propId);
}
/**
* Constructor for NumberProperty.Maker
* @param propName the name of the property
*/
- public Maker(String propName) {
- super(propName);
+ public Maker(int propId) {
+ super(propId);
}
/**
import org.apache.fop.fo.expr.Numeric;
import org.apache.fop.fo.expr.PropertyParser;
import org.apache.fop.fo.expr.PropertyInfo;
+import org.apache.fop.fo.properties.Constants;
+import org.apache.fop.fo.properties.FOPropertyMapping;
import org.apache.fop.apps.FOPException;
import java.util.Vector;
* @author unascribed
*/
public static class Maker {
- private static final String UNKNOWN = "UNKNOWN";
- private String propName;
+ private int propId;
/**
* @return the name of the property for this Maker
*/
protected String getPropName() {
- return propName;
+ return FOPropertyMapping.getPropertyName(this.propId);
}
/**
* Construct an instance of a Property.Maker for the given property.
- * @param propName The name of the property to be made.
+ * @param propId The Constant ID of the property to be made.
*/
- protected Maker(String propName) {
- this.propName = propName;
+ protected Maker(int propId) {
+ this.propId = propId;
}
/**
* Note: the property name is set to "UNKNOWN".
*/
protected Maker() {
- this.propName = UNKNOWN;
+ this.propId = 0;
}
}
return pret;
} catch (org.apache.fop.fo.expr.PropertyException propEx) {
- throw new FOPException("Error in " + propName
+ String propName = FOPropertyMapping.getPropertyName(this.propId);
+ throw new FOPException("Error in " + propName
+ " property value '" + value + "': "
+ propEx);
}
if (inheritsSpecified()) {
// recalculate based on last specified value
// Climb up propertylist and find last spec'd value
- // NEED PROPNAME!!! get from Maker
+ String propName = FOPropertyMapping.getPropertyName(this.propId);
Property specProp =
propertyList.getNearestSpecified(propName);
if (specProp != null) {
/**
* @param name name of the property whose Maker is to be created
*/
- protected Maker(String name) {
- super(name);
+ protected Maker(int propId) {
+ super(propId);
}
}
/**
* @param propName name of property for which to create a Maker
*/
- public Maker(String propName) {
- super(propName);
+ public Maker(int propId) {
+ super(propId);
}
/**