Package org.xml.sax

Examples of org.xml.sax.Locator


        Object cur = currentElement();
        Object scope = (cur instanceof ClassMetaData)
            ? ((ClassMetaData) cur).getDescribedType() : null;
        seq.setSource(getSourceFile(), scope, SourceTracker.SRC_XML);
        Locator locator = getLocation().getLocator();
        if (locator != null) {
            seq.setLineNumber(locator.getLineNumber());
            seq.setColNumber(locator.getColumnNumber());
        }
        pushElement(seq);
        return true;
    }
View Full Code Here


        Object cur = currentElement();
        Object scope = (cur instanceof ClassMetaData)
            ? ((ClassMetaData) cur).getDescribedType() : null;
        result.setSource(getSourceFile(), scope, SourceTracker.SRC_XML);
        Locator locator = getLocation().getLocator();
        if (locator != null) {
            result.setLineNumber(locator.getLineNumber());
            result.setColNumber(locator.getColumnNumber());
        }
        pushElement(result);
        return true;
    }
View Full Code Here

  public Object getCastFromString(SimpleTypeSG pController, String pValue) throws SAXException {
    try {
      return new Integer(new DatatypeConverterImpl().parseInt(pValue));
    } catch (NumberFormatException e) {
      Locator locator;
      try {
        locator = getLocator();
      } catch (Exception f) {
        throw new SAXException("Failed to convert string value to integer: " + pValue);
      }
View Full Code Here

      }
    }
    parent = pParent;
    XSContext context = getContext();
    if (context != null) {
      Locator loc = context.getLocator();
      locator = loc == null ? null : new LocatorImpl(getContext().getLocator());
    } else {
      locator = null;
    }
  }
View Full Code Here

      mySchema.redefine(factory.newXSType(mySchema, type));
    } else if (pChild instanceof XsTComplexType) {
      XsTComplexType type = (XsTComplexType) pChild;
      mySchema.redefine(factory.newXSType(mySchema, type));
    } else {
      Locator locator = (pChild instanceof XsObject) ? ((XsObject) pChild).getLocator() : pRedefine.getLocator();
      throw new LocSAXException("Unknown type for redefinition: " + pChild.getClass().getName() +
                                   ", perhaps you should handle this in a subclass?", locator);
    }
  }
View Full Code Here

      mySchema.add(factory.newXSAttribute(mySchema, attribute));
    } else if (pChild instanceof XsENotation) {
      XsENotation notation = (XsENotation) pChild;
      mySchema.add(factory.newXSNotation(mySchema, notation));
    } else {
      Locator locator = (pChild instanceof XsObject) ?
        ((XsObject) pChild).getLocator() : pSyntaxSchema.getLocator();
      throw new LocSAXException("Unknown child type: " + pChild.getClass().getName() +
                                   ", perhaps you should handle this in a subclass?", locator);
    }
  }
View Full Code Here

    XsAnyURI schemaLocation = pInclude.getSchemaLocation();
    if (schemaLocation == null) {
      throw new LocSAXException("Invalid include: Missing 'schemaLocation' attribute.",
                                   pInclude.getLocator());
    }
    Locator locator = pInclude.getLocator();
    InputSource schemaSource = getInputSource(locator == null ? null : locator.getSystemId(),
                                              schemaLocation.toString());
    XsESchema includedSchema = parseSyntax(schemaSource);
    XsAnyURI incNamespace = includedSchema.getTargetNamespace();
    if (incNamespace == null) {
      includedSchema.setTargetNamespace(includedSchema.getTargetNamespace());
View Full Code Here

      String arg2,
      Attributes arg3)
      throws SAXException
    {
      super.startElement(arg0, arg1, arg2, arg3);
      Locator l = getDocumentLocator();
      if (l != null)
      {
        ((LineNumberElement) getCurrentElement()).setStartLine(
          l.getLineNumber());
      }
    }
View Full Code Here

    /** override */
    public void endElement(String arg0, String arg1, String arg2)
      throws SAXException
    {
      Locator l = getDocumentLocator();
      if (l != null)
      {
        ((LineNumberElement) getCurrentElement()).setEndLine(
          l.getLineNumber());
      }

      super.endElement(arg0, arg1, arg2);
    }
View Full Code Here

                    }

                } catch (ExpressionException e) {
                    // something went wrong when evaluating the xpath.
                    // Send an error down the pipeline
                    Locator locator = pipelineContext.getCurrentLocator();
                    XMLPipelineException se = new XMLPipelineException(
                            "Could not evaluate the expression " +
                                    value,
                            locator,
                            e);
View Full Code Here

TOP

Related Classes of org.xml.sax.Locator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.