Java Code Examples for org.xml.sax.helpers.DefaultHandler#startElement()

The following examples show how to use org.xml.sax.helpers.DefaultHandler#startElement() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CategoryDatasetHandler.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 2
Source File: PieDatasetHandler.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 3
Source File: CategoryDatasetHandler.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 4
Source File: PieDatasetHandler.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 5
Source File: CategoryDatasetHandler.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 6
Source File: PieDatasetHandler.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 7
Source File: CategoryDatasetHandler.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 8
Source File: PieDatasetHandler.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 9
Source File: CategoryDatasetHandler.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 10
Source File: PieDatasetHandler.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 11
Source File: CategoryDatasetHandler.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 12
Source File: PieDatasetHandler.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 13
Source File: CategoryDatasetHandler.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 14
Source File: PieDatasetHandler.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 15
Source File: CategoryDatasetHandler.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 16
Source File: PieDatasetHandler.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 17
Source File: CategoryDatasetHandler.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * The start of an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(CATEGORYDATASET_TAG)) {
        this.dataset = new DefaultCategoryDataset();
    }
    else if (qName.equals(SERIES_TAG)) {
        CategorySeriesHandler subhandler = new CategorySeriesHandler(this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }
    else {
        throw new SAXException("Element not recognised: " + qName);
    }

}
 
Example 18
Source File: PieDatasetHandler.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Starts an element.
 *
 * @param namespaceURI  the namespace.
 * @param localName  the element name.
 * @param qName  the element name.
 * @param atts  the element attributes.
 *
 * @throws SAXException for errors.
 */
@Override
public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes atts) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
        current.startElement(namespaceURI, localName, qName, atts);
    }
    else if (qName.equals(PIEDATASET_TAG)) {
        this.dataset = new DefaultPieDataset();
    }
    else if (qName.equals(ITEM_TAG)) {
        ItemHandler subhandler = new ItemHandler(this, this);
        getSubHandlers().push(subhandler);
        subhandler.startElement(namespaceURI, localName, qName, atts);
    }

}
 
Example 19
Source File: PolicyManager.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public void startElement( String uri, String localName, String qName,
        Attributes attributes ) throws SAXException
{
    super.startElement(uri, localName, qName, attributes);
    for (DefaultHandler delegate : delegates) {
        delegate.startElement(uri, localName, qName, attributes);
    }
    boolean policy = false;
    if ( localName != null && localName.equals(POLICY)){
        policy = true;
    }
    if ( qName != null && qName.endsWith(COLON_POLICY) ) {
        policy = true;
    }
    if ( !policy ){
        return;
    }
    else {
        hasPolicy = true;
    }
    int count = attributes.getLength();
    for (int i=0; i<count ; i++) {
        String value = attributes.getValue(i);
        String attrLocalName = attributes.getLocalName(i);
        String attrQName = attributes.getQName(i);
        
        if ( (attrLocalName!=null && attrLocalName.equals(ID)) || 
                (attrLocalName!= null && attrQName.endsWith(COLON_ID)))
        {
            policies.add( attributes.getValue(i));
        }
    }
}