Fixed elide spelling
This commit is contained in:
parent
fff805e5b7
commit
729c2da4c0
|
@ -162,7 +162,7 @@ public class Element extends Base implements NamedItem {
|
|||
private FhirFormat format;
|
||||
private Object nativeObject;
|
||||
private List<SliceDefinition> sliceDefinitions;
|
||||
private boolean ellided;
|
||||
private boolean elided;
|
||||
|
||||
public Element(String name) {
|
||||
super();
|
||||
|
@ -1430,8 +1430,8 @@ public class Element extends Base implements NamedItem {
|
|||
public Base copy() {
|
||||
Element element = new Element(this);
|
||||
this.copyValues(element);
|
||||
if (this.isEllided())
|
||||
element.setEllided(true);
|
||||
if (this.isElided())
|
||||
element.setElided(true);
|
||||
return element;
|
||||
}
|
||||
|
||||
|
@ -1641,11 +1641,11 @@ public class Element extends Base implements NamedItem {
|
|||
return FhirPublication.fromCode(property.getStructure().getVersion());
|
||||
}
|
||||
|
||||
public void setEllided(boolean ellided) {
|
||||
this.ellided = ellided;
|
||||
public void setElided(boolean elided) {
|
||||
this.elided = elided;
|
||||
}
|
||||
|
||||
public boolean isEllided() {
|
||||
return this.ellided;
|
||||
public boolean isElided() {
|
||||
return this.elided;
|
||||
}
|
||||
}
|
|
@ -86,7 +86,7 @@ public class JsonParser extends ParserBase {
|
|||
|
||||
private JsonCreator json;
|
||||
private boolean allowComments;
|
||||
private boolean ellideElements;
|
||||
private boolean elideElements;
|
||||
// private boolean suppressResourceType;
|
||||
|
||||
private Element baseElement;
|
||||
|
@ -826,8 +826,8 @@ public class JsonParser extends ParserBase {
|
|||
if (wantCompose(path, child)) {
|
||||
boolean isList = child.hasElementProperty() ? child.getElementProperty().isList() : child.getProperty().isList();
|
||||
if (!isList) {// for specials, ignore the cardinality of the stated type
|
||||
if (child.isEllided() && isEllideElements() && json.canEllide())
|
||||
json.ellide();
|
||||
if (child.isElided() && isElideElements() && json.canElide())
|
||||
json.elide();
|
||||
else
|
||||
compose(path, child);
|
||||
} else if (!done.contains(child.getName())) {
|
||||
|
@ -887,8 +887,8 @@ public class JsonParser extends ParserBase {
|
|||
if (prim) {
|
||||
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
|
||||
for (Element item : list) {
|
||||
if (item.isEllided() && json.canEllide())
|
||||
json.ellide();
|
||||
if (item.isElided() && json.canElide())
|
||||
json.elide();
|
||||
else if (item.hasValue()) {
|
||||
if (linkResolver != null && item.getProperty().isReference()) {
|
||||
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()));
|
||||
int i = 0;
|
||||
for (Element item : list) {
|
||||
if (item.isEllided() && json.canEllide())
|
||||
json.ellide();
|
||||
if (item.isElided() && json.canElide())
|
||||
json.elide();
|
||||
else if (item.hasChildren()) {
|
||||
open(null,null);
|
||||
if (item.getProperty().isResource()) {
|
||||
|
@ -996,12 +996,12 @@ public class JsonParser extends ParserBase {
|
|||
return this;
|
||||
}
|
||||
|
||||
public boolean isEllideElements() {
|
||||
return ellideElements;
|
||||
public boolean isElideElements() {
|
||||
return elideElements;
|
||||
}
|
||||
|
||||
public JsonParser setEllideElements(boolean ellideElements) {
|
||||
this.ellideElements = ellideElements;
|
||||
public JsonParser setElideElements(boolean elideElements) {
|
||||
this.elideElements = elideElements;
|
||||
return this;
|
||||
}
|
||||
/*
|
||||
|
|
|
@ -94,7 +94,7 @@ import org.xml.sax.XMLReader;
|
|||
public class XmlParser extends ParserBase {
|
||||
private boolean allowXsiLocation;
|
||||
private String version;
|
||||
private boolean ellideElements;
|
||||
private boolean elideElements;
|
||||
|
||||
public XmlParser(IWorkerContext 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 {
|
||||
if (!(isEllideElements() && element.isEllided())) {
|
||||
if (!(isElideElements() && element.isElided())) {
|
||||
if (showDecorations) {
|
||||
@SuppressWarnings("unchecked")
|
||||
List<ElementDecoration> decorations = (List<ElementDecoration>) element.getUserData("fhir.decorations");
|
||||
|
@ -819,8 +819,8 @@ public class XmlParser extends ParserBase {
|
|||
}
|
||||
}
|
||||
if (isText(element.getProperty())) {
|
||||
if (isEllideElements() && element.isEllided() && xml.canEllide())
|
||||
xml.ellide();
|
||||
if (isElideElements() && element.isElided() && xml.canElide())
|
||||
xml.elide();
|
||||
else {
|
||||
if (linkResolver != null)
|
||||
xml.link(linkResolver.resolveProperty(element.getProperty()));
|
||||
|
@ -835,8 +835,8 @@ public class XmlParser extends ParserBase {
|
|||
xml.exit(element.getProperty().getXmlNamespace(),elementName);
|
||||
}
|
||||
} else if (!element.hasChildren() && !element.hasValue()) {
|
||||
if (isEllideElements() && element.isEllided() && xml.canEllide())
|
||||
xml.ellide();
|
||||
if (isElideElements() && element.isElided() && xml.canElide())
|
||||
xml.elide();
|
||||
else {
|
||||
if (element.getExplicitType() != null)
|
||||
xml.attribute("xsi:type", element.getExplicitType());
|
||||
|
@ -844,8 +844,8 @@ public class XmlParser extends ParserBase {
|
|||
}
|
||||
} else if (element.isPrimitive() || (element.hasType() && isPrimitive(element.getType()))) {
|
||||
if (element.getType().equals("xhtml")) {
|
||||
if (isEllideElements() && element.isEllided() && xml.canEllide())
|
||||
xml.ellide();
|
||||
if (isElideElements() && element.isElided() && xml.canElide())
|
||||
xml.elide();
|
||||
else {
|
||||
String rawXhtml = element.getValue();
|
||||
if (isCdaText(element.getProperty())) {
|
||||
|
@ -859,16 +859,16 @@ public class XmlParser extends ParserBase {
|
|||
}
|
||||
}
|
||||
} else if (isText(element.getProperty())) {
|
||||
if (isEllideElements() && element.isEllided() && xml.canEllide())
|
||||
xml.ellide();
|
||||
if (isElideElements() && element.isElided() && xml.canElide())
|
||||
xml.elide();
|
||||
else {
|
||||
if (linkResolver != null)
|
||||
xml.link(linkResolver.resolveProperty(element.getProperty()));
|
||||
xml.text(element.getValue());
|
||||
}
|
||||
} else {
|
||||
if (isEllideElements() && element.isEllided())
|
||||
xml.attributeEllide();
|
||||
if (isElideElements() && element.isElided())
|
||||
xml.attributeElide();
|
||||
else {
|
||||
setXsiTypeIfIsTypeAttr(xml, element);
|
||||
if (element.hasValue()) {
|
||||
|
@ -894,22 +894,22 @@ public class XmlParser extends ParserBase {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (isEllideElements() && element.isEllided() && xml.canEllide())
|
||||
xml.ellide();
|
||||
if (isElideElements() && element.isElided() && xml.canElide())
|
||||
xml.elide();
|
||||
else {
|
||||
setXsiTypeIfIsTypeAttr(xml, element);
|
||||
Set<String> handled = new HashSet<>();
|
||||
for (Element child : element.getChildren()) {
|
||||
if (!handled.contains(child.getName()) && isAttr(child.getProperty()) && wantCompose(element.getPath(), child)) {
|
||||
handled.add(child.getName());
|
||||
if (isEllideElements() && child.isEllided())
|
||||
xml.attributeEllide();
|
||||
if (isElideElements() && child.isElided())
|
||||
xml.attributeElide();
|
||||
else {
|
||||
String av = child.getValue();
|
||||
if (child.getProperty().isList()) {
|
||||
for (Element c2 : element.getChildren()) {
|
||||
if (c2 != child && c2.getName().equals(child.getName())) {
|
||||
if (c2.isEllided())
|
||||
if (c2.isElided())
|
||||
av = av + " ...";
|
||||
else
|
||||
av = av + " " + c2.getValue();
|
||||
|
@ -948,8 +948,8 @@ public class XmlParser extends ParserBase {
|
|||
}
|
||||
for (Element child : element.getChildren()) {
|
||||
if (wantCompose(element.getPath(), child)) {
|
||||
if (isEllideElements() && child.isEllided() && xml.canEllide())
|
||||
xml.ellide();
|
||||
if (isElideElements() && child.isElided() && xml.canElide())
|
||||
xml.elide();
|
||||
else {
|
||||
if (isText(child.getProperty())) {
|
||||
if (linkResolver != null)
|
||||
|
@ -1073,12 +1073,12 @@ public class XmlParser extends ParserBase {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean isEllideElements() {
|
||||
return ellideElements;
|
||||
public boolean isElideElements() {
|
||||
return elideElements;
|
||||
}
|
||||
|
||||
public void setEllideElements(boolean ellideElements) {
|
||||
this.ellideElements = ellideElements;
|
||||
public void setElideElements(boolean elideElements) {
|
||||
this.elideElements = elideElements;
|
||||
}
|
||||
|
||||
}
|
|
@ -71,6 +71,6 @@ public interface JsonCreator {
|
|||
void link(String href);
|
||||
void anchor(String string);
|
||||
void externalLink(String string);
|
||||
void ellide();
|
||||
boolean canEllide();
|
||||
void elide();
|
||||
boolean canElide();
|
||||
}
|
|
@ -281,10 +281,10 @@ public class JsonCreatorCanonical implements JsonCreator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canEllide() { return false; }
|
||||
public boolean canElide() { return false; }
|
||||
|
||||
@Override
|
||||
public void ellide() {
|
||||
public void elide() {
|
||||
// not used
|
||||
}
|
||||
|
||||
|
|
|
@ -245,10 +245,10 @@ public class JsonCreatorDirect implements JsonCreator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canEllide() { return false; }
|
||||
public boolean canElide() { return false; }
|
||||
|
||||
@Override
|
||||
public void ellide() {
|
||||
public void elide() {
|
||||
// not used
|
||||
}
|
||||
}
|
|
@ -128,11 +128,11 @@ public class JsonCreatorGson implements JsonCreator {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void ellide() {
|
||||
public void elide() {
|
||||
// not used
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEllide() { return false;}
|
||||
public boolean canElide() { return false;}
|
||||
|
||||
}
|
|
@ -106,7 +106,7 @@ public interface IXMLWriter {
|
|||
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
|
||||
public abstract boolean canEllide();
|
||||
public abstract void ellide() throws IOException;
|
||||
public abstract void attributeEllide();
|
||||
public abstract boolean canElide();
|
||||
public abstract void elide() throws IOException;
|
||||
public abstract void attributeElide();
|
||||
}
|
|
@ -913,15 +913,15 @@ public class XMLWriter extends OutputStreamWriter implements IXMLWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canEllide() { return false; }
|
||||
public boolean canElide() { return false; }
|
||||
|
||||
@Override
|
||||
public void attributeEllide() {
|
||||
public void attributeElide() {
|
||||
// ignore this
|
||||
}
|
||||
|
||||
@Override
|
||||
public void ellide() throws IOException {
|
||||
public void elide() throws IOException {
|
||||
// ignore this
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue