Java 类javax.xml.bind.helpers.ValidationEventLocatorImpl 实例源码

项目:OpenJSharp    文件:XMLSerializer.java   
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;
}
项目:OpenJSharp    文件:XMLSerializer.java   
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();
}
项目:OpenJSharp    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:openjdk-jdk10    文件:XMLSerializer.java   
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;
}
项目:openjdk-jdk10    文件:XMLSerializer.java   
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();
}
项目:openjdk-jdk10    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:openjdk9    文件:XMLSerializer.java   
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;
}
项目:openjdk9    文件:XMLSerializer.java   
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();
}
项目:openjdk9    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:lookaside_java-1.8.0-openjdk    文件:XMLSerializer.java   
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;
}
项目:lookaside_java-1.8.0-openjdk    文件:XMLSerializer.java   
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();
}
项目:lookaside_java-1.8.0-openjdk    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:infobip-open-jdk-8    文件:XMLSerializer.java   
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;
}
项目:infobip-open-jdk-8    文件:XMLSerializer.java   
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();
}
项目:infobip-open-jdk-8    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:cxf-plus    文件:XMLSerializer.java   
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;
}
项目:cxf-plus    文件:XMLSerializer.java   
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();
}
项目:cxf-plus    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:OLD-OpenJDK8    文件:XMLSerializer.java   
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;
}
项目:OLD-OpenJDK8    文件:XMLSerializer.java   
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();
}
项目:OLD-OpenJDK8    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:openjdk-icedtea7    文件:XMLSerializer.java   
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;
}
项目:openjdk-icedtea7    文件:XMLSerializer.java   
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();
}
项目:openjdk-icedtea7    文件:StAXConnector.java   
protected final void handleStartDocument(NamespaceContext nsc) throws SAXException {
    visitor.startDocument(new LocatorEx() {
        public ValidationEventLocator getLocation() {
            return new ValidationEventLocatorImpl(this);
        }
        public int getColumnNumber() {
            return getCurrentLocation().getColumnNumber();
        }
        public int getLineNumber() {
            return getCurrentLocation().getLineNumber();
        }
        public String getPublicId() {
            return getCurrentLocation().getPublicId();
        }
        public String getSystemId() {
            return getCurrentLocation().getSystemId();
        }
    },nsc);
}
项目:javacash    文件:ValidationContext.java   
/** 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();
}
项目:javacash    文件:SAXMarshaller.java   
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();
}
项目:javacash    文件:Util.java   
/**
 * Reports a print conversion error while marshalling.
 */
public static void handlePrintConversionException(
    Object caller, Exception e, XMLSerializer serializer ) throws SAXException {

    if( e instanceof SAXException )
        // assume this exception is not from application.
        // (e.g., when a marshaller aborts the processing, this exception
        //        will be thrown) 
        throw (SAXException)e;

    String message = e.getMessage();
    if(message==null) {
        message = e.toString();
    }

    ValidationEvent ve = new PrintConversionEventImpl(
        ValidationEvent.ERROR, message,
        new ValidationEventLocatorImpl(caller), e );
    serializer.reportError(ve);
}
项目:wustl-common-package    文件:ValidationContext.java   
/** 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();
}
项目:wustl-common-package    文件:SAXMarshaller.java   
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();
}
项目:wustl-common-package    文件:Util.java   
/**
 * Reports a print conversion error while marshalling.
 */
public static void handlePrintConversionException(
    Object caller, Exception e, XMLSerializer serializer ) throws SAXException {

    if( e instanceof SAXException )
        // assume this exception is not from application.
        // (e.g., when a marshaller aborts the processing, this exception
        //        will be thrown) 
        throw (SAXException)e;

    String message = e.getMessage();
    if(message==null) {
        message = e.toString();
    }

    ValidationEvent ve = new PrintConversionEventImpl(
        ValidationEvent.ERROR, message,
        new ValidationEventLocatorImpl(caller), e );
    serializer.reportError(ve);
}
项目:OpenJSharp    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:openjdk-jdk10    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:openjdk9    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:geoxygene    文件:RenderingMethodValidatorXML.java   
@Override
protected boolean validateContent() {
    if (this.content == null)
        return false;
    RenderingMethodDescriptor erm = (RenderingMethodDescriptor) this.content;
    File shader_dir = null;
    String all_shaders = ":";
    shader_dir = new File(SHADER_PATH);
    if (shader_dir.exists() && shader_dir.isDirectory()) {
        for (File f : shader_dir.listFiles()) {
            all_shaders += f.getName() + ":";
        }
    }
    // Check that the shaders exist.
    boolean success = true;
    for (ShaderRef shader : erm.lshaderref) {
                if (!all_shaders.contains(shader.location.toString())) {
                    String error_msg = "The shader named " + shader.location.toString() + " doesn't exist or cannot be read in the shader directory " + (shader_dir == null ? "<null>" : shader_dir.getPath())
                            + ".";
                    ValidationEventLocatorImpl locator = new ValidationEventLocatorImpl(erm);
                    this.eventHandler.handleEvent(new SLDValidationEvent(ValidationEvent.FATAL_ERROR, error_msg, ll.getLocation(erm)));
                    success = false;
                }
        }
    // TODO : check if the parameters types and their restrictions are
    // valid.
    return success;
}
项目:lookaside_java-1.8.0-openjdk    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:infobip-open-jdk-8    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:cxf-plus    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:cxf-plus    文件:RuntimeUtil.java   
/**
 * Reports a print conversion error while marshalling.
 */
public static void handlePrintConversionException(
    Object caller, Exception e, XMLSerializer serializer ) throws SAXException {

    if( e instanceof SAXException )
        // assume this exception is not from application.
        // (e.g., when a marshaller aborts the processing, this exception
        //        will be thrown)
        throw (SAXException)e;

    ValidationEvent ve = new PrintConversionEventImpl(
        ValidationEvent.ERROR, e.getMessage(),
        new ValidationEventLocatorImpl(caller), e );
    serializer.reportError(ve);
}
项目:OLD-OpenJDK8    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}
项目:openjdk-icedtea7    文件:XMLSerializer.java   
/**
 * Called when a referenced object doesn't have an ID.
 */
public void errorMissingId(Object obj) throws SAXException {
    reportError( new ValidationEventImpl(
        ValidationEvent.ERROR,
        Messages.MISSING_ID.format(obj),
        new ValidationEventLocatorImpl(obj)) );
}