Java 类org.xml.sax.Locator 实例源码

项目:OpenJSharp    文件:DomHandlerEx.java   
ResultImpl() {
    try {
        DocumentBuilderFactory factory = XmlFactory.createDocumentBuilderFactory(false); // safe - only used for BI
        s2d = new SAX2DOMEx(factory);
    } catch (ParserConfigurationException e) {
        throw new AssertionError(e);    // impossible
    }

    XMLFilterImpl f = new XMLFilterImpl() {
        @Override
        public void setDocumentLocator(Locator locator) {
            super.setDocumentLocator(locator);
            location = new LocatorImpl(locator);
        }
    };
    f.setContentHandler(s2d);

    setHandler(f);
}
项目:OpenJSharp    文件:TypeUtil.java   
/**
 * Obtains a {@link JType} object for the string representation
 * of a type.
 */
public static JType getType( JCodeModel codeModel,
    String typeName, ErrorReceiver errorHandler, Locator errorSource ) {

    try {
        return codeModel.parseType(typeName);
    } catch( ClassNotFoundException ee ) {

        // make it a warning
        errorHandler.warning( new SAXParseException(
            Messages.ERR_CLASS_NOT_FOUND.format(typeName)
            ,errorSource));

        // recover by assuming that it's a class that derives from Object
        return codeModel.directClass(typeName);
    }
}
项目:openjdk-jdk10    文件:CPropertyInfo.java   
protected CPropertyInfo(String name, boolean collection, XSComponent source,
                        CCustomizations customizations, Locator locator) {
    this.publicName = name;
    String n = null;

    Model m = Ring.get(Model.class);
    if (m != null) {
        n = m.getNameConverter().toVariableName(name);
    } else {
        n = NameConverter.standard.toVariableName(name);
    }

    if(!JJavaName.isJavaIdentifier(n))
        n = '_'+n;  // avoid colliding with the reserved names like 'abstract'.
    this.privateName = n;

    this.isCollection = collection;
    this.locator = locator;
    if(customizations==null)
        this.customizations = CCustomizations.EMPTY;
    else
        this.customizations = customizations;
    this.source = source;
}
项目:OpenJSharp    文件:TWSDLParserContextImpl.java   
public QName translateQualifiedName(Locator locator, String s) {
    if (s == null)
        return null;

    String prefix = XmlUtil.getPrefix(s);
    String uri = null;

    if (prefix == null) {
        uri = getDefaultNamespaceURI();
    } else {
        uri = getNamespaceURI(prefix);
        if (uri == null) {
            errorReceiver.error(locator, WsdlMessages.PARSING_UNKNOWN_NAMESPACE_PREFIX(prefix));
        }
    }

    return new QName(uri, XmlUtil.getLocalPart(s));
}
项目:OpenJSharp    文件:ElementPattern.java   
ElementPattern(NameClass nameClass, Pattern p, Locator loc) {
  super(false,
        ELEMENT_CONTENT_TYPE,
        combineHashCode(ELEMENT_HASH_CODE,
                        nameClass.hashCode(),
                        p.hashCode()));
  this.nameClass = nameClass;
  this.origNameClass = nameClass;
  this.p = p;
  this.loc = loc;
}
项目:lazycat    文件:Digester.java   
/**
 * Sets the document locator associated with our parser.
 *
 * @param locator
 *            The new locator
 */
@Override
public void setDocumentLocator(Locator locator) {

    if (saxLog.isDebugEnabled()) {
        saxLog.debug("setDocumentLocator(" + locator + ")");
    }

    this.locator = locator;

}
项目:OpenJSharp    文件:ParserAdapter.java   
/**
 * Adapter implementation method; do not call.
 * Adapt a SAX1 document locator event.
 *
 * @param locator A document locator.
 * @see org.xml.sax.ContentHandler#setDocumentLocator
 */
