public class DataSourceValidationLayer extends Object implements ValidationLayer
An implementation of a ValidationLayer that queries a DataSource
backed database for validation information.
| Constructor and Description |
|---|
DataSourceValidationLayer(DataSource ds,
boolean fieldQuote)
Default Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addElement(Element element)
Adds the
Element to the ValidationLayer. |
void |
addElementToProductType(ProductType type,
Element element)
|
void |
addParentToProductType(ProductType type,
String parent) |
Element |
getElementById(String elementId)
Gets an element by its String identifier.
|
Element |
getElementByName(String elementName)
Gets an element by its String name.
|
List<Element> |
getElements() |
List<Element> |
getElements(ProductType type)
|
void |
modifyElement(Element element)
Modifies an existing
Element in the ValidationLayer. |
void |
removeElement(Element element)
Removes a metadata
Element from the ValidationLayer. |
void |
removeElementFromProductType(ProductType type,
Element element)
Removes a metadata
Element from the specified
productTypeId. |
void |
removeParentFromProductType(ProductType type,
String parent) |
public DataSourceValidationLayer(DataSource ds, boolean fieldQuote)
Default Constructor
.public void addElement(Element element) throws ValidationLayerException
ValidationLayer
Adds the Element to the ValidationLayer.
addElement in interface ValidationLayerelement - The element to add.ValidationLayerException - If any error occurs during the add.public void modifyElement(Element element) throws ValidationLayerException
ValidationLayer
Modifies an existing Element in the ValidationLayer.
modifyElement in interface ValidationLayerelement - The new Element data to update.ValidationLayerException - If any error occurs.public void removeElement(Element element) throws ValidationLayerException
ValidationLayer
Removes a metadata Element from the ValidationLayer.
removeElement in interface ValidationLayerelement - The element to remove.ValidationLayerException - If any error occurs.public void addElementToProductType(ProductType type, Element element) throws ValidationLayerException
ValidationLayer
Adds the specified element to the ProductType
specified by its productTypeId.
addElementToProductType in interface ValidationLayertype - The ProductType to associate the metadata Element
with.element - The Element to associate with the ProductType.ValidationLayerException - If any error occurs.public void removeElementFromProductType(ProductType type, Element element) throws ValidationLayerException
ValidationLayer
Removes a metadata Element from the specified
productTypeId.
removeElementFromProductType in interface ValidationLayertype - The ProductType to remove the association of the
specified element with.element - The element whose association will be removed from the
specified ProductType.ValidationLayerException - If any error occurs.public void addParentToProductType(ProductType type, String parent) throws ValidationLayerException
ValidationLayerExceptionpublic void removeParentFromProductType(ProductType type, String parent) throws ValidationLayerException
ValidationLayerExceptionpublic List<Element> getElements(ProductType type) throws ValidationLayerException
ValidationLayergetElements in interface ValidationLayertype - The product type to retrieve the metadata Elements
for.List of Elements corresponding to the given
ProductType.ValidationLayerException - If any error occurs.public List<Element> getElements() throws ValidationLayerException
getElements in interface ValidationLayerList of all the metadata Elements in the
ValidationLayer.ValidationLayerException - If any error occurs.public Element getElementById(String elementId) throws ValidationLayerException
ValidationLayergetElementById in interface ValidationLayerelementId - The String identifier of the Element to get.Element by its String identifier.ValidationLayerException - If any error occurs.public Element getElementByName(String elementName) throws ValidationLayerException
ValidationLayergetElementByName in interface ValidationLayerelementName - The String name of the Element to get.Element by its String name.ValidationLayerException - If any error occurs.Copyright © 1999–2017 Apache OODT. All rights reserved.