Examples of MetadataExtractor


Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

        }
    }

    private Map<String, Object> convert(MetaDataEntry metaDataEntry)
    {
        MetaDataExtractor extractor = DefaultPropertyScanningMetaDataExtractor.getInstance();

        String[] targetExpressions = metaDataEntry.getValue(JoinValidation.class).value();

        ValidationStrategy validationStrategy;
        MetaDataTransformer metaDataTransformer;

        Map<String, Object> results = new HashMap<String, Object>();

        PropertyDetails propertyDetails;
        FacesContext facesContext = FacesContext.getCurrentInstance();
        for (String targetExpression : targetExpressions)
        {
            propertyDetails = ExtValUtils
                .createPropertyDetailsForNewTarget(metaDataEntry, targetExpression);

            for (MetaDataEntry entry : extractor.extract(facesContext, propertyDetails).getMetaDataEntries())
            {
                validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());

                if(validationStrategy == null ||
                        PropertyValidationUtils.isValidationSkipped(facesContext,
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

    private void validateJoinValidation(FacesContext facesContext,
                                        UIComponent uiComponent,
                                        MetaDataEntry metaDataEntry,
                                        Object convertedObject)
    {
        MetaDataExtractor extractor = DefaultPropertyScanningMetaDataExtractor.getInstance();

        String[] targetExpressions = metaDataEntry.getValue(JoinValidation.class).value();

        ValidationStrategy validationStrategy;

        PropertyDetails propertyDetails;
        for (String targetExpression : targetExpressions)
        {
            propertyDetails = ExtValUtils
                .createPropertyDetailsForNewTarget(metaDataEntry, targetExpression);

            for (MetaDataEntry entry : extractor.extract(facesContext, propertyDetails).getMetaDataEntries())
            {
                validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());

                if (validationStrategy != null)
                {
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

        return ExtValUtils.getTransformedMetaDataFor(facesContext, uiComponent, getModuleKey());
    }

    protected void processValidation(FacesContext facesContext, UIComponent uiComponent, Object convertedObject)
    {
        MetaDataExtractor metaDataExtractor = ExtValUtils
                .getComponentMetaDataExtractorWith(getPropertiesForComponentMetaDataExtractor(uiComponent));

        PropertyInformation propertyInformation = metaDataExtractor.extract(facesContext, uiComponent);

        try
        {
            logger.finest("start validation");
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

     */
    protected PropertyInformation getPropertyInformation(FacesContext facesContext, UIComponent uiComponent)
    {
        Map<String, Object> properties = getPropertiesForComponentMetaDataExtractor(uiComponent);

        MetaDataExtractor metaDataExtractor = getComponentMetaDataExtractor(properties);

        return metaDataExtractor.extract(facesContext, uiComponent);
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

    }

    public static MetaDataExtractor createInterceptedMetaDataExtractorWith(
            final MetaDataExtractor metaDataExtractor, final Map<String, Object> properties)
    {
        return new MetaDataExtractor()
        {
            public PropertyInformation extract(FacesContext facesContext, Object object)
            {
                PropertyInformation result = metaDataExtractor.extract(facesContext, object);
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

            FacesContext facesContext, UIComponent uiComponent, Map<String, Object> properties)
    {
        ValidationStrategy validationStrategy;

        SkipValidationEvaluator skipValidationEvaluator = ExtValContext.getContext().getSkipValidationEvaluator();
        MetaDataExtractor metaDataExtractor = getComponentMetaDataExtractorWith(properties);

        Map<String, Object> metaData;
        Map<String, Object> metaDataResult = new HashMap<String, Object>();

        for (MetaDataEntry entry : metaDataExtractor.extract(facesContext, uiComponent).getMetaDataEntries())
        {
            metaData = new HashMap<String, Object>();
            validationStrategy = getValidationStrategyForMetaData(entry.getKey());

            if (validationStrategy != null)
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

    @Test
    public void testCustomComponentMetaDataExtractorClassNameDefault()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        // Object isn't allowed so we get an empty propertyInformation object
        // back.
        // The web.xml and custom config sets an extractor that enters something
        // here.
        Assert.assertNull(propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

    @Test
    public void testCustomComponentMetaDataExtractorClassNameWebXml()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        Assert.assertEquals(WEB_XML, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

    @Test
    public void testCustomComponentMetaDataExtractorClassNameCustomConfig()
    {
        DefaultComponentMetaDataExtractorFactory factory = new DefaultComponentMetaDataExtractorFactory();
        MetaDataExtractor extractor = factory.create();
        PropertyInformation propInformation = extractor.extract(facesContext, new Object());
        Assert.assertEquals(CUSTOM_CONFIG, propInformation.getInformation(PropertyInformationKeys.CUSTOM_PROPERTIES));
    }
View Full Code Here

Examples of org.apache.myfaces.extensions.validator.core.metadata.extractor.MetaDataExtractor

@UsageInformation(UsageCategory.INTERNAL)
public class JoinMetaDataTransformer implements MetaDataTransformer
{
    public Map<String, Object> convertMetaData(MetaDataEntry metaDataEntry)
    {
        MetaDataExtractor extractor = new DefaultPropertyScanningMetaDataExtractor();

        String[] targetExpressions = metaDataEntry.getValue(JoinValidation.class).value();

        ValidationStrategy validationStrategy;
        MetaDataTransformer metaDataTransformer;

        Map<String, Object> results = new HashMap<String, Object>();

        PropertyDetails propertyDetails;
        for (String targetExpression : targetExpressions)
        {
            propertyDetails = ExtValUtils
                .createPropertyDetailsForNewTarget(metaDataEntry, targetExpression);

            for (MetaDataEntry entry : extractor.extract(FacesContext.getCurrentInstance(),
                propertyDetails).getMetaDataEntries())
            {
                validationStrategy = ExtValUtils.getValidationStrategyForMetaData(entry.getKey());

                metaDataTransformer = ExtValUtils.getMetaDataTransformerForValidationStrategy(validationStrategy);
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.