net.sf.jaxme.impl
Class PMImpl

java.lang.Object
  extended bynet.sf.jaxme.impl.PMImpl
All Implemented Interfaces:
PM

public abstract class PMImpl
extends java.lang.Object
implements PM

Author:
Jochen Wiedmann

Nested Class Summary
static class PMImpl.ListObserver
           
 
Constructor Summary
PMImpl()
          Creates a new instance of PMImpl.java.
 
Method Summary
 java.lang.Object create()
          Creates a new, empty element.
 JAXBContextImpl getFactory()
          Returns the factory.
 QName getQName()
          Returns the fully qualified name of the document type handled by this manager.
 void init(JAXBContextImpl pFactory, java.lang.Class pElementInterface, QName pQName)
          Initializes the PM.
 void select(Observer pObserver, java.lang.String pQuery)
          Reads documents matching the given query.
 java.util.Iterator select(java.lang.String pQuery)
          Returns an iterator to all documents matching the given query.
 java.util.Iterator select(java.lang.String pQuery, PMParams pPlaceHolderArgs)
          Returns an iterator to all documents matching the given query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jaxme.PM
delete, insert, select, update
 

Constructor Detail

PMImpl

public PMImpl()

Creates a new instance of PMImpl.java.

Method Detail

init

public void init(JAXBContextImpl pFactory,
                 java.lang.Class pElementInterface,
                 QName pQName)
          throws JAXBException
Description copied from interface: PM

Initializes the PM. Called from the JAXBContextImpl upon initialization.

Specified by:
init in interface PM
Throws:
JAXBException

getQName

public QName getQName()
Description copied from interface: PM

Returns the fully qualified name of the document type handled by this manager.

Specified by:
getQName in interface PM

getFactory

public JAXBContextImpl getFactory()
Description copied from interface: PM

Returns the factory.

Specified by:
getFactory in interface PM

select

public void select(Observer pObserver,
                   java.lang.String pQuery)
            throws JAXBException
Description copied from interface: PM

Reads documents matching the given query. For any document matching, the Observer's notify method is executed with the matching document as an argument.

Specified by:
select in interface PM
Parameters:
pObserver - This Observer is notified for any matching document. The document is added as an argument.
pQuery - The query to perform.
Throws:
JAXBException

select

public java.util.Iterator select(java.lang.String pQuery)
                          throws JAXBException
Description copied from interface: PM

Returns an iterator to all documents matching the given query.

Specified by:
select in interface PM
Parameters:
pQuery - The query to perform.
Throws:
JAXBException

select

public java.util.Iterator select(java.lang.String pQuery,
                                 PMParams pPlaceHolderArgs)
                          throws JAXBException
Description copied from interface: PM

Returns an iterator to all documents matching the given query. The query may contain placeholders. If it does, you have to supply an instance of PMParams with the placeholder values. Example:

   manager.select("Name = ? and Id = ?",
                  new PMParams().addString("Someone").addInt(4));
 

Specified by:
select in interface PM
Parameters:
pQuery - The query to perform. May contain placeholders.
pPlaceHolderArgs - An array of objects or null, if the query doesn't contain any placeholders.
Throws:
JAXBException

create

public java.lang.Object create()
                        throws JAXBException
Description copied from interface: PM

Creates a new, empty element.

Specified by:
create in interface PM
Throws:
JAXBException