code: public static Collection<UIViewParameter> getViewParameters(UIViewRoot root) {
  
          Collection<UIViewParameter> params;
          UIComponent metadataFacet = root.getFacet(UIViewRoot.METADATA_FACET_NAME);
  
          if (metadataFacet == null) {
              params = Collections.emptyList();
          } else {
              params = new ArrayList<UIViewParameter>();
              List<UIComponent> children = metadataFacet.getChildren();
              int len = children.size();
              for (int i = 0; i < len; i++) {
                  UIComponent c = children.get(i);
                  if (c instanceof UIViewParameter) {
                      params.add((UIViewParameter) c);
                  }
              }
          }
  
          return params;
  
      }
docs: <p class="changed_added_2_0"> Utility method to extract view
  metadata from the provided {@link UIViewRoot}.  </p>
  
  @param root the {@link UIViewRoot} from which the metadata will
  be extracted.
  
  @return a <code>Collection</code> of {@link UIViewParameter}
  instances.  If the view has no metadata, the collection will be
  empty.