ome-xml  5.6.0
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ome::xml::model::detail::OMEModelObject Class Referenceabstract

OME model object (concrete implementation). More...

#include <ome/xml/model/detail/OMEModelObject.h>

+ Inheritance diagram for ome::xml::model::detail::OMEModelObject:
+ Collaboration diagram for ome::xml::model::detail::OMEModelObject:

Classes

class  compare_element
 Comparison functor. More...
 

Public Member Functions

virtual ~OMEModelObject ()
 Destructor.
 
bool validElementName (const std::string &name) const =0
 Check if a given element name is valid for processing by this model object. More...
 
virtual common::xml::dom::Element asXMLElement (common::xml::dom::Document &document) const
 Transform the object hierarchy rooted at this element to XML. More...
 
virtual void asXMLElement (common::xml::dom::Document &document, common::xml::dom::Element &element) const
 Transform the object hierarchy rooted at this element to XML. More...
 
virtual void update (const common::xml::dom::Element &element, ::ome::xml::model::OMEModel &model)
 Update the object hierarchy recursively from an XML DOM tree. More...
 
virtual bool link (std::shared_ptr< Reference > &reference, std::shared_ptr<::ome::xml::model::OMEModelObject > &object)
 Link a given OME model object to this model object. More...
 
- Public Member Functions inherited from ome::xml::model::OMEModelObject
virtual const std::string & elementName () const =0
 Get the element name of this model object. More...
 
virtual void update (const common::xml::dom::Element &element, OMEModel &model)=0
 Update the object hierarchy recursively from an XML DOM tree. More...
 
virtual bool link (std::shared_ptr< Reference > &reference, std::shared_ptr< OMEModelObject > &object)=0
 Link a given OME model object to this model object. More...
 
virtual const std::string & getXMLNamespace () const =0
 Get the XML namespace for this model object. More...
 

Static Public Member Functions

static std::vector< common::xml::dom::ElementgetChildrenByTagName (const common::xml::dom::Element &parent, const std::string &name)
 Retrieve all the children of an element that have a given tag name. More...
 
static std::string stripNamespacePrefix (const std::string &value)
 Strip the namespace prefix from a tag name. More...
 

Protected Member Functions

 OMEModelObject (const std::string &objectType="OMEModelObject")
 Constructor. More...
 
 OMEModelObject (const OMEModelObject &copy)
 Copy constructor. More...
 
virtual void asXMLElementInternal (common::xml::dom::Document &document, common::xml::dom::Element &element) const =0
 Transform the object hierarchy rooted at this element to XML. More...
 
template<class C , typename T >
bool contains (const C &container, const std::shared_ptr< T > &element)
 Check if a container contains a particular element. More...
 
- Protected Member Functions inherited from ome::xml::model::OMEModelObject
 OMEModelObject ()
 Constructor.
 

Protected Attributes

ome::common::Logger logger
 Message logger.
 

Detailed Description

OME model object (concrete implementation).

Constructor & Destructor Documentation

◆ OMEModelObject() [1/2]

ome::xml::model::detail::OMEModelObject::OMEModelObject ( const std::string &  objectType = "OMEModelObject")
protected

Constructor.

Parameters
objectTypethe type of the model object, used for information purposes such as logging.

References createLogger().

◆ OMEModelObject() [2/2]

ome::xml::model::detail::OMEModelObject::OMEModelObject ( const OMEModelObject copy)
protected

Copy constructor.

Parameters
copythe OMEModelObject to copy.

Member Function Documentation

◆ asXMLElement() [1/2]

common::xml::dom::Element ome::xml::model::detail::OMEModelObject::asXMLElement ( common::xml::dom::Document document) const
virtual

Transform the object hierarchy rooted at this element to XML.

Parameters
documentdocument for element creation
Returns
an XML DOM tree root element for this model object.

Implements ome::xml::model::OMEModelObject.

