本文整理汇总了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;
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}