/** Converts an instance of {@link Locator} to {@link Location}. * If loc is null, this method returns null. */ public static Location toLocation(Locator loc) { return loc != null ? new Loc(combine(loc.getPublicId(), loc.getSystemId()), loc.getLineNumber(), loc.getColumnNumber()): null; } /** Converts an instance of {@link org.xml.sax.Locator} to {@link Location}.
/** Formats the message with the location information. * @param loc the location information. Ignored if null. */ public static String format(String message, Locator loc) { return loc != null ? format(message, loc.getPublicId(), loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber()): message; } /** Formats the message with the location information.
private static String message(String message, org.zkoss.xml.Locator loc) { return org.zkoss.xml.Locators.format(message, loc); }
/** Appends an attribute to the string buffer, * if <code>attrValue</code> is not null. */ protected static final void append(StringBuffer sb, String attrName, String attrValue) { if (attrValue != null) sb.append(' ').append(attrName).append("=\"").append(XMLs.encodeAttribute(attrValue)).append('"'); //it might contain " or other special characters }
/** * Internal Use Only. */ private static String escapeParam(String param) { return Strings.escape(XMLs.encodeText(param), Strings.ESCAPE_JAVASCRIPT); }
/** Converts an instance of {@link org.xml.sax.Locator} to {@link Location}. * If loc is null, this method returns null. */ public static Location toLocation(org.xml.sax.Locator loc) { return loc != null ? new Loc(combine(loc.getPublicId(), loc.getSystemId()), loc.getLineNumber(), loc.getColumnNumber()): null; } /** Converts an instance of {@link SourceLocator} to {@link Location}.
private static org.zkoss.util.resource.Location location(org.zkoss.idom.Item el) { return org.zkoss.xml.Locators.toLocation(el != null ? el.getLocator() : null); }
private static final void writeAttr(Writer out, String name, String value) throws IOException { out.write(' '); out.write(name); out.write("=\""); out.write(XMLs.encodeAttribute(value)); out.write('"'); } }
public String format(String message) { return org.zkoss.xml.Locators.format(message, _path, null, -1, -1); } }
/** Converts an instance of {@link SourceLocator} to {@link Location}. * If loc is null, this method returns null. */ public static Location toLocation(SourceLocator loc) { return loc != null ? new Loc(combine(loc.getPublicId(), loc.getSystemId()), loc.getLineNumber(), loc.getColumnNumber()): null; } private static class Loc implements Location, java.io.Serializable {
private static org.zkoss.util.resource.Location location(Item el) { return org.zkoss.xml.Locators.toLocation(el != null ? el.getLocator() : null); }
private static final void writeAttr(Writer out, String name, String value) throws IOException { out.write(' '); out.write(name); out.write("=\""); out.write(XMLs.encodeAttribute(value)); out.write('"'); }
private static String message(String message, Locator loc) { return org.zkoss.xml.Locators.format(message, loc); }
/** Appends an attribute to the string buffer for HTML/XML (name="val"). * If val is null or empty (if String), nothing is generated. * * <p>Note: {@link XMLs#encodeAttribute} is called automatically * to encode val. */ public static final void appendAttribute(StringBuffer sb, String name, String val) { if (val != null && val.length() != 0) sb.append(' ').append(name).append("=\"") .append(XMLs.encodeAttribute(val)).append('"'); } /** Appends an attribute to the string buffer for HTML/XML (name="val").
public String format(String message) { return Locators.format(message, _path, null, _lnno, -1); }
/** Formats the message with the location information. * @param loc the location information. Ignored if null. */ public static String format(String message, org.xml.sax.Locator loc) { return loc != null ? format(message, loc.getPublicId(), loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber()): message; } /** Formats the message with the location information.
private static String message(String message, org.zkoss.idom.Item el) { return org.zkoss.xml.Locators.format(message, el != null ? el.getLocator() : null); }
private static String message(String message, Item el) { return org.zkoss.xml.Locators.format(message, el != null ? el.getLocator() : null); }
private static String message(String message, org.zkoss.idom.Item el) { return org.zkoss.xml.Locators.format(message, el != null ? el.getLocator() : null); }
/** Formats the message with the location information. * @param loc the location information. Ignored if null. */ public static String format(String message, SourceLocator loc) { return loc != null ? format(message, loc.getPublicId(), loc.getSystemId(), loc.getLineNumber(), loc.getColumnNumber()): message; }