protected static List<SpecNode> getAllSpecNodes(final ContentSpec contentSpec) {
        final List<SpecNode> specNodes = new ArrayList<SpecNode>();

        for (final Node childNode : contentSpec.getNodes()) {
            if (childNode instanceof SpecNode) {
                specNodes.add((SpecNode) childNode);
            } else if (childNode instanceof KeyValueNode && ((KeyValueNode) childNode).getValue() instanceof SpecNode) {
                specNodes.add((SpecNode) ((KeyValueNode) childNode).getValue());
            }

            if (childNode instanceof Level) {
                specNodes.addAll(getAllSpecNodes((Level) childNode));
            }
        }

        specNodes.addAll(getAllSpecNodes(contentSpec.getBaseLevel()));

        return specNodes;
    }
protected static List < SpecNode > getAllSpecNodes ( final ContentSpec contentSpec ) { final List < SpecNode > specNodes = new ArrayList < SpecNode > ( ) ; for ( final Node childNode : contentSpec . getNodes ( ) ) { if ( childNode instanceof SpecNode ) { specNodes . add ( ( SpecNode ) childNode ) ; } else if ( childNode instanceof KeyValueNode && ( ( KeyValueNode ) childNode ) . getValue ( ) instanceof SpecNode ) { specNodes . add ( ( SpecNode ) ( ( KeyValueNode ) childNode ) . getValue ( ) ) ; } if ( childNode instanceof Level ) { specNodes . addAll ( getAllSpecNodes ( ( Level ) childNode ) ) ; } } specNodes . addAll ( getAllSpecNodes ( contentSpec . getBaseLevel ( ) ) ) ; return specNodes ; }
Collect all of the {@link SpecNode}s in a {@link ContentSpec}.

@param contentSpec The content spec to get the spec nodes from.
@return A list of all spec nodes in the content spec.