public void setDocumentLocator (Locator locator)
{
    this.locator = locator;
    if (contentHandler != null) {
        contentHandler.setDocumentLocator(locator);
    }
}
项目:OpenJSharp    文件:ModelGroupDeclImpl.java   
public ModelGroupDeclImpl( SchemaDocumentImpl owner,
    AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
    String _targetNamespace, String _name,
    ModelGroupImpl _modelGroup ) {

    super(owner,_annon,_loc,_fa,_targetNamespace,_name,false);
    this.modelGroup = _modelGroup;

    if(modelGroup==null)
        throw new IllegalArgumentException();
}
项目:openjdk-jdk10    文件:CElementPropertyInfo.java   
public CElementPropertyInfo(String name, CollectionMode collection, ID id, MimeType expectedMimeType, XSComponent source,
                            CCustomizations customizations, Locator locator, boolean required) {
    super(name, collection.col, source, customizations, locator);
    this.required = required;
    this.id = id;
    this.expectedMimeType = expectedMimeType;
    this.isValueList = collection.val;
}
项目:openjdk-jdk10    文件:ModelGroupImpl.java   
public ModelGroupImpl( SchemaDocumentImpl owner, AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa,
                       Compositor _compositor, ParticleImpl[] _children ) {

    super(owner,_annon,_loc,_fa);
    this.compositor = _compositor;
    this.children = _children;

    if(compositor==null)
        throw new IllegalArgumentException();
    for( int i=children.length-1; i>=0; i-- )
        if(children[i]==null)
            throw new IllegalArgumentException();
}
项目:openjdk-jdk10    文件:SchemaBuilderImpl.java   
public ParsedPattern makePattern(ParsedPattern except, Location loc, Annotations anno)
        throws BuildException {
    try {
        return pb.makeDataExcept(dtb.createDatatype(), (Pattern) except, (Locator) loc);
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        if (detail != null) {
            error("invalid_params_detail", detail, (Locator) loc);
        } else {
            error("invalid_params", (Locator) loc);
        }
        return pb.makeError();
    }
}
项目:openjdk-jdk10    文件:ContentHandlerTest.java   
/**
 * Write setDocumentLocator tag when meet setDocumentLocator event.
 */
@Override
public void setDocumentLocator(Locator locator) {
    try {
        this.locator = locator;
        println("setDocumentLocator...");
    } catch (SAXException ex) {
        System.err.println(WRITE_ERROR + ex);
    }
}
项目:openjdk-jdk10    文件:CEnumConstant.java   
/**
 * @param name
 */
public CEnumConstant(String name, String javadoc, String lexical, XSComponent source, CCustomizations customizations, Locator loc) {
    assert name!=null;
    this.name = name;
    this.javadoc = javadoc;
    this.lexical = lexical;
    this.source = source;
    this.customizations = customizations;
    this.locator = loc;
}
项目:OpenJSharp    文件:Definitions.java   
public Definitions(AbstractDocument document, Locator locator) {
    super(locator);
    _document = document;
    _bindings = new ArrayList();
    _imports = new ArrayList();
    _messages = new ArrayList();
    _portTypes = new ArrayList();
    _services = new ArrayList();
    _importedNamespaces = new HashSet();
    _helper = new ExtensibilityHelper();
}
项目:OpenJSharp    文件:AttributeDeclImpl.java   
public AttributeDeclImpl( SchemaDocumentImpl owner,
    String _targetNamespace, String _name,
    AnnotationImpl _annon, Locator _loc, ForeignAttributesImpl _fa, boolean _anonymous,
    XmlString _defValue, XmlString _fixedValue,
    Ref.SimpleType _type ) {

    super(owner,_annon,_loc,_fa,_targetNamespace,_name,_anonymous);

    if(_name==null) // assertion failed.
        throw new IllegalArgumentException();

    this.defaultValue = _defValue;
    this.fixedValue = _fixedValue;
    this.type = _type;
}
项目:OpenJSharp    文件:AbstractCElement.java   
public Locator getLocator() {
    return locator;
}
项目:openjdk-jdk10    文件:BIElement.java   
/**
 * Gets the source location where this element is declared.
 */
public Locator getLocation() {
    return DOMLocator.getLocationInfo(e);
}
项目:TuLiPA-frames    文件:LemmaContentHandler.java   
public Locator getLocator() {
    return locator;
}
项目:OpenJSharp    文件:BIElement.java   
/**
 * Gets the source location where this element is declared.
 */
