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


Java NotIdentifiableEventImpl类代码示例

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


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

示例1: onIDREF

import javax.xml.bind.helpers.NotIdentifiableEventImpl; //导入依赖的package包/类
public String onIDREF( Object obj ) throws SAXException {
    String id;
    try {
        id = getIdFromObject(obj);
    } catch (JAXBException e) {
        reportError(null,e);
        return null; // recover by returning null
    }
    idReferencedObjects.add(obj);
    if(id==null) {
        reportError( new NotIdentifiableEventImpl(
            ValidationEvent.ERROR,
            Messages.NOT_IDENTIFIABLE.format(),
            new ValidationEventLocatorImpl(obj) ) );
    }
    return id;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:XMLSerializer.java

示例2: reconcileID

import javax.xml.bind.helpers.NotIdentifiableEventImpl; //导入依赖的package包/类
void reconcileID() throws SAXException {
    // find objects that were not a part of the object graph
    idReferencedObjects.removeAll(objectsWithId);

    for( Object idObj : idReferencedObjects ) {
        try {
            String id = getIdFromObject(idObj);
            reportError( new NotIdentifiableEventImpl(
                ValidationEvent.ERROR,
                Messages.DANGLING_IDREF.format(id),
                new ValidationEventLocatorImpl(idObj) ) );
        } catch (JAXBException e) {
            // this error should have been reported already. just ignore here.
        }
    }

    // clear the garbage
    idReferencedObjects.clear();
    objectsWithId.clear();
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:XMLSerializer.java

示例3: reconcileIDs

import javax.xml.bind.helpers.NotIdentifiableEventImpl; //导入依赖的package包/类
/** Tests if all IDREFs have corresponding IDs. */
protected void reconcileIDs() throws SAXException {
    if(!validateID) return;
    
    for (Iterator itr = IDREFs.entrySet().iterator(); itr.hasNext();) {
        Map.Entry e = (Map.Entry) itr.next();
        
        if(IDs.contains(e.getKey()))
            continue;   // OK.
        
        // ID was not found.
        ValidatableObject source = (ValidatableObject)e.getValue();
        reportEvent(
            source,                
            new NotIdentifiableEventImpl( 
                ValidationEvent.ERROR,
                Messages.format( Messages.ID_NOT_FOUND, e.getKey() ),
                new ValidationEventLocatorImpl( source ) ) );
    }
    
    IDREFs.clear();
}
 
开发者ID:nhrdl,项目名称:javacash,代码行数:23,代码来源:ValidationContext.java

示例4: reconcileID

import javax.xml.bind.helpers.NotIdentifiableEventImpl; //导入依赖的package包/类
void reconcileID() throws AbortSerializationException {
    // find objects that were not a part of the object graph 
    idReferencedObjects.removeAll(objectsWithId);
    
    for( Iterator itr=idReferencedObjects.iterator(); itr.hasNext(); ) {
        IdentifiableObject o = (IdentifiableObject)itr.next();
        reportError( new NotIdentifiableEventImpl(
            ValidationEvent.ERROR,
            Messages.format(Messages.ERR_DANGLING_IDREF,o.____jaxb____getId()),
            new ValidationEventLocatorImpl(o) ) );
    }
    
    // clear the garbage
    idReferencedObjects.clear();
    objectsWithId.clear();
}
 
开发者ID:nhrdl,项目名称:javacash,代码行数:17,代码来源:SAXMarshaller.java

示例5: onIDREF

import javax.xml.bind.helpers.NotIdentifiableEventImpl; //导入依赖的package包/类
public String onIDREF( IdentifiableObject obj ) throws SAXException {
    idReferencedObjects.add(obj);
    String id = obj.____jaxb____getId();
    if(id==null) {
        reportError( new NotIdentifiableEventImpl(
            ValidationEvent.ERROR,
            Messages.format(Messages.ERR_NOT_IDENTIFIABLE),
            new ValidationEventLocatorImpl(obj) ) );
    }
    return id;
}
 
开发者ID:nhrdl,项目名称:javacash,代码行数:12,代码来源:SAXMarshaller.java


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