References asXMLElementInternal(), ome::common::xml::dom::Document::createElementNS(), ome::xml::model::OMEModelObject::elementName(), ome::common::xml::dom::Document::getDocumentElement(), and ome::xml::model::OMEModelObject::getXMLNamespace().

◆ asXMLElement() [2/2]

void ome::xml::model::detail::OMEModelObject::asXMLElement ( common::xml::dom::Document document,
common::xml::dom::Element element 
) const
virtual

Transform the object hierarchy rooted at this element to XML.

This internal implementation of asXMLelement also requires an XML element, which must not be null, or may be instantiated and passed from superclasses.

Parameters
documentXML document for element creation.
elementXML element for setting model data.

Implements ome::xml::model::OMEModelObject.

References asXMLElementInternal().

◆ asXMLElementInternal()

void ome::xml::model::detail::OMEModelObject::asXMLElementInternal ( common::xml::dom::Document document,
common::xml::dom::Element element 
) const
protectedpure virtual

Transform the object hierarchy rooted at this element to XML.

This internal implementation of asXMLelement also requires an XML element, which must not be null, or may be instantiated and passed from superclasses.

Concrete model object implementations should override this method.

Parameters
documentXML document for element creation.
elementXML element for setting model data.

Implemented in ome::xml::model::Annotation, ome::xml::model::OME, ome::xml::model::StructuredAnnotations, ome::xml::model::Image, ome::xml::model::Instrument, ome::xml::model::Pixels, ome::xml::model::Experimenter, ome::xml::model::Plate, ome::xml::model::Channel, ome::xml::model::ExperimenterGroup, ome::xml::model::Filter, ome::xml::model::Shape, ome::xml::model::Folder, ome::xml::model::Screen, ome::xml::model::ROI, ome::xml::model::Well, ome::xml::model::Dataset, ome::xml::model::MicrobeamManipulation, ome::xml::model::PlateAcquisition, ome::xml::model::FilterSet, ome::xml::model::Plane, ome::xml::model::Project, ome::xml::model::Objective, ome::xml::model::Detector, ome::xml::model::Dichroic, ome::xml::model::Experiment, ome::xml::model::Reagent, ome::xml::model::LightPath, ome::xml::model::WellSample, ome::xml::model::Laser, ome::xml::model::DetectorSettings, ome::xml::model::TiffData, ome::xml::model::ImagingEnvironment, ome::xml::model::LightSource, ome::xml::model::TransmittanceRange, ome::xml::model::LightSourceSettings, ome::xml::model::Line, ome::xml::model::ObjectiveSettings, ome::xml::model::BinaryFile, ome::xml::model::BinData, ome::xml::model::AffineTransform, ome::xml::model::Mask, ome::xml::model::StageLabel, ome::xml::model::Leader, ome::xml::model::Pump, ome::xml::model::Union, ome::xml::model::ManufacturerSpec, ome::xml::model::Polyline, ome::xml::model::Ellipse, ome::xml::model::Rectangle, ome::xml::model::External, ome::xml::model::FileAnnotation, ome::xml::model::Rights, ome::xml::model::MapAnnotation, ome::xml::model::TimestampAnnotation, ome::xml::model::BooleanAnnotation, ome::xml::model::CommentAnnotation, ome::xml::model::DoubleAnnotation, ome::xml::model::LongAnnotation, ome::xml::model::TagAnnotation, ome::xml::model::TermAnnotation, ome::xml::model::XMLAnnotation, ome::xml::model::UUID, ome::xml::model::Label, ome::xml::model::Point, ome::xml::model::BinaryOnly, ome::xml::model::Arc, ome::xml::model::Filament, ome::xml::model::GenericExcitationSource, ome::xml::model::ListAnnotation, ome::xml::model::Microscope, ome::xml::model::Polygon, ome::xml::model::AnnotationRef, ome::xml::model::ChannelRef, ome::xml::model::DatasetRef, ome::xml::model::DichroicRef, ome::xml::model::ExperimenterGroupRef, ome::xml::model::ExperimenterRef, ome::xml::model::ExperimentRef, ome::xml::model::FilterRef, ome::xml::model::FilterSetRef, ome::xml::model::FolderRef, ome::xml::model::ImageRef, ome::xml::model::InstrumentRef, ome::xml::model::MicrobeamManipulationRef, ome::xml::model::PlateRef, ome::xml::model::ProjectRef, ome::xml::model::ReagentRef, ome::xml::model::ROIRef, ome::xml::model::WellSampleRef, ome::xml::model::OriginalMetadataAnnotation, ome::xml::model::LightEmittingDiode, ome::xml::model::EmissionFilterRef, ome::xml::model::ExcitationFilterRef, ome::xml::model::MetadataOnly, ome::xml::model::Reference, ome::xml::model::BasicAnnotation, ome::xml::model::NumericAnnotation, ome::xml::model::Settings, ome::xml::model::TextAnnotation, and ome::xml::model::TypeAnnotation.

