private boolean validImport(final String type) { return !Strings.isNullOrEmpty(type) && !Types.isPrimitive(type); }
/** * Format the given {@link String} as a Java source file, using the built in code format style. * * @param source the source to format * @return the formatted source code * @throws FormatterException if the source coudn't be formatted */ public static String format(String source) { Properties options = readConfigInternal(); return format(options, source); }
@Override public String format(String source) { return Formatter.format(source); }
@Override public String format(Properties properties, String source) { Properties shadedProperties = Formatter.applyShadedPackageName(properties); return Formatter.format(shadedProperties, source); } }
public JavaDocImpl(O origin, Javadoc javadoc) { Assert.notNull(javadoc, "Javadoc cannot be null"); this.origin = origin; this.javadoc = javadoc; }
public static boolean isQualified(final String className) { String[] tokens = tokenizeClassName(className); return (tokens != null) && (tokens.length > 1); }
private static Properties parseXmlConfig(InputStream stream) throws IOException { Properties properties = readConfigInternal(); Properties defaultProperties = FormatterProfileReader.fromEclipseXml(stream).getDefaultProperties(); properties.putAll(defaultProperties); return properties; } }
/** * Creates a new {@link FormatterProfileReader} instance * * @param inputStream a XML with the Eclipse Formatter format * @return * @throws IOException */ public static FormatterProfileReader fromEclipseXml(InputStream inputStream) throws IOException { return new FormatterProfileReader(inputStream); }
public static String enquote(final String value) { String result = null; if (value != null) { result = "\"" + StringEscapeUtils.escapeJava(value) + "\""; } return result; }
private boolean validImport(final String type) { return !Strings.isNullOrEmpty(type) && !Types.isPrimitive(type); }
/** * Format the given {@link String} as a Java source file, using the built in code format style. */ public static String format(String source) { Properties options = readConfigInternal(); return format(options, source); }
@Override public String format(Properties properties, String source) { Properties shadedProperties = Formatter.applyShadedPackageName(properties); return Formatter.format(shadedProperties, source); } }
/** * Format the given Java source {@link File}, using the built in code format style. * * @param source the file which contains the source to format * @throws FormatterException if the source coudn't be formatted * @throws IOException When the file cannot be read or written */ public static void format(File source) throws IOException { format(null, source); }
public static boolean isQualified(final String className) { String[] tokens = tokenizeClassName(className); return (tokens != null) && (tokens.length > 1); }
/** * Creates a new {@link FormatterProfileReader} instance * * @param inputStream a XML with the Eclipse Formatter format * @return * @throws IOException */ public static FormatterProfileReader fromEclipseXml(InputStream inputStream) throws IOException { return new FormatterProfileReader(inputStream); }
private boolean validImport(final String type) { return !Strings.isNullOrEmpty(type) && !Types.isPrimitive(type); }
public JavaDocImpl(O origin, Javadoc javadoc) { Assert.notNull(javadoc, "Javadoc cannot be null"); this.origin = origin; this.javadoc = javadoc; }
public static boolean isQualified(final String className) { String[] tokens = tokenizeClassName(className); return (tokens != null) && (tokens.length > 1); }