Search in sources :

Example 1 with DslEntityField

use of io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField in project vertigo by KleeGroup.

the class DslDefinition method getDefinitionLinkNames.

/**
 * Permet de récupérer la liste des définitions d'un champ.
 *
 * @param fieldName Nom du champ.
 * @return List
 */
public List<String> getDefinitionLinkNames(final String fieldName) {
    final DslEntityField dslEntityField = entity.getField(fieldName);
    Assertion.checkState(dslEntityField.getType().isEntityLink(), "expected a link on {0}", fieldName);
    // ---
    return definitionLinkNamesByFieldName.get(dslEntityField);
}
Also used : DslEntityField(io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField)

Example 2 with DslEntityField

use of io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField in project vertigo by KleeGroup.

the class DslDefinition method getPropertyValue.

/**
 * Retourne la valeur d'une (méta) propriété liée au domaine, champ, dtDéfinition...
 * null si cette propriété n'existe pas
 * @param fieldName Name of the field
 * @return valeur de la propriété
 */
public Object getPropertyValue(final String fieldName) {
    final DslEntityField dslEntityField = entity.getField(fieldName);
    Assertion.checkState(dslEntityField.getType().isProperty(), "expected a property on {0}", fieldName);
    // Conformémément au contrat, on retourne null si pas de propriété trouvée
    return propertyValueByFieldName.get(dslEntityField);
}
Also used : DslEntityField(io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField)

Example 3 with DslEntityField

use of io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField in project vertigo by KleeGroup.

the class DslDefinition method getChildDefinitions.

/**
 * Récupération de la liste des definitions dont est composée la définition principale.
 * @param fieldName String
 * @return List
 */
public List<DslDefinition> getChildDefinitions(final String fieldName) {
    final DslEntityField dslEntityField = entity.getField(fieldName);
    Assertion.checkState(dslEntityField.getType().isEntity(), "expected an entity on {0}", fieldName);
    // ---
    return childDefinitionsByFieldName.get(dslEntityField);
}
Also used : DslEntityField(io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField)

Example 4 with DslEntityField

use of io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField in project vertigo by KleeGroup.

the class DslDefinitionBuilder method addAllDefinitionLinks.

/**
 * Ajoute une liste de définitions au champ défini par fieldName.
 * La définition n'est connue que par sa référence, son nom.
 * @param fieldName Name of the field
 * @param definitionNames  list of the names of the dedinitions
 * @return this builder
 */
public DslDefinitionBuilder addAllDefinitionLinks(final String fieldName, final List<String> definitionNames) {
    Assertion.checkNotNull(definitionNames);
    final DslEntityField dslEntityField = entity.getField(fieldName);
    Assertion.checkState(dslEntityField.getType().isEntityLink(), "expected a link on {0}", fieldName);
    // ---
    definitionLinkNamesByFieldName.get(dslEntityField).addAll(definitionNames);
    return this;
}
Also used : DslEntityField(io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField)

Example 5 with DslEntityField

use of io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField in project vertigo by KleeGroup.

the class DslDefinitionBuilder method addAllChildDefinitions.

private void addAllChildDefinitions(final String fieldName, final List<DslDefinition> dslDefinitions) {
    Assertion.checkNotNull(dslDefinitions);
    final DslEntityField dslEntityField = entity.getField(fieldName);
    Assertion.checkState(dslEntityField.getType().isEntity(), "expected an entity on {0}", fieldName);
    // ---
    childDefinitionsByFieldName.get(dslEntityField).addAll(dslDefinitions);
}
Also used : DslEntityField(io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField)

Aggregations

DslEntityField (io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityField)7 PegChoice (io.vertigo.commons.peg.PegChoice)1 PegRule (io.vertigo.commons.peg.PegRule)1 DslEntity (io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntity)1 DslEntityLink (io.vertigo.dynamo.plugins.environment.dsl.entity.DslEntityLink)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1