public static boolean isEmpty(IBase... theElements) { if (theElements == null) { return true; } for (int i = 0; i < theElements.length; i++) { IBase next = theElements[i]; if (next != null && !next.isEmpty()) { return false; } } return true; }
private void writeCommentsPreAndPost(IBase theNextValue, JsonLikeWriter theEventWriter) throws IOException { if (theNextValue.hasFormatComment()) { beginArray(theEventWriter, "fhir_comments"); List<String> pre = theNextValue.getFormatCommentsPre(); if (pre.isEmpty() == false) { for (String next : pre) { theEventWriter.write(next); } } List<String> post = theNextValue.getFormatCommentsPost(); if (post.isEmpty() == false) { for (String next : post) { theEventWriter.write(next); } } theEventWriter.endArray(); } }
private void writeCommentsPost(XMLStreamWriter theEventWriter, IBase theElement) throws XMLStreamException { if (theElement != null && theElement.hasFormatComment()) { for (String next : theElement.getFormatCommentsPost()) { if (isNotBlank(next)) { theEventWriter.writeComment(next); } } } }
private void writeCommentsPre(XMLStreamWriter theEventWriter, IBase theElement) throws XMLStreamException { if (theElement != null && theElement.hasFormatComment()) { for (String next : theElement.getFormatCommentsPre()) { if (isNotBlank(next)) { theEventWriter.writeComment(next); } } } }
for (IBase nextValue : values) { if (nextValue == null || nextValue.isEmpty()) { if (nextValue instanceof BaseContainedDt) { if (theContainedResource || getContainedResources().isEmpty()) { if (nextValue.hasFormatComment()) { force |= addToHeldComments(valueIdx, nextValue.getFormatCommentsPre(), comments); force |= addToHeldComments(valueIdx, nextValue.getFormatCommentsPost(), comments);
public void commentPre(String theCommentText) { if (myState.getCurrentElement() != null) { IBase element = myState.getCurrentElement(); element.getFormatCommentsPre().add(theCommentText); } }
public void commentPost(String theCommentText) { if (myPreviousElement != null) { myPreviousElement.getFormatCommentsPost().add(theCommentText); } }
for (IBase nextValue : values) { if (nextValue == null || nextValue.isEmpty()) { if (nextValue instanceof BaseContainedDt) { if (theContainedResource || getContainedResources().isEmpty()) { if (nextValue.hasFormatComment()) { force |= addToHeldComments(valueIdx, nextValue.getFormatCommentsPre(), comments); force |= addToHeldComments(valueIdx, nextValue.getFormatCommentsPost(), comments);
private void writeCommentsPost(XMLStreamWriter theEventWriter, IBase theElement) throws XMLStreamException { if (theElement != null && theElement.hasFormatComment()) { for (String next : theElement.getFormatCommentsPost()) { if (isNotBlank(next)) { theEventWriter.writeComment(next); } } } }
private void writeCommentsPre(XMLStreamWriter theEventWriter, IBase theElement) throws XMLStreamException { if (theElement != null && theElement.hasFormatComment()) { for (String next : theElement.getFormatCommentsPre()) { if (isNotBlank(next)) { theEventWriter.writeComment(next); } } } }
private void push(BaseState theState) { theState.setStack(myState); myState = theState; if (myComments.isEmpty() == false) { if (myState.getCurrentElement() != null) { myState.getCurrentElement().getFormatCommentsPre().addAll(myComments); myComments.clear(); } } }
public void commentPost(String theCommentText) { if (myPreviousElement != null) { myPreviousElement.getFormatCommentsPost().add(theCommentText); } }
public static boolean isEmpty(IElement... theElements) { if (theElements == null) { return true; } for (int i = 0; i < theElements.length; i++) { IBase next = theElements[i]; if (next != null && !next.isEmpty()) { return false; } } return true; }
private void writeCommentsPreAndPost(IBase theNextValue, JsonLikeWriter theEventWriter) throws IOException { if (theNextValue.hasFormatComment()) { beginArray(theEventWriter, "fhir_comments"); List<String> pre = theNextValue.getFormatCommentsPre(); if (pre.isEmpty() == false) { for (String next : pre) { theEventWriter.write(next); } } List<String> post = theNextValue.getFormatCommentsPost(); if (post.isEmpty() == false) { for (String next : post) { theEventWriter.write(next); } } theEventWriter.endArray(); } }
public void commentPre(String theCommentText) { if (myState.getCurrentElement() != null) { IBase element = myState.getCurrentElement(); element.getFormatCommentsPre().add(theCommentText); } }
@SuppressWarnings("unchecked") @Override public void acceptElement(IBaseResource theOuterResource, IBase theElement, List<String> thePathToElement, BaseRuntimeChildDefinition theChildDefinition, BaseRuntimeElementDefinition<?> theDefinition) { if (theElement == null || theElement.isEmpty()) { return; } if (theType.isAssignableFrom(theElement.getClass())) { retVal.add((T) theElement); } } });
private void push(BaseState theState) { theState.setStack(myState); myState = theState; if (myComments.isEmpty() == false) { if (myState.getCurrentElement() != null) { myState.getCurrentElement().getFormatCommentsPre().addAll(myComments); myComments.clear(); } } }
@Override public void acceptElement(IBaseResource theOuterResource, IBase theElement, List<String> thePathToElement, BaseRuntimeChildDefinition theChildDefinition, BaseRuntimeElementDefinition<?> theDefinition) { if (theElement == null || theElement.isEmpty()) { return; } if (IBaseReference.class.isAssignableFrom(theElement.getClass())) { retVal.add(new ResourceReferenceInfo(myContext, theOuterResource, thePathToElement, (IBaseReference) theElement)); } } });
public static boolean isEmpty(List<? extends IBase> theElements) { if (theElements == null) { return true; } for (int i = 0; i < theElements.size(); i++) { IBase next; try { next = theElements.get(i); } catch (ClassCastException e) { List<?> elements = theElements; String s = "Found instance of " + elements.get(i).getClass() + " - Did you set a field value to the incorrect type? Expected " + IBase.class.getName(); throw new ClassCastException(s); } if (next != null && !next.isEmpty()) { return false; } } return true; }
@SuppressWarnings("unchecked") public static boolean isEmpty(Object... theElements) { if (theElements == null) { return true; } for (int i = 0; i < theElements.length; i++) { Object next = theElements[i]; if (next instanceof List) { if (!isEmpty((List<? extends IBase>) next)) { return false; } } else if (next instanceof String && (!((String)next).isEmpty())) { return false; } else if (next != null && !((IBase) next).isEmpty()) { return false; } } return true; }