Example usage for org.apache.poi.hpsf ClassID equals

List of usage examples for org.apache.poi.hpsf ClassID equals

Introduction

In this page you can find the example usage for org.apache.poi.hpsf ClassID equals.

Prototype

@Override
public boolean equals(final Object o) 

Source Link

Document

Checks whether this ClassID is equal to another object.

Usage

From source file:org.ddt.listener.ole.MonikerFactory.java

License:Apache License

/**
 * Retrieves the appropriate Moniker type for the given class id.
 *
 * The Moniker is initialised from the input stream.
 *
 * @param clsid The class id of the Moniker type
 * @param is The <code>DocumentInputStream</code> to read the Moniker from.
 * @return A Moniker, or <b>null</b> if the class id is not recognised.
 * @throws IOException//  www  .j av a  2s.  c o m
 * @throws BadOleStreamException If a malformed Moniker Stream is found. 
 */
static Moniker getMoniker(ClassID clsid, DocumentInputStream is) throws IOException, BadOleStreamException {
    if (clsid.equals(FILE_MONIKER_ID)) {
        return new FileMoniker(is);
    } else if (clsid.equals(COMPOSITE_MONIKER_ID)) {
        return new CompositeMoniker(is);
    } else if (clsid.equals(URL_MONIKER_ID)) {
        return new URLMoniker(is);
    } else if (clsid.equals(ITEM_MONIKER_ID)) {
        return new ItemMoniker(is);
    } else {
        log.log(Level.WARNING, "ClassID unknown: {0}", clsid.toString());
        return null;
    }

}