当前位置: 首页>>代码示例>>Java>>正文


Java Locator类代码示例

本文整理汇总了Java中org.xml.sax.Locator的典型用法代码示例。如果您正苦于以下问题:Java Locator类的具体用法?Java Locator怎么用?Java Locator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Locator类属于org.xml.sax包,在下文中一共展示了Locator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ResultImpl

import org.xml.sax.Locator; //导入依赖的package包/类
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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:DomHandlerEx.java

示例2: getType

import org.xml.sax.Locator; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:TypeUtil.java

示例3: CPropertyInfo

import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:25,代码来源:CPropertyInfo.java

示例4: translateQualifiedName

import org.xml.sax.Locator; //导入依赖的package包/类
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));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:TWSDLParserContextImpl.java

示例5: ElementPattern

import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:ElementPattern.java

示例6: setDocumentLocator

import org.xml.sax.Locator; //导入依赖的package包/类
/**
 * 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;

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:17,代码来源:Digester.java

示例7: setDocumentLocator

import org.xml.sax.Locator; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:ParserAdapter.java

示例8: ModelGroupDeclImpl

import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:ModelGroupDeclImpl.java

示例9: CElementPropertyInfo

import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:CElementPropertyInfo.java

示例10: ModelGroupImpl

import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:ModelGroupImpl.java

示例11: makePattern

import org.xml.sax.Locator; //导入依赖的package包/类
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();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:SchemaBuilderImpl.java

示例12: setDocumentLocator

import org.xml.sax.Locator; //导入依赖的package包/类
/**
 * 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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:ContentHandlerTest.java

示例13: CEnumConstant

import org.xml.sax.Locator; //导入依赖的package包/类
/**
 * @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;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:CEnumConstant.java

示例14: Definitions

import org.xml.sax.Locator; //导入依赖的package包/类
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();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:Definitions.java

示例15: AttributeDeclImpl

import org.xml.sax.Locator; //导入依赖的package包/类
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;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:AttributeDeclImpl.java


注:本文中的org.xml.sax.Locator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。