/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* $Id: FOValidationEventProducer.java 1608161 2014-07-06 04:32:11Z gadams $ */

package org.apache.fop.fo;

import org.xml.sax.Locator;

import org.apache.xmlgraphics.util.QName;

import org.apache.fop.apps.FOPException;
import org.apache.fop.events.EventBroadcaster;
import org.apache.fop.events.EventProducer;
import org.apache.fop.fo.expr.PropertyException;

Event producer interface for XSL-FO validation messages.
/** * Event producer interface for XSL-FO validation messages. */
public interface FOValidationEventProducer extends EventProducer {
Provider class for the event producer.
/** * Provider class for the event producer. */
final class Provider { private Provider() { }
Returns an event producer.
Params:
  • broadcaster – the event broadcaster to use
Returns:the event producer
/** * Returns an event producer. * @param broadcaster the event broadcaster to use * @return the event producer */
public static FOValidationEventProducer get(EventBroadcaster broadcaster) { return broadcaster.getEventProducerFor(FOValidationEventProducer.class); } }
Too many child nodes.
Params:
  • source – the event source
  • elementName – the name of the context node
  • offendingNode – the offending node
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * Too many child nodes. * @param source the event source * @param elementName the name of the context node * @param offendingNode the offending node * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void tooManyNodes(Object source, String elementName, QName offendingNode, Locator loc) throws ValidationException;
The node order is wrong.
Params:
  • source – the event source
  • elementName – the name of the context node
  • tooLateNode – string name of node that should be earlier in document
  • tooEarlyNode – string name of node that should be later in document
  • canRecover – indicates whether FOP can recover from this problem and continue working
  • loc – the location of the error or null
Throws:
/** * The node order is wrong. * @param source the event source * @param elementName the name of the context node * @param tooLateNode string name of node that should be earlier in document * @param tooEarlyNode string name of node that should be later in document * @param canRecover indicates whether FOP can recover from this problem and continue working * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call */
void nodeOutOfOrder(Object source, String elementName, String tooLateNode, String tooEarlyNode, boolean canRecover, Locator loc) throws ValidationException;
An invalid child was encountered.
Params:
  • source – the event source
  • elementName – the name of the context node
  • offendingNode – the offending node
  • ruleViolated – the rule that was violated or null
  • loc – the location of the error or null
Throws:
/** * An invalid child was encountered. * @param source the event source * @param elementName the name of the context node * @param offendingNode the offending node * @param ruleViolated the rule that was violated or null * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call */
void invalidChild(Object source, String elementName, QName offendingNode, String ruleViolated, Locator loc) throws ValidationException;
A valid but not yet supported child was encountered.
Params:
  • source – the event source
  • elementName – the name of the context node
  • offendingNode – the offending node
  • loc – the location of the error or null
Throws:
/** * A valid but not yet supported child was encountered. * * @param source the event source * @param elementName the name of the context node * @param offendingNode the offending node * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call */
void notSupportedChild(Object source, String elementName, QName offendingNode, Locator loc) throws ValidationException;
A required child element is missing.
Params:
  • source – the event source
  • elementName – the name of the context node
  • contentModel – the expected content model
  • canRecover – indicates whether FOP can recover from this problem and continue working
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * A required child element is missing. * @param source the event source * @param elementName the name of the context node * @param contentModel the expected content model * @param canRecover indicates whether FOP can recover from this problem and continue working * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void missingChildElement(Object source, String elementName, String contentModel, boolean canRecover, Locator loc) throws ValidationException;
An element is missing a required property.
Params:
  • source – the event source
  • elementName – the name of the context node
  • propertyName – the name of the missing property
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * An element is missing a required property. * @param source the event source * @param elementName the name of the context node * @param propertyName the name of the missing property * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void missingProperty(Object source, String elementName, String propertyName, Locator loc) throws ValidationException;
An id was used twice in a document.
Params:
  • source – the event source
  • elementName – the name of the context node
  • id – the id that was reused
  • canRecover – indicates whether FOP can recover from this problem and continue working
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * An id was used twice in a document. * @param source the event source * @param elementName the name of the context node * @param id the id that was reused * @param canRecover indicates whether FOP can recover from this problem and continue working * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void idNotUnique(Object source, String elementName, String id, boolean canRecover, Locator loc) throws ValidationException;
There are multiple color profiles defined with the same name.
Params:
  • source – the event source
  • elementName – the name of the context node
  • name – the duplicate color profile name
  • loc – the location of the error or null
@event.severityWARN
/** * There are multiple color profiles defined with the same name. * @param source the event source * @param elementName the name of the context node * @param name the duplicate color profile name * @param loc the location of the error or null * @event.severity WARN */
void colorProfileNameNotUnique(Object source, String elementName, String name, Locator loc);
There are multiple page masters defined with the same name.
Params:
  • source – the event source
  • elementName – the name of the context node
  • name – the duplicate page master name
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * There are multiple page masters defined with the same name. * @param source the event source * @param elementName the name of the context node * @param name the duplicate page master name * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void masterNameNotUnique(Object source, String elementName, String name, Locator loc) throws ValidationException;
An fo:marker appears as initial descendant in an fo:block-container that generates absolutely positioned areas
Params:
  • source – the event source
  • loc – the location of the error (possibly null)
@event.severityERROR
/** * An fo:marker appears as initial descendant in an fo:block-container * that generates absolutely positioned areas * @param source the event source * @param loc the location of the error (possibly null) * @event.severity ERROR */
void markerBlockContainerAbsolutePosition(Object source, Locator loc);
A marker is not an initial child on a node.
Params:
  • source – the event source
  • elementName – the name of the context node
  • mcname – the marker class name
  • loc – the location of the error or null
@event.severityERROR
/** * A marker is not an initial child on a node. * @param source the event source * @param elementName the name of the context node * @param mcname the marker class name * @param loc the location of the error or null * @event.severity ERROR */
void markerNotInitialChild(Object source, String elementName, String mcname, Locator loc);
A marker class name is not unique within the same parent.
Params:
  • source – the event source
  • elementName – the name of the context node
  • mcname – the marker class name
  • loc – the location of the error or null
@event.severityERROR
/** * A marker class name is not unique within the same parent. * @param source the event source * @param elementName the name of the context node * @param mcname the marker class name * @param loc the location of the error or null * @event.severity ERROR */
void markerNotUniqueForSameParent(Object source, String elementName, String mcname, Locator loc);
An invalid property was found.
Params:
  • source – the event source
  • elementName – the name of the context node
  • attr – the invalid attribute
  • canRecover – indicates whether FOP can recover from this problem and continue working
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * An invalid property was found. * @param source the event source * @param elementName the name of the context node * @param attr the invalid attribute * @param canRecover indicates whether FOP can recover from this problem and continue working * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void invalidProperty(Object source, String elementName, QName attr, boolean canRecover, Locator loc) throws ValidationException;
An invalid property value was encountered.
Params:
  • source – the event source
  • elementName – the name of the context node
  • propName – the property name
  • propValue – the property value
  • e – the property exception caused by the invalid value
  • loc – the location of the error or null
@event.severityERROR
/** * An invalid property value was encountered. * @param source the event source * @param elementName the name of the context node * @param propName the property name * @param propValue the property value * @param e the property exception caused by the invalid value * @param loc the location of the error or null * @event.severity ERROR */
void invalidPropertyValue(Object source, String elementName, String propName, String propValue, PropertyException e, Locator loc);
An invalid property value was encountered.
Params:
  • source – the event source
  • elementName – the name of the context node
  • propName – the property name
  • propValue – the property value
  • e – the property exception caused by the invalid value
  • loc – the location of the error or null
@event.severityWARN
/** * An invalid property value was encountered. * @param source the event source * @param elementName the name of the context node * @param propName the property name * @param propValue the property value * @param e the property exception caused by the invalid value * @param loc the location of the error or null * @event.severity WARN */
void warnOnInvalidPropertyValue(Object source, String elementName, String propName, String propValue, PropertyException e, Locator loc);
A feature is not supported, yet.
Params:
  • source – the event source
  • elementName – the name of the context node
  • feature – the unsupported feature
  • loc – the location of the error or null
@event.severityWARN
/** * A feature is not supported, yet. * @param source the event source * @param elementName the name of the context node * @param feature the unsupported feature * @param loc the location of the error or null * @event.severity WARN */
void unimplementedFeature(Object source, String elementName, String feature, Locator loc);
Missing internal-/external-destination on basic-link or bookmark.
Params:
  • source – the event source
  • elementName – the name of the context node
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * Missing internal-/external-destination on basic-link or bookmark. * @param source the event source * @param elementName the name of the context node * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void missingLinkDestination(Object source, String elementName, Locator loc) throws ValidationException;
Indicates a problem while cloning a marker (ex. due to invalid property values).
Params:
  • source – the event source
  • markerClassName – the "marker-class-name" of the marker
  • fe – the FOP exception that cause this problem
  • loc – the location of the error or null
@event.severityERROR
/** * Indicates a problem while cloning a marker (ex. due to invalid property values). * @param source the event source * @param markerClassName the "marker-class-name" of the marker * @param fe the FOP exception that cause this problem * @param loc the location of the error or null * @event.severity ERROR */
void markerCloningFailed(Object source, String markerClassName, FOPException fe, Locator loc);
A region name is mapped to multiple region classes.
Params:
  • source – the event source
  • regionName – the region name
  • defaultRegionClass1 – the first default region class
  • defaultRegionClass2 – the second default region class
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * A region name is mapped to multiple region classes. * @param source the event source * @param regionName the region name * @param defaultRegionClass1 the first default region class * @param defaultRegionClass2 the second default region class * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void regionNameMappedToMultipleRegionClasses(Object source, String regionName, String defaultRegionClass1, String defaultRegionClass2, Locator loc) throws ValidationException;
There are multiple flows with the same name.
Params:
  • source – the event source
  • elementName – the name of the context node
  • flowName – the flow name
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * There are multiple flows with the same name. * @param source the event source * @param elementName the name of the context node * @param flowName the flow name * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void duplicateFlowNameInPageSequence(Object source, String elementName, String flowName, Locator loc) throws ValidationException;
A flow name could not be mapped to a region.
Params:
  • source – the event source
  • elementName – the name of the context node
  • flowName – the flow name
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * A flow name could not be mapped to a region. * @param source the event source * @param elementName the name of the context node * @param flowName the flow name * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void flowNameNotMapped(Object source, String elementName, String flowName, Locator loc) throws ValidationException;
A page master could not be found.
Params:
  • source – the event source
  • elementName – the name of the context node
  • masterReference – the page master reference
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * A page master could not be found. * @param source the event source * @param elementName the name of the context node * @param masterReference the page master reference * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void masterNotFound(Object source, String elementName, String masterReference, Locator loc) throws ValidationException;
An illegal region name was used.
Params:
  • source – the event source
  • elementName – the name of the context node
  • regionName – the region name
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * An illegal region name was used. * @param source the event source * @param elementName the name of the context node * @param regionName the region name * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void illegalRegionName(Object source, String elementName, String regionName, Locator loc) throws ValidationException;
A non-zero border and/or padding has been encountered on a region.
Params:
  • source – the event source
  • elementName – the name of the context node
  • regionName – the region name
  • canRecover – indicates whether FOP can recover from this problem and continue working
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * A non-zero border and/or padding has been encountered on a region. * @param source the event source * @param elementName the name of the context node * @param regionName the region name * @param canRecover indicates whether FOP can recover from this problem and continue working * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void nonZeroBorderPaddingOnRegion(Object source, String elementName, String regionName, boolean canRecover, Locator loc) throws ValidationException;
If overflow property is set to "scroll", a column-count other than "1" may not be specified.
Params:
  • source – the event source
  • elementName – the name of the context node
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * If overflow property is set to "scroll", a column-count other than "1" may not be specified. * @param source the event source * @param elementName the name of the context node * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void columnCountErrorOnRegionBodyOverflowScroll(Object source, String elementName, Locator loc) throws ValidationException;
fo:root must be root.
Params:
  • source – the event source
  • elementName – the name of the context node
  • loc – the location of the error or null
Throws:
@event.severityFATAL
/** * fo:root must be root. * @param source the event source * @param elementName the name of the context node * @param loc the location of the error or null * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void invalidFORoot(Object source, String elementName, Locator loc) throws ValidationException;
No FO document was found.
Params:
  • source – the event source
Throws:
@event.severityFATAL
/** * No FO document was found. * @param source the event source * @throws ValidationException the validation error provoked by the method call * @event.severity FATAL */
void emptyDocument(Object source) throws ValidationException;
An unknown/unsupported formatting object has been encountered.
Params:
  • source – the event source
  • elementName – the name of the context node
  • offendingNode – the offending node
  • loc – the location of the error or null
@event.severityWARN
/** * An unknown/unsupported formatting object has been encountered. * @param source the event source * @param elementName the name of the context node * @param offendingNode the offending node * @param loc the location of the error or null * @event.severity WARN */
void unknownFormattingObject(Object source, String elementName, QName offendingNode, Locator loc);
Alternate text is missing for a graphic element.
Params:
  • source – the event source
  • foElement – name of the element (external-graphic or instream-foreign-object)
  • loc – the location of the error or null
@event.severityWARN
/** * Alternate text is missing for a graphic element. * * @param source the event source * @param foElement name of the element (external-graphic or instream-foreign-object) * @param loc the location of the error or null * @event.severity WARN */
void altTextMissing(Object source, String foElement, Locator loc); }