Class ModelAwareXMLValuesExtractor

    • Method Detail

      • _fillViewItemContainerFromXML

        protected void _fillViewItemContainerFromXML​(Element element,
                                                     ViewItemContainer viewItemContainer,
                                                     ModelItemContainer modelItemContainer)
                                              throws Exception
        Fill the given view item container with the data found in the given element.
        Parameters:
        element - The DOM element containing the values
        viewItemContainer - The view item container to fill
        modelItemContainer - The model item containing the items that could be in the element
        Throws:
        Exception - if an error occurs
      • _fillViewItemContainerFromXML

        protected void _fillViewItemContainerFromXML​(Element element,
                                                     ViewItemContainer viewItemContainer,
                                                     Collection<? extends ModelItemContainer> modelItemContainers)
                                              throws Exception
        Fill the given view item container with the data found in the given element.
        Parameters:
        element - The DOM element containing the values
        viewItemContainer - The view item container to fill
        modelItemContainers - The model items containing the items that could be in the element
        Throws:
        Exception - if an error occurs
      • _extractValues

        protected Map<String,​Object_extractValues​(Element currentElement,
                                                          ViewItemContainer viewItemContainer,
                                                          String prefix)
                                                   throws Exception
        Extracts the values of all items in the given view item container
        Parameters:
        currentElement - the DOM element containing the values of the items in the container
        viewItemContainer - the view item container
        prefix - the path of the item represented by the view item container (prefix of all contained items)
        Returns:
        the values of all items in the given view item containers
        Throws:
        Exception - if an error occurs
      • extractValue

        public <T> T extractValue​(String dataPath)
                           throws Exception
        Description copied from interface: ValuesExtractor
        Extracts the value at the given path
        Specified by:
        extractValue in interface ValuesExtractor
        Type Parameters:
        T - type of the value to retrieve
        Parameters:
        dataPath - the data path
        Returns:
        the value at the given path
        Throws:
        Exception - if an error occurs
      • _extractValue

        protected <T> T _extractValue​(ModelItemContainer modelItemContainer,
                                      Element currentElement,
                                      String relativeDataPath,
                                      String prefix)
                               throws Exception
        Extracts the value at the given path
        Type Parameters:
        T - type of the value to retrieve
        Parameters:
        modelItemContainer - The model item containing the item of the value to extract
        currentElement - the DOM element containing the model item container's values
        relativeDataPath - The data path relative to the model item container
        prefix - the path of the item represented by the model item container (prefix of all contained items)
        Returns:
        the value
        Throws:
        Exception - if an error occurs
      • _extractValue

        protected <T> T _extractValue​(Collection<? extends ModelItemContainer> modelItemContainers,
                                      Element currentElement,
                                      String relativeDataPath,
                                      String prefix)
                               throws Exception
        Extracts the value at the given path
        Type Parameters:
        T - type of the value to retrieve
        Parameters:
        modelItemContainers - The model items containing the item of the value to extract
        currentElement - the DOM element containing the model item containers' values
        relativeDataPath - The data path relative to the model item containers
        prefix - the path of the item represented by the model item containers (prefix of all contained items)
        Returns:
        the value
        Throws:
        Exception - if an error occurs
      • _extractElementValue

        protected <T> T _extractElementValue​(Element parent,
                                             ElementDefinition definition,
                                             String prefix)
                                      throws Exception
        Extracts the value of the given element
        Type Parameters:
        T - type of the value to retrieve
        Parameters:
        parent - the DOM element of the element definition's parent
        definition - the element's definition
        prefix - the path of the element's parent
        Returns:
        the value
        Throws:
        Exception - if an error occurs
      • _extractGroupValues

        protected <T> T _extractGroupValues​(Element parent,
                                            ModelViewItemGroup modelViewItemGroup,
                                            String dataName,
                                            String prefix)
                                     throws Exception
        Extracts the values of the given group
        Type Parameters:
        T - type of the values to retrieve (example: Map for a composite, List for a repeater
        Parameters:
        parent - the DOM element of the group's parent
        modelViewItemGroup - view item corresponding to the group
        dataName - the name of the data to extract
        prefix - the path of the group's parent
        Returns:
        the value
        Throws:
        Exception - if an error occurs