Referenced by asXMLElement(), ome::xml::model::Reference::asXMLElementInternal(), ome::xml::model::MetadataOnly::asXMLElementInternal(), ome::xml::model::BinaryOnly::asXMLElementInternal(), ome::xml::model::UUID::asXMLElementInternal(), ome::xml::model::Rights::asXMLElementInternal(), ome::xml::model::External::asXMLElementInternal(), ome::xml::model::ManufacturerSpec::asXMLElementInternal(), ome::xml::model::Union::asXMLElementInternal(), ome::xml::model::StageLabel::asXMLElementInternal(), ome::xml::model::AffineTransform::asXMLElementInternal(), ome::xml::model::BinData::asXMLElementInternal(), ome::xml::model::BinaryFile::asXMLElementInternal(), ome::xml::model::TransmittanceRange::asXMLElementInternal(), ome::xml::model::ImagingEnvironment::asXMLElementInternal(), ome::xml::model::TiffData::asXMLElementInternal(), ome::xml::model::WellSample::asXMLElementInternal(), ome::xml::model::LightPath::asXMLElementInternal(), ome::xml::model::Experiment::asXMLElementInternal(), ome::xml::model::Reagent::asXMLElementInternal(), ome::xml::model::Project::asXMLElementInternal(), ome::xml::model::Plane::asXMLElementInternal(), ome::xml::model::PlateAcquisition::asXMLElementInternal(), ome::xml::model::MicrobeamManipulation::asXMLElementInternal(), ome::xml::model::Dataset::asXMLElementInternal(), ome::xml::model::Well::asXMLElementInternal(), ome::xml::model::ROI::asXMLElementInternal(), ome::xml::model::Screen::asXMLElementInternal(), ome::xml::model::Folder::asXMLElementInternal(), ome::xml::model::Shape::asXMLElementInternal(), ome::xml::model::ExperimenterGroup::asXMLElementInternal(), ome::xml::model::Channel::asXMLElementInternal(), ome::xml::model::Plate::asXMLElementInternal(), ome::xml::model::Experimenter::asXMLElementInternal(), ome::xml::model::Pixels::asXMLElementInternal(), ome::xml::model::Instrument::asXMLElementInternal(), ome::xml::model::Image::asXMLElementInternal(), ome::xml::model::StructuredAnnotations::asXMLElementInternal(), ome::xml::model::OME::asXMLElementInternal(), and ome::xml::model::Annotation::asXMLElementInternal().

+ Here is the caller graph for this function:

◆ contains()

template<class C , typename T >
bool ome::xml::model::detail::OMEModelObject::contains ( const C &  container,
const std::shared_ptr< T > &  element 
)
inlineprotected

Check if a container contains a particular element.

Note
This is a shared_ptr comparison, not an element value comparison.
Parameters
containerthe container to check.
elementthe element to check for.
Returns
true if the element was found, otherwise false.

◆ getChildrenByTagName()

std::vector< common::xml::dom::Element > ome::xml::model::detail::OMEModelObject::getChildrenByTagName ( const common::xml::dom::Element parent,
const std::string &  name 
)
static

