001package org.hl7.fhir.utilities; 002 003public class ElementDecoration { 004 public enum DecorationType { TYPE, SLICE, HINT, WARNING, ERROR }; 005 006 private DecorationType type; 007 private String link; 008 private String text; 009 public ElementDecoration(DecorationType type, String link, String text) { 010 super(); 011 this.type = type; 012 this.link = link; 013 this.text = text; 014 } 015 public DecorationType getType() { 016 return type; 017 } 018 019 public boolean hasLink() { 020 return !Utilities.noString(link); 021 } 022 023 public String getLink() { 024 return link; 025 } 026 public String getText() { 027 return text; 028 } 029 public String getIcon() { 030 switch (type) { 031 case SLICE: return "icon_slice.png"; 032 case TYPE: return "icon_element.gif"; 033 case HINT: return "icon-hint.png"; 034 case ERROR: return "icon-wanning.png"; 035 case WARNING: return "icon-error.gif"; 036 default: return ""; 037 } 038 } 039 040 041}