Package org.gradle.build.docs.dsl.docbook.model

Examples of org.gradle.build.docs.dsl.docbook.model.ExtraAttributeDoc


            for (PropertyDoc propertyDoc : superType.getClassProperties()) {
                Map<String, ExtraAttributeDoc> additionalValues = new LinkedHashMap<String, ExtraAttributeDoc>();
                for (ExtraAttributeDoc attributeDoc : propertyDoc.getAdditionalValues()) {
                    String key = attributeDoc.getKey();
                    if (inheritedValueTitleMapping.get(key) != null) {
                        ExtraAttributeDoc newAttribute = new ExtraAttributeDoc(inheritedValueTitleMapping.get(key), attributeDoc.getValueCell());
                        additionalValues.put(newAttribute.getKey(), newAttribute);
                    } else {
                        additionalValues.put(key, attributeDoc);
                    }
                }

                props.put(propertyDoc.getName(), propertyDoc.forClass(classDoc, additionalValues.values()));
            }
        }

        for (Element row : children(classDoc.getPropertiesTable(), "tr")) {
            List<Element> cells = children(row, "td");
            if (cells.size() != header.size()) {
                throw new RuntimeException(String.format("Expected %s <td> elements in <tr>, found: %s", header.size(), tr));
            }
            String propName = cells.get(0).getTextContent().trim();
            PropertyMetaData property = classDoc.getClassMetaData().findProperty(propName);
            if (property == null) {
                throw new RuntimeException(String.format("No metadata for property '%s.%s'. Available properties: %s", classDoc.getName(), propName, classDoc.getClassMetaData().getPropertyNames()));
            }

            Map<String, ExtraAttributeDoc> additionalValues = new LinkedHashMap<String, ExtraAttributeDoc>();

            if (!superTypes.isEmpty()) {
                PropertyDoc overriddenProp = props.get(propName);
                if (overriddenProp != null) {
                    for (ExtraAttributeDoc attributeDoc : overriddenProp.getAdditionalValues()) {
                        additionalValues.put(attributeDoc.getKey(), attributeDoc);
                    }
                }
            }

            for (int i = 1; i < header.size(); i++) {
                if (cells.get(i).getFirstChild() == null) {
                    continue;
                }
                ExtraAttributeDoc attributeDoc = new ExtraAttributeDoc(valueTitles.get(i - 1), cells.get(i));
                additionalValues.put(attributeDoc.getKey(), attributeDoc);
            }
            PropertyDoc propertyDoc = new PropertyDoc(property, javadocConverter.parse(property, listener).getDocbook(), new ArrayList<ExtraAttributeDoc>(additionalValues.values()));
            if (propertyDoc.getDescription() == null) {
                throw new RuntimeException(String.format("Docbook content for '%s.%s' does not contain a description paragraph.", classDoc.getName(), propName));
            }
View Full Code Here

TOP

Related Classes of org.gradle.build.docs.dsl.docbook.model.ExtraAttributeDoc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.