Retrieve all the children of an element that have a given tag name.

If a tag has a namespace prefix it will be stripped prior to attempting a name match.

Parameters
parentDOM element to retrieve tags based upon.
namename of the tags to retrieve.
Returns
list of elements which have the tag name.

References Wrapper< xercesc::DOMElement, Node >::get().

Referenced by ome::xml::model::LightSource::update(), ome::xml::model::OriginalMetadataAnnotation::update(), ome::xml::model::Shape::update(), ome::xml::model::Annotation::update(), ome::xml::model::Rights::update(), ome::xml::model::GenericExcitationSource::update(), ome::xml::model::DoubleAnnotation::update(), ome::xml::model::CommentAnnotation::update(), ome::xml::model::TagAnnotation::update(), ome::xml::model::TermAnnotation::update(), ome::xml::model::Union::update(), ome::xml::model::BooleanAnnotation::update(), ome::xml::model::LongAnnotation::update(), ome::xml::model::XMLAnnotation::update(), ome::xml::model::Mask::update(), ome::xml::model::TimestampAnnotation::update(), ome::xml::model::FileAnnotation::update(), ome::xml::model::MapAnnotation::update(), ome::xml::model::BinaryFile::update(), ome::xml::model::Folder::update(), ome::xml::model::Reagent::update(), ome::xml::model::Screen::update(), ome::xml::model::TiffData::update(), ome::xml::model::LightPath::update(), ome::xml::model::Project::update(), ome::xml::model::Dichroic::update(), ome::xml::model::ImagingEnvironment::update(), ome::xml::model::Experiment::update(), ome::xml::model::Detector::update(), ome::xml::model::FilterSet::update(), ome::xml::model::PlateAcquisition::update(), ome::xml::model::ExperimenterGroup::update(), ome::xml::model::ROI::update(), ome::xml::model::Dataset::update(), ome::xml::model::Objective::update(), ome::xml::model::Plane::update(), ome::xml::model::WellSample::update(), ome::xml::model::Well::update(), ome::xml::model::MicrobeamManipulation::update(), ome::xml::model::Filter::update(), ome::xml::model::Laser::update(), ome::xml::model::Experimenter::update(), ome::xml::model::Plate::update(), ome::xml::model::Instrument::update(), ome::xml::model::Pixels::update(), ome::xml::model::StructuredAnnotations::update(), ome::xml::model::Channel::update(), ome::xml::model::OME::update(), and ome::xml::model::Image::update().

+ Here is the caller graph for this function:

◆ link()

bool ome::xml::model::detail::OMEModelObject::link ( std::shared_ptr< Reference > &  reference,
std::shared_ptr<::ome::xml::model::OMEModelObject > &  object 
)
virtual

Link a given OME model object to this model object.

Parameters
referencetype qualifier for the reference. This should be the corresponding reference type for object. If, for example, object is of type Image, reference must be of type ImageRef.
objectModel object to link to.
Returns
true if this model object was able to handle the reference, otherwise false.
Todo:
the use of reference to provide type information for the type of object is unconventional and quite possibly unnecessary–a simple string or type_info would suffice for what it's being used for, if it's needed at all. Is this true for all cases? The implementation also needs to do strict checking of the object type; it's not currently failing if it's of the wrong type. This applies to all generated model objects implementing this interface.

