Fixed elide spelling

This commit is contained in:
Lloyd McKenzie 2024-09-10 08:23:26 -06:00
parent fff805e5b7
commit 729c2da4c0
9 changed files with 55 additions and 55 deletions

View File

@ -162,7 +162,7 @@ public class Element extends Base implements NamedItem {
private FhirFormat format; private FhirFormat format;
private Object nativeObject; private Object nativeObject;
private List<SliceDefinition> sliceDefinitions; private List<SliceDefinition> sliceDefinitions;
private boolean ellided; private boolean elided;
public Element(String name) { public Element(String name) {
super(); super();
@ -1430,8 +1430,8 @@ public class Element extends Base implements NamedItem {
public Base copy() { public Base copy() {
Element element = new Element(this); Element element = new Element(this);
this.copyValues(element); this.copyValues(element);
if (this.isEllided()) if (this.isElided())
element.setEllided(true); element.setElided(true);
return element; return element;
} }
@ -1641,11 +1641,11 @@ public class Element extends Base implements NamedItem {
return FhirPublication.fromCode(property.getStructure().getVersion()); return FhirPublication.fromCode(property.getStructure().getVersion());
} }
public void setEllided(boolean ellided) { public void setElided(boolean elided) {
this.ellided = ellided; this.elided = elided;
} }
public boolean isEllided() { public boolean isElided() {
return this.ellided; return this.elided;
} }
} }

View File

@ -86,7 +86,7 @@ public class JsonParser extends ParserBase {
private JsonCreator json; private JsonCreator json;
private boolean allowComments; private boolean allowComments;
private boolean ellideElements; private boolean elideElements;
// private boolean suppressResourceType; // private boolean suppressResourceType;
private Element baseElement; private Element baseElement;
@ -826,8 +826,8 @@ public class JsonParser extends ParserBase {
if (wantCompose(path, child)) { if (wantCompose(path, child)) {
boolean isList = child.hasElementProperty() ? child.getElementProperty().isList() : child.getProperty().isList(); boolean isList = child.hasElementProperty() ? child.getElementProperty().isList() : child.getProperty().isList();
if (!isList) {// for specials, ignore the cardinality of the stated type if (!isList) {// for specials, ignore the cardinality of the stated type
if (child.isEllided() && isEllideElements() && json.canEllide()) if (child.isElided() && isElideElements() && json.canElide())
json.ellide(); json.elide();
else else
compose(path, child); compose(path, child);
} else if (!done.contains(child.getName())) { } else if (!done.contains(child.getName())) {
@ -887,8 +887,8 @@ public class JsonParser extends ParserBase {
if (prim) { if (prim) {
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty())); openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
for (Element item : list) { for (Element item : list) {
if (item.isEllided() && json.canEllide()) if (item.isElided() && json.canElide())
json.ellide(); json.elide();
else if (item.hasValue()) { else if (item.hasValue()) {
if (linkResolver != null && item.getProperty().isReference()) { if (linkResolver != null && item.getProperty().isReference()) {
String ref = linkResolver.resolveReference(getReferenceForElement(item)); String ref = linkResolver.resolveReference(getReferenceForElement(item));
@ -908,8 +908,8 @@ public class JsonParser extends ParserBase {
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty())); openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
int i = 0; int i = 0;
for (Element item : list) { for (Element item : list) {
if (item.isEllided() && json.canEllide()) if (item.isElided() && json.canElide())
json.ellide(); json.elide();
else if (item.hasChildren()) { else if (item.hasChildren()) {
open(null,null); open(null,null);
if (item.getProperty().isResource()) { if (item.getProperty().isResource()) {
@ -996,12 +996,12 @@ public class JsonParser extends ParserBase {
return this; return this;
} }
public boolean isEllideElements() { public boolean isElideElements() {
return ellideElements; return elideElements;
} }
public JsonParser setEllideElements(boolean ellideElements) { public JsonParser setElideElements(boolean elideElements) {
this.ellideElements = ellideElements; this.elideElements = elideElements;
return this; return this;
} }
/* /*

View File

@ -94,7 +94,7 @@ import org.xml.sax.XMLReader;
public class XmlParser extends ParserBase { public class XmlParser extends ParserBase {
private boolean allowXsiLocation; private boolean allowXsiLocation;
private String version; private String version;
private boolean ellideElements; private boolean elideElements;
public XmlParser(IWorkerContext context) { public XmlParser(IWorkerContext context) {
super(context); super(context);
@ -806,7 +806,7 @@ public class XmlParser extends ParserBase {
} }
private void composeElement(IXMLWriter xml, Element element, String elementName, boolean root) throws IOException, FHIRException { private void composeElement(IXMLWriter xml, Element element, String elementName, boolean root) throws IOException, FHIRException {
if (!(isEllideElements() && element.isEllided())) { if (!(isElideElements() && element.isElided())) {
if (showDecorations) { if (showDecorations) {
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<ElementDecoration> decorations = (List<ElementDecoration>) element.getUserData("fhir.decorations"); List<ElementDecoration> decorations = (List<ElementDecoration>) element.getUserData("fhir.decorations");
@ -819,8 +819,8 @@ public class XmlParser extends ParserBase {
} }
} }
if (isText(element.getProperty())) { if (isText(element.getProperty())) {
if (isEllideElements() && element.isEllided() && xml.canEllide()) if (isElideElements() && element.isElided() && xml.canElide())
xml.ellide(); xml.elide();
else { else {
if (linkResolver != null) if (linkResolver != null)
xml.link(linkResolver.resolveProperty(element.getProperty())); xml.link(linkResolver.resolveProperty(element.getProperty()));
@ -835,8 +835,8 @@ public class XmlParser extends ParserBase {
xml.exit(element.getProperty().getXmlNamespace(),elementName); xml.exit(element.getProperty().getXmlNamespace(),elementName);
} }
} else if (!element.hasChildren() && !element.hasValue()) { } else if (!element.hasChildren() && !element.hasValue()) {
if (isEllideElements() && element.isEllided() && xml.canEllide()) if (isElideElements() && element.isElided() && xml.canElide())
xml.ellide(); xml.elide();
else { else {
if (element.getExplicitType() != null) if (element.getExplicitType() != null)
xml.attribute("xsi:type", element.getExplicitType()); xml.attribute("xsi:type", element.getExplicitType());
@ -844,8 +844,8 @@ public class XmlParser extends ParserBase {
} }
} else if (element.isPrimitive() || (element.hasType() && isPrimitive(element.getType()))) { } else if (element.isPrimitive() || (element.hasType() && isPrimitive(element.getType()))) {
if (element.getType().equals("xhtml")) { if (element.getType().equals("xhtml")) {
if (isEllideElements() && element.isEllided() && xml.canEllide()) if (isElideElements() && element.isElided() && xml.canElide())
xml.ellide(); xml.elide();
else { else {
String rawXhtml = element.getValue(); String rawXhtml = element.getValue();
if (isCdaText(element.getProperty())) { if (isCdaText(element.getProperty())) {
@ -859,16 +859,16 @@ public class XmlParser extends ParserBase {
} }
} }
} else if (isText(element.getProperty())) { } else if (isText(element.getProperty())) {
if (isEllideElements() && element.isEllided() && xml.canEllide()) if (isElideElements() && element.isElided() && xml.canElide())
xml.ellide(); xml.elide();
else { else {
if (linkResolver != null) if (linkResolver != null)
xml.link(linkResolver.resolveProperty(element.getProperty())); xml.link(linkResolver.resolveProperty(element.getProperty()));
xml.text(element.getValue()); xml.text(element.getValue());
} }
} else { } else {
if (isEllideElements() && element.isEllided()) if (isElideElements() && element.isElided())
xml.attributeEllide(); xml.attributeElide();
else { else {
setXsiTypeIfIsTypeAttr(xml, element); setXsiTypeIfIsTypeAttr(xml, element);
if (element.hasValue()) { if (element.hasValue()) {
@ -894,22 +894,22 @@ public class XmlParser extends ParserBase {
} }
} }
} else { } else {
if (isEllideElements() && element.isEllided() && xml.canEllide()) if (isElideElements() && element.isElided() && xml.canElide())
xml.ellide(); xml.elide();
else { else {
setXsiTypeIfIsTypeAttr(xml, element); setXsiTypeIfIsTypeAttr(xml, element);
Set<String> handled = new HashSet<>(); Set<String> handled = new HashSet<>();
for (Element child : element.getChildren()) { for (Element child : element.getChildren()) {
if (!handled.contains(child.getName()) && isAttr(child.getProperty()) && wantCompose(element.getPath(), child)) { if (!handled.contains(child.getName()) && isAttr(child.getProperty()) && wantCompose(element.getPath(), child)) {
handled.add(child.getName()); handled.add(child.getName());
if (isEllideElements() && child.isEllided()) if (isElideElements() && child.isElided())
xml.attributeEllide(); xml.attributeElide();
else { else {
String av = child.getValue(); String av = child.getValue();
if (child.getProperty().isList()) { if (child.getProperty().isList()) {
for (Element c2 : element.getChildren()) { for (Element c2 : element.getChildren()) {
if (c2 != child && c2.getName().equals(child.getName())) { if (c2 != child && c2.getName().equals(child.getName())) {
if (c2.isEllided()) if (c2.isElided())
av = av + " ..."; av = av + " ...";
else else
av = av + " " + c2.getValue(); av = av + " " + c2.getValue();
@ -948,8 +948,8 @@ public class XmlParser extends ParserBase {
} }
for (Element child : element.getChildren()) { for (Element child : element.getChildren()) {
if (wantCompose(element.getPath(), child)) { if (wantCompose(element.getPath(), child)) {
if (isEllideElements() && child.isEllided() && xml.canEllide()) if (isElideElements() && child.isElided() && xml.canElide())
xml.ellide(); xml.elide();
else { else {
if (isText(child.getProperty())) { if (isText(child.getProperty())) {
if (linkResolver != null) if (linkResolver != null)
@ -1073,12 +1073,12 @@ public class XmlParser extends ParserBase {
} }
} }
public boolean isEllideElements() { public boolean isElideElements() {
return ellideElements; return elideElements;
} }
public void setEllideElements(boolean ellideElements) { public void setElideElements(boolean elideElements) {
this.ellideElements = ellideElements; this.elideElements = elideElements;
} }
} }

View File

@ -71,6 +71,6 @@ public interface JsonCreator {
void link(String href); void link(String href);
void anchor(String string); void anchor(String string);
void externalLink(String string); void externalLink(String string);
void ellide(); void elide();
boolean canEllide(); boolean canElide();
} }

View File

@ -281,10 +281,10 @@ public class JsonCreatorCanonical implements JsonCreator {
} }
@Override @Override
public boolean canEllide() { return false; } public boolean canElide() { return false; }
@Override @Override
public void ellide() { public void elide() {
// not used // not used
} }

View File

@ -245,10 +245,10 @@ public class JsonCreatorDirect implements JsonCreator {
} }
@Override @Override
public boolean canEllide() { return false; } public boolean canElide() { return false; }
@Override @Override
public void ellide() { public void elide() {
// not used // not used
} }
} }

View File

@ -128,11 +128,11 @@ public class JsonCreatorGson implements JsonCreator {
} }
@Override @Override
public void ellide() { public void elide() {
// not used // not used
} }
@Override @Override
public boolean canEllide() { return false;} public boolean canElide() { return false;}
} }

View File

@ -106,7 +106,7 @@ public interface IXMLWriter {
public abstract void externalLink(String ref) throws IOException; public abstract void externalLink(String ref) throws IOException;
// this is only implemented by an implementation that is producing an xhtml representation and handles ellipsing elements // this is only implemented by an implementation that is producing an xhtml representation and handles ellipsing elements
public abstract boolean canEllide(); public abstract boolean canElide();
public abstract void ellide() throws IOException; public abstract void elide() throws IOException;
public abstract void attributeEllide(); public abstract void attributeElide();
} }

View File

@ -913,15 +913,15 @@ public class XMLWriter extends OutputStreamWriter implements IXMLWriter {
} }
@Override @Override
public boolean canEllide() { return false; } public boolean canElide() { return false; }
@Override @Override
public void attributeEllide() { public void attributeElide() {
// ignore this // ignore this
} }
@Override @Override
public void ellide() throws IOException { public void elide() throws IOException {
// ignore this // ignore this
} }