Package org.apache.sling.validation.model

# Interface ChildResource

@ProviderType public interface ChildResource
Defines the validation rules for a child resource, allowing `ValidationModel`s to be applied to `Resource` trees.

## Method Summary

Modifier and Type
Method
Description
`@NotNull Collection<ChildResource>`
`getChildren()`
Returns the child resources of this part of the Validation Model
`@NotNull String`
`getName()`
Return this resource's name.
`@Nullable Pattern`
`getNamePattern()`
Returns this resource's name pattern.
`@NotNull Collection<ResourceProperty>`
`getProperties()`
Returns the properties this child resource is expected to have.
`boolean`
`isRequired()`
Returns `true` if at least one resource matching the name/namePattern is required.

## Method Details

### getName

@NotNull @NotNull String getName()
Return this resource's name. This must match the name of the child resource which is validated through this section of the validation model. In case `getNamePattern()` is not `null` this name is not relevant for matching the content resource.

Returns:
  the name

### getNamePattern

@Nullable @Nullable Pattern getNamePattern()
Returns this resource's name pattern. In case this is not returning `null`, this pattern is used for finding the child resources which should be validated.

Returns:
  the name pattern (if one is set) or `null`

### isRequired

boolean isRequired()
Returns `true` if at least one resource matching the name/namePattern is required.

Returns:
  `true` if the resource is required, `false` otherwise

### getProperties

@NotNull @NotNull Collection<ResourceProperty> getProperties()
Returns the properties this child resource is expected to have.

Returns:
  the properties list. Never `null`.

### getChildren

@NotNull @NotNull Collection<ChildResource> getChildren()
Returns the child resources of this part of the Validation Model

Returns:
  child resources. Never `null`.