/** * Returns the matching object for the given string * * @param enumString * @param exceptionIfNoMatch whether to throw an exception if there was no match * @return * @throws IllegalArgumentException if no matching enumeration object was found and * exceptionIfNoMatch is true */ public static VerticalAlign fromString(String enumString, boolean exceptionIfNoMatch) { for (VerticalAlign attrEnum : values()) { if (attrEnum.label.equals(enumString) || attrEnum.name().equals(enumString)) return attrEnum; } if (exceptionIfNoMatch) { throw new IllegalArgumentException( "No matching enum constant found in '" + VerticalAlign.class.getSimpleName() + "' for: " + enumString); } else { return null; } }
protected void apply(PdfPCell cell, RenderingContext context, PJsonObject params) { if (paddingLeft != null) cell.setPaddingLeft(paddingLeft.floatValue()); if (paddingRight != null) cell.setPaddingRight(paddingRight.floatValue()); if (paddingTop != null) cell.setPaddingTop(paddingTop.floatValue()); if (paddingBottom != null) cell.setPaddingBottom(paddingBottom.floatValue()); if (borderWidthLeft != null) cell.setBorderWidthLeft(borderWidthLeft.floatValue()); if (borderWidthRight != null) cell.setBorderWidthRight(borderWidthRight.floatValue()); if (borderWidthTop != null) cell.setBorderWidthTop(borderWidthTop.floatValue()); if (borderWidthBottom != null) cell.setBorderWidthBottom(borderWidthBottom.floatValue()); if (getBorderColorLeftVal(context, params) != null) cell.setBorderColorLeft(getBorderColorLeftVal(context, params)); if (getBorderColorRightVal(context, params) != null) cell.setBorderColorRight(getBorderColorRightVal(context, params)); if (getBorderColorTopVal(context, params) != null) cell.setBorderColorTop(getBorderColorTopVal(context, params)); if (getBorderColorBottomVal(context, params) != null) cell.setBorderColorBottom(getBorderColorBottomVal(context, params)); if (getBackgroundColorVal(context, params) != null) cell.setBackgroundColor(getBackgroundColorVal(context, params)); if (align != null) cell.setHorizontalAlignment(align.getCode()); if (vertAlign != null) cell.setVerticalAlignment(vertAlign.getCode()); }