uk.ac.ebi.jmzidml.xml.io
Class MzIdentMLUnmarshaller

java.lang.Object
  extended by uk.ac.ebi.jmzidml.xml.io.MzIdentMLUnmarshaller

public class MzIdentMLUnmarshaller
extends Object


Constructor Summary
MzIdentMLUnmarshaller(File mzIdentMLFile)
           
MzIdentMLUnmarshaller(File mzIdentMLFile, MzIdentMLObjectCache cache)
          Deprecated. 
MzIdentMLUnmarshaller(MzIdentMLIndexer indexer)
           
MzIdentMLUnmarshaller(URL mzIdentMLFileURL)
           
MzIdentMLUnmarshaller(URL mzIdentMLFileURL, MzIdentMLObjectCache cache)
          Deprecated. 
 
Method Summary
 Map<String,String> getElementAttributes(String id, Class clazz)
          Method to retrieve attribute name-value pairs for a XML element defined by it's id and Class.
 Set<String> getIDsForElement(MzIdentMLElement element)
          Depends on the element being indexed and ID mapped.
 String getMzIdentMLId()
           
 String getMzIdentMLName()
           
 String getMzIdentMLVersion()
           
 int getObjectCountForXpath(String xpath)
           
<T extends MzIdentMLObject>
T
unmarshal(Class<T> clazz)
          Unmarshal one object for the specified class.
<T extends MzIdentMLObject>
T
unmarshal(Class<T> clazz, String id)
           
<T extends MzIdentMLObject>
T
unmarshal(MzIdentMLElement element)
          Unmarshals one element of the type defined by the MzIdentMLElement.
<T extends MzIdentMLObject>
T
unmarshal(String xpath)
           
<T extends MzIdentMLObject>
Iterator<T>
unmarshalCollectionFromXpath(MzIdentMLElement element)
           
<T extends MzIdentMLObject>
T
unmarshall(Class<T> clazz, String id)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MzIdentMLUnmarshaller

public MzIdentMLUnmarshaller(URL mzIdentMLFileURL)

MzIdentMLUnmarshaller

public MzIdentMLUnmarshaller(File mzIdentMLFile)

MzIdentMLUnmarshaller

public MzIdentMLUnmarshaller(MzIdentMLIndexer indexer)

MzIdentMLUnmarshaller

@Deprecated
public MzIdentMLUnmarshaller(URL mzIdentMLFileURL,
                                        MzIdentMLObjectCache cache)
Deprecated. 


MzIdentMLUnmarshaller

@Deprecated
public MzIdentMLUnmarshaller(File mzIdentMLFile,
                                        MzIdentMLObjectCache cache)
Deprecated. 

Method Detail

getMzIdentMLVersion

public String getMzIdentMLVersion()

getMzIdentMLId

public String getMzIdentMLId()

getMzIdentMLName

public String getMzIdentMLName()

getElementAttributes

public Map<String,String> getElementAttributes(String id,
                                               Class clazz)
Method to retrieve attribute name-value pairs for a XML element defined by it's id and Class.

Parameters:
id - the value of the 'id' attribute of the XML element.
clazz - the Class representing the XML element.
Returns:
A map of all the found name-value attribute pairs or null if no element with the specified id was found.

getObjectCountForXpath

public int getObjectCountForXpath(String xpath)
Parameters:
xpath - the xpath defining the XML element.
Returns:
the number of XML elements matching the xpath or -1 if no elements were found for the specified xpath.
See Also:
MzIdentMLIndexer.getCount(String)

unmarshal

public <T extends MzIdentMLObject> T unmarshal(Class<T> clazz)
Unmarshal one object for the specified class. Note: The class has to refer to MzIdentMLObject elements.

Parameters:
clazz - the type of Object to sub-class. It has to be a sub-class of MzIdentMLObject.
Returns:
a object of the specified class
See Also:
unmarshal(uk.ac.ebi.jmzidml.MzIdentMLElement)

unmarshal

public <T extends MzIdentMLObject> T unmarshal(String xpath)

unmarshal

public <T extends MzIdentMLObject> T unmarshal(MzIdentMLElement element)
Unmarshals one element of the type defined by the MzIdentMLElement. Note: In case there are more than one element for the specified MzIdentMLElement, only one found will be returned. This is usually the first such element, but no order is guaranteed! Use appropriate methods to check that there is only one such element or to deal with a collection of elements.

Parameters:
element - The MzIdentMLElement defining the type of element to unmarshal.
Returns:
A MzIdentMLObject according to the type defined by the MzIdentMLElement.
See Also:
unmarshalCollectionFromXpath(uk.ac.ebi.jmzidml.MzIdentMLElement)

unmarshalCollectionFromXpath

public <T extends MzIdentMLObject> Iterator<T> unmarshalCollectionFromXpath(MzIdentMLElement element)

getIDsForElement

public Set<String> getIDsForElement(MzIdentMLElement element)
                             throws ConfigurationException
Depends on the element being indexed and ID mapped. See configuration of elements via MzIdentMLElement.

Parameters:
element - the element for which to get the IDs.
Returns:
a Set of all IDs of the specified element.
Throws:
ConfigurationException
See Also:
MzIdentMLElement

unmarshall

@Deprecated
public <T extends MzIdentMLObject> T unmarshall(Class<T> clazz,
                                                           String id)
                                     throws javax.xml.bind.JAXBException
Deprecated. 

Throws:
javax.xml.bind.JAXBException

unmarshal

public <T extends MzIdentMLObject> T unmarshal(Class<T> clazz,
                                               String id)
                                    throws javax.xml.bind.JAXBException
Throws:
javax.xml.bind.JAXBException


Copyright © 2012. All Rights Reserved.