Referenced by ome::xml::model::ManufacturerSpec::link(), ome::xml::model::Shape::link(), ome::xml::model::Reference::link(), ome::xml::model::AffineTransform::link(), ome::xml::model::Annotation::link(), ome::xml::model::BinaryOnly::link(), ome::xml::model::MetadataOnly::link(), ome::xml::model::UUID::link(), ome::xml::model::Rights::link(), ome::xml::model::Union::link(), ome::xml::model::StageLabel::link(), ome::xml::model::External::link(), ome::xml::model::TiffData::link(), ome::xml::model::LightPath::link(), ome::xml::model::BinData::link(), ome::xml::model::BinaryFile::link(), ome::xml::model::Folder::link(), ome::xml::model::Reagent::link(), ome::xml::model::Screen::link(), ome::xml::model::Experiment::link(), ome::xml::model::TransmittanceRange::link(), ome::xml::model::Project::link(), ome::xml::model::ImagingEnvironment::link(), ome::xml::model::Dataset::link(), ome::xml::model::ROI::link(), ome::xml::model::ExperimenterGroup::link(), ome::xml::model::Plane::link(), ome::xml::model::PlateAcquisition::link(), ome::xml::model::WellSample::link(), ome::xml::model::MicrobeamManipulation::link(), ome::xml::model::Well::link(), ome::xml::model::Experimenter::link(), ome::xml::model::Plate::link(), ome::xml::model::Instrument::link(), ome::xml::model::Pixels::link(), ome::xml::model::StructuredAnnotations::link(), ome::xml::model::Channel::link(), ome::xml::model::OME::link(), and ome::xml::model::Image::link().

+ Here is the caller graph for this function:

◆ stripNamespacePrefix()

std::string ome::xml::model::detail::OMEModelObject::stripNamespacePrefix ( const std::string &  value)
static

Strip the namespace prefix from a tag name.

Parameters
valuetag name
Returns
value with the namespace prefix stripped or value if it does not have a namespace prefix.

◆ update()

void ome::xml::model::detail::OMEModelObject::update ( const common::xml::dom::Element element,
::ome::xml::model::OMEModel model 
)
virtual

Update the object hierarchy recursively from an XML DOM tree.

Note
No properties are removed, only added or updated.
Parameters
elementroot of the XML DOM tree to from which to construct the model object graph.
modelhandler for the OME model used to track instances and references seen during the update.
Exceptions
EnumerationExceptionif there is an error instantiating an enumeration during model object creation, or ModelException if there are any consistency or validity errors found during processing.

Reimplemented in ome::xml::model::OriginalMetadataAnnotation.

Referenced by ome::xml::model::ManufacturerSpec::update(), ome::xml::model::Shape::update(), ome::xml::model::Reference::update(), ome::xml::model::AffineTransform::update(), ome::xml::model::Annotation::update(), ome::xml::model::BinaryOnly::update(), ome::xml::model::MetadataOnly::update(), ome::xml::model::UUID::update(), ome::xml::model::Rights::update(), ome::xml::model::Union::update(), ome::xml::model::StageLabel::update(), ome::xml::model::External::update(), ome::xml::model::TiffData::update(), ome::xml::model::LightPath::update(), ome::xml::model::BinData::update(), ome::xml::model::BinaryFile::update(), ome::xml::model::Folder::update(), ome::xml::model::Reagent::update(), ome::xml::model::Screen::update(), ome::xml::model::Experiment::update(), ome::xml::model::TransmittanceRange::update(), ome::xml::model::Project::update(), ome::xml::model::ImagingEnvironment::update(), ome::xml::model::Dataset::update(), ome::xml::model::ROI::update(), ome::xml::model::ExperimenterGroup::update(), ome::xml::model::Plane::update(), ome::xml::model::PlateAcquisition::update(), ome::xml::model::WellSample::update(), ome::xml::model::MicrobeamManipulation::update(), ome::xml::model::Well::update(), ome::xml::model::Experimenter::update(), ome::xml::model::Plate::update(), ome::xml::model::Instrument::update(), ome::xml::model::Pixels::update(), ome::xml::model::StructuredAnnotations::update(), ome::xml::model::Channel::update(), ome::xml::model::OME::update(), and ome::xml::model::Image::update().

+ Here is the caller graph for this function:

◆ validElementName()

bool ome::xml::model::detail::OMEModelObject::validElementName ( const std::string &  name) const
pure virtual

Check if a given element name is valid for processing by this model object.

Used for processing nodes when interitance is involved.

Parameters
namethe element name to check.
Returns
true if valid, false if invalid.
Deprecated:
Always returns true since any element name is now regarded as being valid.

Implements ome::xml::model::OMEModelObject.

Implemented in ome::xml::model::Image, ome::xml::model::OME, ome::xml::model::Channel, ome::xml::model::Pixels, ome::xml::model::StructuredAnnotations, ome::xml::model::Instrument, ome::xml::model::Plate, ome::xml::model::Experimenter, ome::xml::model::Laser, ome::xml::model::Filter, ome::xml::model::MicrobeamManipulation, ome::xml::model::Well, ome::xml::model::WellSample, ome::xml::model::Dataset, ome::xml::model::DetectorSettings, ome::xml::model::ExperimenterGroup, ome::xml::model::LightSourceSettings, ome::xml::model::Objective, ome::xml::model::Plane, ome::xml::model::PlateAcquisition, ome::xml::model::ROI, ome::xml::model::Detector, ome::xml::model::Dichroic, ome::xml::model::Experiment, ome::xml::model::FilterSet, ome::xml::model::ImagingEnvironment, ome::xml::model::Project, ome::xml::model::TransmittanceRange, ome::xml::model::BinaryFile, ome::xml::model::BinData, ome::xml::model::Folder, ome::xml::model::LightPath, ome::xml::model::Reagent, ome::xml::model::Screen, ome::xml::model::TiffData, ome::xml::model::FileAnnotation, ome::xml::model::MapAnnotation, ome::xml::model::ObjectiveSettings, ome::xml::model::TimestampAnnotation, ome::xml::model::Arc, ome::xml::model::BooleanAnnotation, ome::xml::model::CommentAnnotation, ome::xml::model::DoubleAnnotation, ome::xml::model::External, ome::xml::model::Filament, ome::xml::model::GenericExcitationSource, ome::xml::model::Leader, ome::xml::model::Line, ome::xml::model::ListAnnotation, ome::xml::model::LongAnnotation, ome::xml::model::Mask, ome::xml::model::Microscope, ome::xml::model::Polyline, ome::xml::model::Pump, ome::xml::model::StageLabel, ome::xml::model::TagAnnotation, ome::xml::model::TermAnnotation, ome::xml::model::Union, ome::xml::model::XMLAnnotation, ome::xml::model::AffineTransform, ome::xml::model::Annotation, ome::xml::model::AnnotationRef, ome::xml::model::BinaryOnly, ome::xml::model::ChannelRef, ome::xml::model::DatasetRef, ome::xml::model::DichroicRef, ome::xml::model::Ellipse, ome::xml::model::EmissionFilterRef, ome::xml::model::ExcitationFilterRef, ome::xml::model::ExperimenterGroupRef, ome::xml::model::ExperimenterRef, ome::xml::model::ExperimentRef, ome::xml::model::FilterRef, ome::xml::model::FilterSetRef, ome::xml::model::FolderRef, ome::xml::model::ImageRef, ome::xml::model::InstrumentRef, ome::xml::model::Label, ome::xml::model::LightEmittingDiode, ome::xml::model::MetadataOnly, ome::xml::model::MicrobeamManipulationRef, ome::xml::model::PlateRef, ome::xml::model::Point, ome::xml::model::Polygon, ome::xml::model::ProjectRef, ome::xml::model::ReagentRef, ome::xml::model::Rectangle, ome::xml::model::Rights, ome::xml::model::ROIRef, ome::xml::model::UUID, ome::xml::model::WellSampleRef, ome::xml::model::OriginalMetadataAnnotation, ome::xml::model::Shape, ome::xml::model::LightSource, ome::xml::model::BasicAnnotation, ome::xml::model::ManufacturerSpec, ome::xml::model::NumericAnnotation, ome::xml::model::Reference, ome::xml::model::Settings, ome::xml::model::TextAnnotation, and ome::xml::model::TypeAnnotation.


The documentation for this class was generated from the following files: