Package org.eclipse.wst.xsl.core.model

## org.eclipse.wst.xsl.core.model
Class StylesheetModel

    public class StylesheetModel
    extends org.eclipse.wst.xsl.core.model.XSLModelObject

The composed stylesheet, consisting of all templates and variables available via imports and includes.

The `fix()` method does the actual work of populating the fields of this, so it must be called before calling any of the other methods.

Note that this model may not be valid - for instance there may be more than one named template for a given name or more than one global variable with a given name.

## Field Summary

`package-private java.util.List` | `callTemplates`
`package-private boolean` | `circularReference`
`package-private java.util.Set` | `files`
`package-private java.util.List` | `functions`
`package-private java.util.List` | `globalVariables`
`package-private java.util.List` | `importModel`
`package-private java.util.List` | `includeModel`
`package-private java.util.Set` | `stylesheets`
`package-private java.util.List` | `templates`
`package-private java.util.Set` | `templateSet`

## Constructor Summary

`StylesheetModel(org.eclipse.wst.xsl.core.model.Stylesheet stylesheet)`

## Method Summary

`public java.util.List`

`findAllNestedTemplates()`
A utility method that traverses all stylesheet in the hierarchy of stylesheets (not including the current stylesheet), and adds all their templates to the returned list. Therefore the returned list has no regard for whether a template is 'visible' (i.e. whether it might be overridden since it was included via an import). The order of the templates in the list is arbitrary.

`public java.util.List` | `findMatching(org.eclipse.wst.xsl.core.model.Template toMatch)` Get all templates that match the given template (determined from `Template.equals()`).
`public void` | `fix()` Perform the process of traversing the hierarchy to determine all of the properties of this. Note that this method may force other `StylesheetModel`'s to be built during the process of fixing.
`public java.util.List` | `getCallTemplates()`
`public java.util.Set` | `getFileDependencies()` Get all files that are included in this stylesheet anywhere in the hierarchy via either import or include.
`public java.util.List` | `getFunctionByName(java.lang.String name)` Get all functions that are included in this stylesheet anywhere in the hierarchy via either import or include which have the given name.
`public java.util.List` | `getFunctions()` Get a List of all functions that are known.
`public java.util.List` | `getGlobalVariables()` Get all global variables that are included in this stylesheet anywhere in the hierarchy via either import or include.
`public java.util.List` | `getIncludes()` Get all stylesheets that are included in this stylesheet anywhere in the hierarchy via either import or include.
`public org.eclipse.wst.xsl.core.model.XSLModelObject.Type` | `getModelType()`
`public org.eclipse.wst.xsl.core.model.Stylesheet` | `getStylesheet()` Get the stylesheet that this is the model for.
`public java.util.List` | `getTemplates()` Get all templates that are included in this stylesheet anywhere in the hierarchy via either import or include.
`public java.util.List` | `getTemplatesByName(java.lang.String name)` Get all named templates that are included in this stylesheet anywhere in the hierarchy via either import or include which have the given name.
`public boolean` | `hasCircularReference()` Get whether this has a circular reference anywhere in its import/included hierarchy.

## Field Detail

## callTemplates

`package-private java.util.List callTemplates`

## circularReference

`package-private boolean circularReference`

## files

`package-private java.util.Set files`

## functions

`package-private java.util.List functions`

## globalVariables

`package-private java.util.List globalVariables`

## importModel

`package-private java.util.List importModel`

## includeModel

`package-private java.util.List includeModel`

## stylesheets

`package-private java.util.Set stylesheets`

## templates

`package-private java.util.List templates`

## templateSet

`package-private java.util.Set templateSet`

## Constructor Detail

## StylesheetModel

`public StylesheetModel(org.eclipse.wst.xsl.core.model.Stylesheet stylesheet)`

Create a new instance of this.

## Methods Detail

## findAllNestedTemplates

`public java.util.List findAllNestedTemplates()`

A utility method that traverses all stylesheet in the hierarchy of stylesheets (not including the current stylesheet), and adds all their templates to the returned list. Therefore the returned list has no regard for whether a template is 'visible' (i.e. whether it might be overridden since it was included via an import). The order of the templates in the list is arbitrary.

### Returns

`java.util.List` - an unordered list of all templates from all stylesheets.

## findMatching

`public java.util.List findMatching(org.eclipse.wst.xsl.core.model.Template toMatch)`

Get all templates that match the given template (determined from `Template.equals()`).

### Parameters

`toMatch` - the template to match

### Returns

`java.util.List` - the set of templates that match

## fix

`public void fix()`

Perform the process of traversing the hierarchy to determine all of the properties of this. Note that this method may force other `StylesheetModel`'s to be built during the process of fixing.

## getCallTemplates

`public java.util.List getCallTemplates()`

### Returns

`java.util.List`

## getFileDependencies

`public java.util.Set getFileDependencies()`

Get all files that are included in this stylesheet anywhere in the hierarchy via either import or include.

### Returns

`java.util.Set` - the set of files in the entire hierarchy

## getFunctionByName

`public java.util.List getFunctionByName(java.lang.String name)`

Get all functions that are included in this stylesheet anywhere in the hierarchy via either import or include which have the given name.

### Parameters

`name` - the template name

### Returns

`java.util.List` - the set of named templates with the given name

## getFunctions

`public java.util.List getFunctions()`

Get a List of all functions that are known.

### Returns

`java.util.List`

## getGlobalVariables

`public java.util.List getGlobalVariables()`

Get all global variables that are included in this stylesheet anywhere in the hierarchy via either import or include.

### Returns

`java.util.List` - the set of files in the entire hierarchy

## getIncludes

`public java.util.List getIncludes()`

Get all stylesheets that are included in this stylesheet anywhere in the hierarchy via either import or include.

### Returns

`java.util.List` - the set of stylesheets in the entire hierarchy

## getModelType

`public org.eclipse.wst.xsl.core.model.XSLModelObject.Type getModelType()`

### Returns

`org.eclipse.wst.xsl.core.model.XSLModelObject.Type`

## getStylesheet

`public org.eclipse.wst.xsl.core.model.Stylesheet getStylesheet()`

Get the stylesheet that this is the model for.

### Returns

`org.eclipse.wst.xsl.core.model.Stylesheet` - the stylesheet that this is the model for

## getTemplates

`public java.util.List getTemplates()`

Get all templates that are included in this stylesheet anywhere in the hierarchy via either import or include.

### Returns

`java.util.List` - the set of templates in the entire hierarchy

## getTemplatesByName

`public java.util.List getTemplatesByName(java.lang.String name)`

Get all named templates that are included in this stylesheet anywhere in the hierarchy via either import or include which have the given name.

### Parameters

`name` - the template name

### Returns

`java.util.List` - the set of named templates with the given name

## hasCircularReference

`public boolean hasCircularReference()`

Get whether this has a circular reference anywhere in its import/included hierarchy.

### Returns

`boolean` - `true` if this has a circular reference