private IBaseExtension createEmptyModifierExtension(IBaseHasModifierExtensions theBaseHasModifierExtensions, String theUrl) { return (IBaseExtension) theBaseHasModifierExtensions.addModifierExtension().setUrl(theUrl); }
extensions = ((IBaseHasModifierExtensions) theCurrentObj).getModifierExtension() .stream() .filter(t -> t.getUrl().equals(extensionUrlForLambda))
static boolean hasExtensions(IBase theElement) { if (theElement instanceof ISupportsUndeclaredExtensions) { ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; if (res.getUndeclaredExtensions().size() > 0 || res.getUndeclaredModifierExtensions().size() > 0) { return true; } } if (theElement instanceof IBaseHasExtensions) { IBaseHasExtensions res = (IBaseHasExtensions) theElement; if (res.hasExtension()) { return true; } } if (theElement instanceof IBaseHasModifierExtensions) { IBaseHasModifierExtensions res = (IBaseHasModifierExtensions) theElement; return res.hasModifierExtension(); } return false; }
List<? extends IBaseExtension<?, ?>> ext = element.getModifierExtension(); for (IBaseExtension<?, ?> next : ext) { if (next == null || next.isEmpty()) {
private IBaseExtension createEmptyModifierExtension(IBaseHasModifierExtensions theBaseHasModifierExtensions, String theUrl) { return (IBaseExtension) theBaseHasModifierExtensions.addModifierExtension().setUrl(theUrl); }
static boolean hasNoExtensions(IBase theElement) { if (theElement instanceof ISupportsUndeclaredExtensions) { ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; if (res.getUndeclaredExtensions().size() > 0 || res.getUndeclaredModifierExtensions().size() > 0) { return false; } } if (theElement instanceof IBaseHasExtensions) { IBaseHasExtensions res = (IBaseHasExtensions) theElement; if (res.hasExtension()) { return false; } } if (theElement instanceof IBaseHasModifierExtensions) { IBaseHasModifierExtensions res = (IBaseHasModifierExtensions) theElement; return !res.hasModifierExtension(); } return true; }
private void encodeExtensionsIfPresent(IBaseResource theResource, XMLStreamWriter theWriter, IBase theElement, boolean theIncludedResource, boolean theSubResource) throws XMLStreamException, DataFormatException { if (theElement instanceof ISupportsUndeclaredExtensions) { ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; encodeUndeclaredExtensions(theResource, theWriter, toBaseExtensionList(res.getUndeclaredExtensions()), "extension", theIncludedResource, theSubResource); encodeUndeclaredExtensions(theResource, theWriter, toBaseExtensionList(res.getUndeclaredModifierExtensions()), "modifierExtension", theIncludedResource,theSubResource); } if (theElement instanceof IBaseHasExtensions) { IBaseHasExtensions res = (IBaseHasExtensions) theElement; encodeUndeclaredExtensions(theResource, theWriter, res.getExtension(), "extension", theIncludedResource,theSubResource); } if (theElement instanceof IBaseHasModifierExtensions) { IBaseHasModifierExtensions res = (IBaseHasModifierExtensions) theElement; encodeUndeclaredExtensions(theResource, theWriter, res.getModifierExtension(), "modifierExtension", theIncludedResource,theSubResource); } }
private void addExtension(BaseRuntimeElementCompositeDefinition<?> theSourceDef, IBase theSource, IBase theTarget, RuntimeChildDeclaredExtensionDefinition nextExt, String url) { RuntimeChildDeclaredExtensionDefinition sourceDeclaredExt = theSourceDef.getDeclaredExtension(url, ""); if (sourceDeclaredExt == null) { if (theSource instanceof IBaseHasExtensions) { for (IBaseExtension<?, ?> next : ((IBaseHasExtensions) theSource).getExtension()) { if (next.getUrl().equals(url)) { nextExt.getMutator().addValue(theTarget, next.getValue()); } } } if (theSource instanceof IBaseHasModifierExtensions) { for (IBaseExtension<?, ?> next : ((IBaseHasModifierExtensions) theSource).getModifierExtension()) { if (next.getUrl().equals(url)) { nextExt.getMutator().addValue(theTarget, next.getValue()); } } } } else { List<? extends IBase> values = sourceDeclaredExt.getAccessor().getValues(theSource); for (IBase nextElement : values) { nextExt.getMutator().addValue(theTarget, nextElement); } } } }
List<? extends IBaseExtension<?, ?>> ext = element.getModifierExtension(); force |= addToHeldExtensions(valueIdx, ext, extensions, true, nextChildElem, theParent);
extensions = ((IBaseHasModifierExtensions) theCurrentObj).getModifierExtension() .stream() .filter(t -> t.getUrl().equals(extensionUrlForLambda))
List<? extends IBaseExtension<?, ?>> ext = element.getModifierExtension(); for (IBaseExtension<?, ?> next : ext) { if (next == null || next.isEmpty()) {
private void encodeExtensionsIfPresent(IBaseResource theResource, XMLStreamWriter theWriter, IBase theElement, boolean theIncludedResource, EncodeContext theEncodeContext) throws XMLStreamException, DataFormatException { if (theElement instanceof ISupportsUndeclaredExtensions) { ISupportsUndeclaredExtensions res = (ISupportsUndeclaredExtensions) theElement; encodeUndeclaredExtensions(theResource, theWriter, toBaseExtensionList(res.getUndeclaredExtensions()), "extension", theIncludedResource, theEncodeContext); encodeUndeclaredExtensions(theResource, theWriter, toBaseExtensionList(res.getUndeclaredModifierExtensions()), "modifierExtension", theIncludedResource, theEncodeContext); } if (theElement instanceof IBaseHasExtensions) { IBaseHasExtensions res = (IBaseHasExtensions) theElement; encodeUndeclaredExtensions(theResource, theWriter, res.getExtension(), "extension", theIncludedResource, theEncodeContext); } if (theElement instanceof IBaseHasModifierExtensions) { IBaseHasModifierExtensions res = (IBaseHasModifierExtensions) theElement; encodeUndeclaredExtensions(theResource, theWriter, res.getModifierExtension(), "modifierExtension", theIncludedResource, theEncodeContext); } }
private void addExtension(BaseRuntimeElementCompositeDefinition<?> theSourceDef, IBase theSource, IBase theTarget, RuntimeChildDeclaredExtensionDefinition nextExt, String url) { RuntimeChildDeclaredExtensionDefinition sourceDeclaredExt = theSourceDef.getDeclaredExtension(url, ""); if (sourceDeclaredExt == null) { if (theSource instanceof IBaseHasExtensions) { for (IBaseExtension<?, ?> next : ((IBaseHasExtensions) theSource).getExtension()) { if (next.getUrl().equals(url)) { nextExt.getMutator().addValue(theTarget, next.getValue()); } } } if (theSource instanceof IBaseHasModifierExtensions) { for (IBaseExtension<?, ?> next : ((IBaseHasModifierExtensions) theSource).getModifierExtension()) { if (next.getUrl().equals(url)) { nextExt.getMutator().addValue(theTarget, next.getValue()); } } } } else { List<? extends IBase> values = sourceDeclaredExt.getAccessor().getValues(theSource); for (IBase nextElement : values) { nextExt.getMutator().addValue(theTarget, nextElement); } } } }
List<? extends IBaseExtension<?, ?>> ext = element.getModifierExtension(); force |= addToHeldExtensions(valueIdx, ext, extensions, true, nextChildElem, theParent);