public static void main(String[] args) { ClassicEngineBoot.getInstance().start(); final TreeMap globalAttributes = new TreeMap(); final ElementMetaData[] datas = ElementTypeRegistry.getInstance().getAllElementTypes(); for (int i = 0; i < datas.length; i++) { final ElementMetaData data = datas[i]; if (data instanceof AbstractMetaData == false) { continue; } printMetaBundle(data, globalAttributes); } System.out.println("-----------------------------------------------------"); final Iterator iterator = globalAttributes.entrySet().iterator(); while (iterator.hasNext()) { final Map.Entry o = (Map.Entry) iterator.next(); final AttributeMetaData attribute = (AttributeMetaData) o.getValue(); final AbstractMetaData aamd = (AbstractMetaData) attribute; final String akeyPrefix = aamd.getKeyPrefix(); final String abundle = aamd.getBundleLocation(); final String aname = attribute.getName(); System.out.println(akeyPrefix + aname + ".display-name=" + aname); System.out.println( akeyPrefix + aname + ".grouping=" + filter(aamd.getGrouping(Locale.ENGLISH), "Group")); System.out.println( akeyPrefix + aname + ".description=" + filter(aamd.getDescription(Locale.ENGLISH), "")); System.out.println( akeyPrefix + aname + ".deprecated=" + filter(aamd.getDeprecationMessage(Locale.ENGLISH), "")); } }
private static void validateAttributeMetaData( final ElementMetaData metaData, final ArrayList<String> missingProperties) { final Locale locale = Locale.getDefault(); final String typeName = metaData.getName(); final AttributeMetaData[] attributeMetaDatas = metaData.getAttributeDescriptions(); for (int j = 0; j < attributeMetaDatas.length; j++) { final AttributeMetaData propertyMetaData = attributeMetaDatas[j]; final String propertyDisplayName = propertyMetaData.getDisplayName(locale); if (isValid(propertyDisplayName, propertyMetaData.getName(), missingProperties) == false) { logger.warn( "ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": No DisplayName"); } final String propertyGrouping = propertyMetaData.getGrouping(locale); if (isValid(propertyGrouping, "common", missingProperties) == false) { logger.warn( "ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": Grouping is not valid"); } if (propertyMetaData.isDeprecated()) { final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale); if (isValid(deprecateMessage, "Deprecated", missingProperties) == false) { logger.warn( "ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": No valid deprecate message"); } } } }
private static void printMetaBundle(final ElementMetaData data, Map globalAttributes) { System.out.println("-----------------------------------------------------"); final AbstractMetaData amd = (AbstractMetaData) data; final String keyPrefix = amd.getKeyPrefix(); final String ename = amd.getName(); final String ebundle = amd.getBundleLocation(); System.out.println(keyPrefix + ename + ".display-name=" + ename); System.out.println( keyPrefix + ename + ".grouping=" + filter(amd.getGrouping(Locale.ENGLISH), "Group")); System.out.println( keyPrefix + ename + ".description=" + filter(amd.getDescription(Locale.ENGLISH), "")); System.out.println( keyPrefix + ename + ".deprecated=" + filter(amd.getDeprecationMessage(Locale.ENGLISH), "")); final AttributeMetaData[] attributes = data.getAttributeDescriptions(); for (int j = 0; j < attributes.length; j++) { final AttributeMetaData attribute = attributes[j]; final AbstractMetaData aamd = (AbstractMetaData) attribute; final String akeyPrefix = aamd.getKeyPrefix(); final String abundle = aamd.getBundleLocation(); final String aname = attribute.getName(); if (abundle.equals(GLOBAL_BUNDLE) && akeyPrefix.startsWith("attribute.")) { globalAttributes.put(aname, attribute); continue; } System.out.println(akeyPrefix + aname + ".display-name=" + aname); System.out.println( akeyPrefix + aname + ".grouping=" + filter(aamd.getGrouping(Locale.ENGLISH), "Group")); System.out.println( akeyPrefix + aname + ".description=" + filter(aamd.getDescription(Locale.ENGLISH), "")); System.out.println( akeyPrefix + aname + ".deprecated=" + filter(aamd.getDeprecationMessage(Locale.ENGLISH), "")); } System.out.println("-----------------------------------------------------"); }