Examples of MaxLengthFacet


Examples of org.apache.isis.core.metamodel.facets.propparam.maxlen.MaxLengthFacet

        final ScalarModel scalarModel = getModel();
        final AbstractTextComponent<String> textField = getTextField();

        final ObjectSpecification facetHolder = scalarModel.getTypeOfSpecification();

        final MaxLengthFacet maxLengthFacet = facetHolder.getFacet(MaxLengthFacet.class);
        if (maxLengthFacet != null) {
            textField.add(StringValidator.maximumLength(maxLengthFacet.value()));
        }
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.propparam.maxlen.MaxLengthFacet

            return;
        }
       
        final FacetedMethod holder = processMethodContext.getFacetHolder();
       
        MaxLengthFacet existingFacet = holder.getFacet(MaxLengthFacet.class);
       
        final MaxLengthFacet facet = new MaxLengthFacetDerivedFromJdoColumn(annotation.length(), holder);
       
        if(!existingFacet.isNoop()) {
            // will raise violation later
            facet.setUnderlyingFacet(existingFacet);
        }
       
        FacetUtil.addFacet(facet);
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.propparam.maxlen.MaxLengthFacet

                    // skip checks if annotated with JDO @NotPersistent
                    if(association.containsDoOpFacet(JdoNotPersistentFacet.class)) {
                        return;
                    }
                   
                    MaxLengthFacet facet = association.getFacet(MaxLengthFacet.class);

                    MaxLengthFacet underlying = (MaxLengthFacet) facet.getUnderlyingFacet();
                    if(underlying == null) {
                        continue;
                    }

                    if(facet instanceof MaxLengthFacetDerivedFromJdoColumn && underlying instanceof MaxLengthFacetOnPropertyAnnotation) {
                        if(facet.value() != underlying.value()) {
                            validationFailures.add("%s: incompatible usage of Isis' @MaxLength annotation and @javax.jdo.annotations.Column with inconsistent lengths; use just @javax.jdo.annotations.Column(length=...)", association.getIdentifier().toClassAndNameIdentityString());
                        }
                    }
                }
            }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.propparam.maxlen.MaxLengthFacet

    @Override
    protected void addPropertiesSpecificToFeature() {
        representation.mapPut("name", getObjectFeature().getName());
        representation.mapPut("number", getObjectFeature().getNumber());
        representation.mapPut("optional", getObjectFeature().isOptional());
        final MaxLengthFacet maxLength = getObjectFeature().getFacet(MaxLengthFacet.class);
        if (maxLength != null && !maxLength.isNoop()) {
            representation.mapPut("maxLength", maxLength.value());
        }
    }
View Full Code Here

Examples of org.apache.isis.core.metamodel.facets.propparam.maxlen.MaxLengthFacet

    }

    @Override
    protected void addPropertiesSpecificToFeature() {
        representation.mapPut("optional", !getObjectFeature().isMandatory());
        final MaxLengthFacet maxLength = getObjectFeature().getFacet(MaxLengthFacet.class);
        if (maxLength != null && !maxLength.isNoop()) {
            representation.mapPut("maxLength", maxLength.value());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.