io.imunity.vaadin.endpoint.common.forms.FormParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Show all versions of unity-server-vaadin-endpoint-common Show documentation
Common Vaadin endpoint components
The newest version!
/*
* Copyright (c) 2021 Bixbit - Krzysztof Benedyczak. All rights reserved.
* See LICENCE.txt file for licensing information.
*/
package io.imunity.vaadin.endpoint.common.forms;
import java.util.List;
import pl.edu.icm.unity.base.registration.AttributeRegistrationParam;
import pl.edu.icm.unity.base.registration.BaseForm;
import pl.edu.icm.unity.base.registration.GroupRegistrationParam;
/**
* Utilities related to parsing a form
*
* @author K. Benedyczak
*/
public class FormParser
{
static boolean isGroupParamUsedAsMandatoryAttributeGroup(BaseForm form, GroupRegistrationParam groupParam)
{
return isGroupParamUsedAsMandatoryAttributeGroup(form.getAttributeParams(), groupParam);
}
static boolean isGroupParamUsedAsMandatoryAttributeGroup(List attributeParams,
GroupRegistrationParam groupParam)
{
for (AttributeRegistrationParam attr: attributeParams)
{
if (attr.isUsingDynamicGroup()
&& attr.getDynamicGroup().equals(groupParam.getGroupPath())
&& !attr.isOptional())
return true;
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy