LibreOffice Module xmloff (master)  1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TokenContext Class Referenceabstract

handle attributes through an SvXMLTokenMap More...

#include <TokenContext.hxx>

Inheritance diagram for TokenContext:
[legend]
Collaboration diagram for TokenContext:
[legend]

Public Member Functions

 TokenContext (SvXMLImport &rImport, sal_uInt16 nPrefix, const OUString &rLocalName, const SvXMLTokenMapEntry *pAttributes, const SvXMLTokenMapEntry *pChildren)
 static token map More...
 
virtual void StartElement (const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
 call HandleAttribute for each attribute in the token map; create a warning for all others. More...
 
virtual SvXMLImportContextRef CreateChildContext (sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList) override
 call HandleChild for each child element in the token map; create a warning for all others. More...
 
virtual void Characters (const OUString &rChars) override
 Create a warning for all non-namespace character content. More...
 
- Public Member Functions inherited from SvXMLImportContext
bool IsPrefixFilledIn () const
 
sal_uInt16 GetPrefix () const
 
const OUString & GetLocalName () const
 
 SvXMLImportContext (SvXMLImport &rImport, sal_uInt16 nPrfx, const OUString &rLName)
 A contexts constructor does anything that is required if an element starts. More...
 
 SvXMLImportContext (SvXMLImport &rImport)
 
virtual ~SvXMLImportContext ()
 A contexts destructor does anything that is required if an element ends. More...
 
virtual void EndElement ()
 EndElement is called before a context will be destructed, but after an elements context has been parsed. More...
 
virtual void SAL_CALL startFastElement (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL startUnknownElement (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL endFastElement (sal_Int32 Element) override
 
virtual void SAL_CALL endUnknownElement (const OUString &Namespace, const OUString &Name) override
 
virtual css::uno::Reference< XFastContextHandler > SAL_CALL createFastChildContext (sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext (const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
 
virtual void SAL_CALL characters (const OUString &aChars) override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &aType) final override
 
virtual void SAL_CALL acquire () final override throw ()
 
virtual void SAL_CALL release () final override throw ()
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () final override
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () final override
 

Protected Member Functions

virtual void HandleAttribute (sal_uInt16 nToken, const OUString &rValue)=0
 will be called for each attribute More...
 
virtual SvXMLImportContextHandleChild (sal_uInt16 nToken, sal_uInt16 nPrefix, const OUString &rLocalName, const css::uno::Reference< css::xml::sax::XAttributeList > &xAttrList)=0
 will be called for each child element More...
 
- Protected Member Functions inherited from SvXMLImportContext
SvXMLImportGetImport ()
 
const SvXMLImportGetImport () const
 

Protected Attributes

const SvXMLTokenMapEntrympAttributes
 
const SvXMLTokenMapEntrympChildren
 static token map More...
 

Detailed Description

handle attributes through an SvXMLTokenMap

Definition at line 38 of file TokenContext.hxx.

Constructor & Destructor Documentation

TokenContext::TokenContext ( SvXMLImport rImport,
sal_uInt16  nPrefix,
const OUString &  rLocalName,
const SvXMLTokenMapEntry pAttributes,
const SvXMLTokenMapEntry pChildren 
)

static token map

Definition at line 39 of file TokenContext.cxx.

Member Function Documentation

void TokenContext::Characters ( const OUString &  rChars)
overridevirtual

Create a warning for all non-namespace character content.

Classes that wish to deal with character content have to override this method anyway, and will thus get rid of the warnings.

Reimplemented from SvXMLImportContext.

Definition at line 122 of file TokenContext.cxx.

References SvXMLImportContext::GetImport(), lcl_IsWhiteSpace(), SvXMLImport::SetError(), and XMLERROR_UNKNOWN_CHARACTERS.

SvXMLImportContextRef TokenContext::CreateChildContext ( sal_uInt16  nPrefix,
const OUString &  rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList 
)
overridevirtual

call HandleChild for each child element in the token map; create a warning for all others.

Classes that wish to override CreateChildContext may want to call the parent method for handling of defaults.

Reimplemented from SvXMLImportContext.

Reimplemented in XFormsInstanceContext.

Definition at line 88 of file TokenContext.cxx.

References aMap, SvXMLTokenMap::Get(), SvXMLImportContext::GetImport(), HandleChild(), mpChildren, nToken, SAL_WARN_IF, SvXMLImport::SetError(), XML_TOK_UNKNOWN, and XMLERROR_UNKNOWN_ELEMENT.

virtual void TokenContext::HandleAttribute ( sal_uInt16  nToken,
const OUString &  rValue 
)
protectedpure virtual
virtual SvXMLImportContext* TokenContext::HandleChild ( sal_uInt16  nToken,
sal_uInt16  nPrefix,
const OUString &  rLocalName,
const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList 
)
protectedpure virtual
void TokenContext::StartElement ( const css::uno::Reference< css::xml::sax::XAttributeList > &  xAttrList)
overridevirtual

call HandleAttribute for each attribute in the token map; create a warning for all others.

Classes that wish to override StartElement need to call the parent method.

Reimplemented from SvXMLImportContext.

Reimplemented in XFormsBindContext.

Definition at line 50 of file TokenContext.cxx.

References aMap, SvXMLTokenMap::Get(), SvXMLImportContext::GetImport(), SvXMLImport::GetNamespaceMap(), HandleAttribute(), i, mpAttributes, nCount, nToken, XMLImageStyle::rValue, SAL_WARN_IF, SvXMLImport::SetError(), XML_NAMESPACE_XMLNS, XML_TOK_UNKNOWN, and XMLERROR_UNKNOWN_ATTRIBUTE.

Referenced by XFormsBindContext::StartElement().

Member Data Documentation

const SvXMLTokenMapEntry* TokenContext::mpAttributes
protected

Definition at line 41 of file TokenContext.hxx.

Referenced by StartElement().

const SvXMLTokenMapEntry* TokenContext::mpChildren
protected

static token map

Definition at line 42 of file TokenContext.hxx.

Referenced by CreateChildContext().


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