public String getUrlApp() { if (urlApp_ == null) { //TODO Resolver como o singular terá acesso a sua URL de aplicação. Fazer um SPI throw new SingularException("Implementar esse código"); //urlApp_ = PropriedadesSistema.getUrlAplicacao(); //if (!urlApp_.endsWith("/")) { // urlApp_ += "/"; //} } return urlApp_; }
public String getUrl() { if (urlAppMissing) { throw new SingularException("UrlApp não definida para '" + url_ + "'"); } return url_; } }
public static SingularException rethrow(String message, Throwable e) { if (e instanceof SingularException) { return (SingularException) e; } else { return new SingularException(message, e); } }
public InfoCell setLink(Lnk link) { throw new SingularException("Implementar"); //setLink(link != null ? WebActionRefImpl.of("", link) : null); //return this; }
@Override public LineInfo retrieveValues(LineReadContext ctx, LineData lineData) { throw new SingularException("Nunca deveria ter chamado essa linha. Pois tudo est em memoria"); }
@Override public void addImage(String name, byte[] content) throws IOException { throw new SingularException("Implementar"); } }
@Nonnull public ColumnTypeProcessor getProcessor() { if (processor == null) { throw new SingularException("Processador da coluna está null"); } return processor; }
@Override public void generate(@Nonnull TableTool tableTool, @Nonnull ViewOutputHtml viewOutputHtml) { throw new SingularException("Unssuported"); } }
@Override public void generatePrintValue(@Nonnull PrintResult result, @Nonnull Column column, Object value) { throw new SingularException("This method shouldn't be called"); }
private <T extends SingularExtension> void checkIfValidExtensionClass(@Nonnull Class<T> extensionClass) { if (!extensionClass.getName().endsWith("Extension")) { throw new SingularException("The name of the class " + extensionClass.getName() + " is no valid for a extension point. It must ends with the sufix 'Extension'"); } }
@Override public int compare(@Nonnull Object v1, @Nonnull Object v2) { if (v1 instanceof Integer && v2 instanceof Integer) { return Integer.compare((Integer) v1, (Integer) v2); } else if (v1 instanceof Number && v2 instanceof Number) { return Double.compare(((Number) v1).doubleValue(), ((Number) v2).doubleValue()); } throw new SingularException( "It's not possible to compare the object of the class " + v1.getClass().getName() + " and " + v2.getClass().getName()); } }
private void printNode(PrintWriter out, Node node) { switch (node.getNodeType()) { case Node.ELEMENT_NODE: printElement(out, (Element) node); break; case Node.TEXT_NODE: out.print(node.getNodeValue()); break; default: throw new SingularException( "Tipo de nó '" + node.getNodeName() + "' desconhecido: " + node.getNodeType()); } }
public int compare(@Nonnull Object v1, @Nonnull Object v2) { if (v1 instanceof Boolean && v2 instanceof Boolean) { return Boolean.compare((Boolean) v1, (Boolean) v2); } throw new SingularException( "It's not possible to compare the object of the class " + v1.getClass().getName() + " and " + v2.getClass().getName()); } }
private void next() { if (original == null) { throw new SingularException("No existe nada para ler"); } while (original.hasNext()) { Object v = original.next(); if (v != null) { current = new LineData(this, v); return; } } current = null; original = null; }
/** Verificar se o nome do bean foi configurado. Ou seja, se o bean foi carregado via Spring. */ @Nonnull public static String checkBeanName(@Nonnull NamedBean bean) { if (StringUtils.isBlank(bean.getBeanName())) { throw new SingularException( "O nome do bean no spring não foi configurado para a classe " + bean.getClass().getName() + ". Verifique se o bean foi corretamente registrado no Spring antes de ser utilizado."); } return bean.getBeanName(); }
public static MDocument toMDocument(Node no) { if (no == null) { return null; } else if (no instanceof MDocument) { return (MDocument) no; } else if (no.getNodeType() != Node.DOCUMENT_NODE) { throw new SingularException("no " + XPathToolkit.getFullPath(no) + " não é Document"); } return new MDocumentWrapper((Document) no); }
public static SingularDataBaseSuport getForDialect(Class<? extends Dialect> hibernateDialect) { for (SingularDataBaseEnum singularDataBaseEnum : SingularDataBaseEnum.values()) { if (singularDataBaseEnum.isDialectSupported(hibernateDialect)) { return singularDataBaseEnum; } } throw new SingularException(String.format("Database dialect %s not supported.", hibernateDialect)); } }
public ViewOutputHtmlToWicket(RequestCycle cycle) { Response response = cycle.getResponse(); if (response instanceof WebResponse) { out = new WebResponseWriterAdapter((WebResponse) response); } else { throw new SingularException("O RequestCycle atual não é uma WebResponse"); } }
@Nonnull public <T extends Serializable> T get(MetaDataKey<T> key) { if (key.getDefaultValue() == null) { throw new SingularException(MetaDataKey.class.getSimpleName() + " '" + key.getName() + "' don't have a default value configured. Use method getOpt() or configure a default value for " + "the key"); } T value = getInternal(key); return value != null ? value : key.getDefaultValue(); }
private LineData fillValues(Collection<LineData> aggregatedInfo) { LineData newLineData = new LineData(getTable().newBlankLine()); LineData reference = aggregatedInfo.stream().findFirst().orElseThrow(() -> new SingularException("Não foi possivel encontrar a referencia.")); groupingColumns.forEach(column -> copyCellValues(newLineData.getInfoCell(column), reference.getInfoCell(column))); doAggregation(aggregatedInfo, newLineData); return newLineData; }