Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ome-xml: java: Don't report unhandled links prematurely #128

Merged
merged 1 commit into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,19 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* @author callan
*
*/
public abstract class AbstractOMEModelObject implements OMEModelObject {

/** Logger for this class. */
protected static final Logger LOGGER =
LoggerFactory.getLogger(AbstractOMEModelObject.class);

/* (non-Javadoc)
* @see ome.xml.r201004.OMEModelObject#update(org.w3c.dom.Element, ome.xml.r201004.OMEModel)
*/
Expand Down Expand Up @@ -82,6 +89,8 @@ protected Element asXMLElement(Document document, Element element) {
*/
@Override
public boolean link(Reference reference, OMEModelObject o) {
LOGGER.debug("{} unable to handle reference of type {} for {}",
getClass(), reference.getClass(), o.getClass());
return false;
}

Expand Down
8 changes: 1 addition & 7 deletions xsd-fu/templates/java/OMEXMLModelObject.template
Original file line number Diff line number Diff line change
Expand Up @@ -465,11 +465,6 @@ ${customUpdatePropertyContent[prop.name]}

public boolean link(Reference reference, OMEModelObject o)
{
boolean wasHandledBySuperClass = super.link(reference, o);
if (wasHandledBySuperClass)
{
return true;
}
{% for prop in klass.properties.values() %}\
{% if prop.isReference %}\
if (reference instanceof ${prop.name})
Expand All @@ -493,8 +488,7 @@ ${customUpdatePropertyContent[prop.name]}
}
{% end %}\
{% end %}\
LOGGER.debug("Unable to handle reference of type: {}", reference.getClass());
return false;
return super.link(reference, o);
}
{% if klass.langBaseType != 'Object' %}\
// Element's text data getter
Expand Down