@Override public String toString() { return separator == ' ' ? " " : MessageFormatUtil.format(" {0} ", separator); } }
@Override public String toString() { return MessageFormatUtil.format(":prev*{0}", evaluator); } }
@Override public String toString() { return MessageFormatUtil.format("{0}={1}", key, value); } }
@Override public String toString() { return MessageFormatUtil.format(":matchesOwn({0}", pattern); } }
@Override public String toString() { return MessageFormatUtil.format("@{0} {1};", ruleName, ruleParams); } }
@Override public String toString() { return MessageFormatUtil.format(":prev{0}", evaluator); } }
@Override public String toString() { return MessageFormatUtil.format((unitType == PERCENT ? "{0}%" : "{0}pt"), value); } }
public byte get(int index) { if (index >= count) { throw new IndexOutOfBoundsException(MessageFormatUtil.format("Index: {0}, Size: {1}", index, count)); } return buffer[index]; }
/** * Creates a VerificationException */ public VerificationException(Certificate cert, String message) { super(MessageFormatUtil.format("Certificate {0} failed: {1}", cert == null ? "Unknown" : ((X509Certificate) cert).getSubjectDN().getName(), message)); } }
/** * {@inheritDoc} */ @Override public String getMessage() { if (messageParams == null || messageParams.size() == 0) { return super.getMessage(); } else { return MessageFormatUtil.format(super.getMessage(), getMessageParams()); } }
@Override public String getMessage() { if (messageParams == null || messageParams.size() == 0) { return super.getMessage(); } else { return MessageFormatUtil.format(super.getMessage(), getMessageParams()); } }
/** * {@inheritDoc} */ @Override public String getMessage() { if (messageParams == null || messageParams.size() == 0) { return super.getMessage(); } else { return MessageFormatUtil.format(super.getMessage(), getMessageParams()); } }
public static OtfClass create(RandomAccessFileOrArray rf, int classLocation) { OtfClass otfClass; try { otfClass = new OtfClass(rf, classLocation); } catch (IOException e) { Logger logger = LoggerFactory.getLogger(OtfClass.class); logger.error(MessageFormatUtil.format(LogMessageConstant.OPENTYPE_GDEF_TABLE_ERROR, e.getMessage())); otfClass = null; } return otfClass; }
private static float getModelBottomMargin(IRenderer renderer) { UnitValue marginUV = renderer.getModelElement().<UnitValue>getProperty(Property.MARGIN_BOTTOM); if (null != marginUV && !marginUV.isPointValue()) { Logger logger = LoggerFactory.getLogger(MarginsCollapseHandler.class); logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.MARGIN_TOP)); } // TODO Concerning "renderer instanceof CellRenderer" check: may be try to apply more general solution in future return marginUV != null && !(renderer instanceof CellRenderer) ? marginUV.getValue() : 0; }
private static boolean hasTopPadding(IRenderer renderer) { UnitValue padding = renderer.getModelElement().<UnitValue>getProperty(Property.PADDING_TOP); if (null != padding && !padding.isPointValue()) { Logger logger = LoggerFactory.getLogger(MarginsCollapseHandler.class); logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.PADDING_TOP)); } return padding != null && padding.getValue() > 0; }
private static float getModelTopMargin(IRenderer renderer) { UnitValue marginUV = renderer.getModelElement().<UnitValue>getProperty(Property.MARGIN_TOP); if (null != marginUV && !marginUV.isPointValue()) { Logger logger = LoggerFactory.getLogger(MarginsCollapseHandler.class); logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.MARGIN_TOP)); } // TODO Concerning "renderer instanceof CellRenderer" check: may be try to apply more general solution in future return marginUV != null && !(renderer instanceof CellRenderer) ? marginUV.getValue() : 0; }
private boolean compareNamesExtended(PdfName outName, PdfName cmpName, ObjectPath currentPath, CompareResult compareResult) { if (cmpName.equals(outName)) { return true; } else { if (compareResult != null && currentPath != null) compareResult.addError(currentPath, MessageFormatUtil.format("PdfName. Expected: {0}. Found: {1}", cmpName.toString(), outName.toString())); return false; } }
protected float calculateLineWidth() { UnitValue fontSize = this.getPropertyAsUnitValue(Property.FONT_SIZE); if (!fontSize.isPointValue()) { Logger logger = LoggerFactory.getLogger(TextRenderer.class); logger.error(MessageFormatUtil.format(LogMessageConstant.PROPERTY_IN_PERCENTS_NOT_SUPPORTED, Property.FONT_SIZE)); } return getGlyphLineWidth(line, fontSize.getValue(), (float) this.getPropertyAsFloat(Property.HORIZONTAL_SCALING, 1f), this.getPropertyAsFloat(Property.CHARACTER_SPACING), this.getPropertyAsFloat(Property.WORD_SPACING)); }
static byte[] readFontBytesFromPath(String path) throws java.io.IOException { RandomAccessFileOrArray raf = new RandomAccessFileOrArray(new RandomAccessSourceFactory().createBestSource(path)); int bufLen = (int) raf.length(); if (bufLen < raf.length()) { throw new IOException(MessageFormatUtil.format("Source data from \"{0}\" is bigger than byte array can hold.", path)); } byte[] buf = new byte[bufLen]; raf.readFully(buf); return buf; } }