private void addClasses(final String property, List<String> classes, Type type,
final ComponentLibraryInfo info, JSONObject object)
{
if (classes.size() > 0)
{
JSONArray classesJsonArray = new JSONArray();
for (String logicalName : classes)
{
logicalName = logicalName.replace("core/", "");
final String className = getClassName(logicalName, type, componentClassResolver);
JSONObject classJsonObject = new JSONObject();
classJsonObject.put("logicalName", logicalName);
classJsonObject.put("class", className);
if (info != null)
{
putIfNotNull("sourceUrl", info.getSourceUrl(className), classJsonObject);
putIfNotNull("javadocUrl", info.getJavadocUrl(className), classJsonObject);
}
try
{
final Description description = getClass(className);
if (description != null)
{
putIfNotNull("description", description.text(), classJsonObject);
if (description.tags().length > 0)
{
for (String tag : description.tags())
{
classJsonObject.accumulate("tag", tag);
}
}
}
}
catch (ClassNotFoundException e)
{
throw new RuntimeException(e);
}
classesJsonArray.put(classJsonObject);
}
object.put(property, classesJsonArray);
}
}