Class SCD

  • Direct Known Subclasses:
    SCDImpl

    public abstract class SCD
    extends Object
    Schema Component Designator (SCD).

    SCD for schema is what XPath is for XML. SCD allows you to select a schema component(s) from a schema component(s).

    See XML Schema: Component Designators. This implementation is based on 03/29/2005 working draft.

    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • SCD

        protected SCD()
        Default constructor.
    • Method Detail

      • select

        public final Collection<XSComponent> select​(XSComponent contextNode)
        Evaluates the SCD against the given context node and returns the matched nodes.
        Returns:
        could be empty but never be null.
      • select

        public final Collection<XSComponent> select​(XSSchemaSet contextNode)
        Evaluates the SCD against the whole schema and returns the matched nodes.

        This method is here because XSSchemaSet doesn't implement XSComponent.

        Returns:
        could be empty but never be null.
      • selectSingle

        public final XSComponent selectSingle​(XSComponent contextNode)
        Evaluates the SCD against the given context node and returns the matched node.
        Returns:
        null if the SCD didn't match anything. If the SCD matched more than one node, the first one will be returned.
      • selectSingle

        public final XSComponent selectSingle​(XSSchemaSet contextNode)
        Evaluates the SCD against the whole schema set and returns the matched node.
        Returns:
        null if the SCD didn't match anything. If the SCD matched more than one node, the first one will be returned.
      • select

        public abstract Iterator<XSComponent> select​(Iterator<? extends XSComponent> contextNodes)
        Evaluates the SCD against the given set of context nodes and returns the matched nodes.
        Parameters:
        contextNodes - XSComponents that represent the context node against which is evaluated.
        Returns:
        could be empty but never be null.
      • select

        public final Collection<XSComponent> select​(Collection<? extends XSComponent> contextNodes)
        Evaluates the SCD against the given set of context nodes and returns the matched nodes.
        Parameters:
        contextNodes - XSComponents that represent the context node against which is evaluated.
        Returns:
        could be empty but never be null.