nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcgil...@apache.org
Subject [2/3] incubator-nifi git commit: NIFI-475: - Removing the children from the documented types. This prevents conveying the documented type hierarchies but that isn't necessary given the support for creating instances inline when editing properties.
Date Tue, 07 Apr 2015 18:03:09 GMT
NIFI-475:
- Removing the children from the documented types. This prevents conveying the documented
type hierarchies but that isn't necessary given the support for creating instances inline
when editing properties. 

Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/ea39eac5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/ea39eac5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/ea39eac5

Branch: refs/heads/NIFI-475
Commit: ea39eac580cb9b215495d2ab350ed5d4f960ddd8
Parents: e213866
Author: Matt Gilman <matt.c.gilman@gmail.com>
Authored: Tue Apr 7 13:56:35 2015 -0400
Committer: Matt Gilman <matt.c.gilman@gmail.com>
Committed: Tue Apr 7 13:56:35 2015 -0400

----------------------------------------------------------------------
 .../nifi/web/api/dto/DocumentedTypeDTO.java     |  14 --
 .../org/apache/nifi/web/api/dto/DtoFactory.java | 129 -------------------
 2 files changed, 143 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea39eac5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/DocumentedTypeDTO.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/DocumentedTypeDTO.java
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/DocumentedTypeDTO.java
index 7cf1b84..6e4aeb9 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/DocumentedTypeDTO.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-client-dto/src/main/java/org/apache/nifi/web/api/dto/DocumentedTypeDTO.java
@@ -26,7 +26,6 @@ import javax.xml.bind.annotation.XmlType;
 public class DocumentedTypeDTO {
 
     private String type;
-    private Set<DocumentedTypeDTO> childTypes;
     private String description;
     private Set<String> tags;
 
@@ -69,17 +68,4 @@ public class DocumentedTypeDTO {
         this.tags = tags;
     }
 
-    /**
-     * Child types for this type.
-     * 
-     * @return 
-     */
-    public Set<DocumentedTypeDTO> getChildTypes() {
-        return childTypes;
-    }
-
-    public void setChildTypes(Set<DocumentedTypeDTO> childTypes) {
-        this.childTypes = childTypes;
-    }
-    
 }

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/ea39eac5/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index f3678d1..4e83ac5 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -1384,135 +1384,6 @@ public final class DtoFactory {
     }
     
     /**
-     * Identifies all baseTypes for the specified type that are assignable to the specified
baseType.
-     * 
-     * @param baseType
-     * @param type
-     * @param baseTypes 
-     */
-    private void identifyBaseTypes(final Class baseType, final Class type, final Set<Class>
baseTypes, final  boolean recurse) {
-        final Class[] interfaces = type.getInterfaces();
-        for (final Class i : interfaces) {
-            if (baseType.isAssignableFrom(i) && !baseType.equals(i)) {
-                baseTypes.add(i);
-            }
-        }
-        
-        if (recurse) {
-            if (type.getSuperclass() != null) {
-                identifyBaseTypes(baseType, type.getSuperclass(), baseTypes, recurse);
-            }
-        }
-    }
-    
-    /**
-     * Gets the DocumentedTypeDTOs from the specified classes for the specified baseClass.
-     *
-     * @param baseClass
-     * @param classes
-     * @return
-     */
-    public Set<DocumentedTypeDTO> fromDocumentedTypes(final Class baseClass, final
Set<Class> classes) {
-        final Set<DocumentedTypeDTO> types = new LinkedHashSet<>();
-        final Set<Class> sortedClasses = new TreeSet<>(CLASS_NAME_COMPARATOR);
-        sortedClasses.addAll(classes);
-        
-        // identify all interfaces that extend baseClass for all classes
-        final Set<Class> interfaces = new HashSet<>();
-        for (final Class<?> cls : sortedClasses) {
-            identifyBaseTypes(baseClass, cls, interfaces, true);
-        }
-        
-        // build a lookup of all interfaces
-        final Map<Class, DocumentedTypeDTO> lookup = new HashMap<>();
-        
-        // convert the interfaces to DTO form
-        for (final Class<?> i : interfaces) {
-            final DocumentedTypeDTO type = new DocumentedTypeDTO();
-            type.setType(i.getName());
-            type.setDescription(getCapabilityDescription(i));
-            type.setTags(getTags(i));
-            type.setChildTypes(new LinkedHashSet<DocumentedTypeDTO>());
-            lookup.put(i, type);
-        }
-        
-        // move the interfaces into the appropriate hierarchy
-        final Collection<Class> rootTypes = new ArrayList<>();
-        for (final Class<?> i : interfaces) {
-            rootTypes.add(i);
-            
-            // identify the base types
-            final Set<Class> baseTypes = new LinkedHashSet<>();
-            identifyBaseTypes(baseClass, i, baseTypes, false);
-            
-            // move this interfaces into the hierarchy where appropriate
-            if (!baseTypes.isEmpty()) {
-                // get the DTO for each base type
-                for (final Class baseType : baseTypes) {
-                    final DocumentedTypeDTO parentInteface = lookup.get(baseType);
-                    final DocumentedTypeDTO childInterface = lookup.get(i);
-                    
-                    // include all parent tags in the respective children
-                    childInterface.getTags().addAll(parentInteface.getTags());
-                    
-                    // update the hierarchy
-                    parentInteface.getChildTypes().add(childInterface);
-                }
-                
-                // remove this interface from the lookup (this will only
-                // leave the interfaces that are ancestor roots)
-                rootTypes.remove(i);
-            }
-        }
-
-        // include the interfaces
-        sortedClasses.addAll(rootTypes);
-        
-        // get the DTO form for all interfaces and classes
-        for (final Class<?> cls : sortedClasses) {
-            boolean add = false;
-            
-            final DocumentedTypeDTO type;
-            if (rootTypes.contains(cls)) {
-                type = lookup.get(cls);
-                add = true;
-            } else {
-                type = new DocumentedTypeDTO();
-                type.setType(cls.getName());
-                type.setDescription(getCapabilityDescription(cls));
-                type.setTags(getTags(cls));
-            }
-            
-            // identify the base types
-            final Set<Class> baseTypes = new LinkedHashSet<>();
-            identifyBaseTypes(baseClass, cls, baseTypes, false);
-            
-            // include this type if it doesn't belong to another hierarchy
-            if (baseTypes.isEmpty()) {
-                add = true;
-            } else {
-                // get the DTO for each base type
-                for (final Class baseType : baseTypes) {
-                    final DocumentedTypeDTO parentInterface = lookup.get(baseType);
-
-                    // include all parent tags in the respective children
-                    type.getTags().addAll(parentInterface.getTags());
-
-                    // update the hierarchy
-                    parentInterface.getChildTypes().add(type);
-                }
-            }
-            
-            // add if appropriate
-            if (add) {
-                types.add(type);
-            }
-        }
-
-        return types;
-    }
-
-    /**
      * Creates a ProcessorDTO from the specified ProcessorNode.
      *
      * @param node


Mime
View raw message