public Locator getLocation() {
    return DOMLocator.getLocationInfo(e);
}
项目:OpenJSharp    文件:SimpleType_Union.java   
public SimpleType_Union(NGCCRuntimeEx runtime, AnnotationImpl _annotation, Locator _locator, ForeignAttributesImpl _fa, String _name, Set _finalSet) {
    this(null, runtime, runtime, -1, _annotation, _locator, _fa, _name, _finalSet);
}
项目:openjdk-jdk10    文件:ModelObject.java   
public Locator getLocator(){
    return entity.getLocator();
}
项目:openjdk-jdk10    文件:SchemaContentHandler.java   
public void setDocumentLocator(Locator locator) {
    fSAXLocatorWrapper.setLocator(locator);
}
项目:incubator-netbeans    文件:ParsingLayerCacheManager.java   
public void setDocumentLocator(Locator locator) {
    this.locator = locator;
}
项目:OpenJSharp    文件:ErrorReporter.java   
void warning( Locator loc, String prop, Object... args ) {
    errorReceiver.warning( new SAXParseException(
        Messages.format(prop,args), loc ));
}
项目:openjdk-jdk10    文件:CPluginCustomization.java   
public CPluginCustomization(Element element, Locator locator) {
    this.element = element;
    this.locator = locator;
}
项目:incubator-netbeans    文件:NbMessageEmitter.java   
public void setDocumentLocator(Locator locator) {
}
项目:openjdk-jdk10    文件:RestrictionViolationException.java   
Locator getLocator() {
    return loc;
}
项目:openjdk-jdk10    文件:SchemaBuilderImpl.java   
private void error(String key, Locator loc) throws BuildException {
    error(new SAXParseException(localizer.message(key), loc));
}
项目:openjdk-jdk10    文件:GlobalEntity.java   
public GlobalEntity(Defining defining, Locator locator, ErrorReceiver errorReceiver) {
    super(locator);
    _defining = defining;
    this.errorReceiver = errorReceiver;
}
项目:openjdk-jdk10    文件:MemberSubmissionAddressingExtensionHandler.java   
private void warn(Locator location) {
    errReceiver.warning(location,
            ModelerMessages.WSDLMODELER_WARNING_MEMBER_SUBMISSION_ADDRESSING_USED(
                    AddressingVersion.MEMBER.nsUri, W3CAddressingMetadataConstants.WSAM_NAMESPACE_NAME));
}
项目:openjdk-jdk10    文件:CClassInfo.java   
public CClassInfo(Model model,JPackage pkg, String shortName, Locator location, QName typeName, QName elementName, XSComponent source, CCustomizations customizations) {
    this(model,model.getPackage(pkg),shortName,location,typeName,elementName,source,customizations);
}
项目:openjdk-jdk10    文件:DOMForestScanner.java   
public String getPublicId() {
    Locator l = findLocator();
    if(l!=null)     return l.getPublicId();
    return          null;
}
项目:OpenJSharp    文件:ToXMLSAXHandler.java   
/**
 * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator)
 */
public void setDocumentLocator(Locator arg0)
{
    super.setDocumentLocator(arg0);
    m_saxHandler.setDocumentLocator(arg0);
}
项目:openjdk-jdk10    文件:CodeModelClassFactory.java   
public JDefinedClass createClass( JClassContainer parent, int mod, String name, Locator source ) {
    return createClass(parent,mod,name,source,ClassType.CLASS);
}
项目:openjdk-jdk10    文件:wildcardBody.java   
public wildcardBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator) {
    super(source, parent, cookie);
    $runtime = runtime;
    this.locator = _locator;
    $_ngcc_current_state = 10;
}
项目:OpenJSharp    文件:SchemaBuilderImpl.java   
public ParsedPattern makeAttribute(ParsedNameClass nc, ParsedPattern p, Location loc, Annotations anno)
        throws BuildException {
    return pb.makeAttribute((NameClass) nc, (Pattern) p, (Locator) loc);
}
项目:OpenJSharp    文件:ForkingFilter.java   
@Override
public void setDocumentLocator(Locator locator) {
    super.setDocumentLocator(locator);
    this.loc = locator;
}
项目:HtmlCompat    文件:HtmlToSpannedConverter.java   
public void setDocumentLocator(Locator locator) {
}
项目:openjdk-jdk10    文件:LocatorTable.java   
public Locator getEndLocation( Element e ) {
    return (Locator)endLocations.get(e);
}
项目:openjdk-jdk10    文件:SchemaParser.java   
private void warning(String key, String arg, Locator loc) throws SAXException {
    warning(new SAXParseException(localizer.message(key, arg), loc));
}