public boolean hasValidation() { return isRequired() || getAttributeValue(SPackageBasic.ATR_REQUIRED_FUNCTION) != null || hasValidationInternal(); }
public boolean hasValidation() { return isRequired() || getAttributeValue(SPackageBasic.ATR_REQUIRED_FUNCTION) != null || hasValidationInternal(); }
private SView decideView(SInstance instance, SInstance simple, Provider provider) { int size = provider.load(ProviderContext.of(instance)).size(); /* * Tamanho zero indica uma possivel carga condicional e/ou dinamica. * Nesse caso é mais produtente escolher combo: MSelecaoPorSelectView */ if (size <= 3 && size != 0 && simple.getType().isRequired()) { return newInstance(SViewSelectionByRadio.class); } return newInstance(SViewSelectionBySelect.class); }
private SView decideView(SInstance instance, SInstance simple, Provider provider) { int size = provider.load(ProviderContext.of(instance)).size(); /* * Tamanho zero indica uma possivel carga condicional e/ou dinamica. * Nesse caso é mais produtente escolher combo: MSelecaoPorSelectView */ if (size <= 3 && size != 0 && simple.getType().isRequired()) { return newInstance(SViewSelectionByRadio.class); } return newInstance(SViewSelectionBySelect.class); }
/** * Inserts the tag element on the XSD * @param sType The SType that will be represented by the tag element * @param parent The parent tag of the element * @return The tag element that was included on the XSD */ private static MElement addXsdElement(SType<?> sType, MElement parent) { MElement element = parent.addElementNS(XSD_NAMESPACE_URI, XSD_ELEMENT); if (sType.isList()) { return setXsdListElementDefinition(element, sType); } else { String typeName = getTypeName(sType); element.setAttribute("name", sType.getNameSimple()); if (Collections.frequency(mapOfComposite.values(), typeName) > 1 || sType instanceof STypeSimple<?, ?>) { element.setAttribute("type", typeName); } if (sType instanceof STypeSimple<?, ?> && (!sType.isRequired() && !XSD_SCHEMA.equals(parent.getNodeName()))) { element.setAttribute("minOccurs", "0"); } } return element; }