当前位置: 首页>>代码示例>>Java>>正文


Java RendererPrecedence类代码示例

本文整理汇总了Java中org.datacleaner.api.RendererPrecedence的典型用法代码示例。如果您正苦于以下问题:Java RendererPrecedence类的具体用法?Java RendererPrecedence怎么用?Java RendererPrecedence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RendererPrecedence类属于org.datacleaner.api包,在下文中一共展示了RendererPrecedence类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerResult renderable) {
    try {
        // only apply to classes that has a specialized toString() method.
        final Method toStringMethod = renderable.getClass().getDeclaredMethod("toString");
        if (toStringMethod != null) {
            return RendererPrecedence.LOW;
        }
    } catch (final Exception e) {
        // ignore
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:14,代码来源:ToStringTextRenderer.java

示例2: isRendererCapable

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
private RendererSelection isRendererCapable(final RendererBeanDescriptor<?> rendererDescriptor,
        final Renderable renderable, final RendererSelection bestMatch) {
    final Renderer<Renderable, ?> renderer = instantiate(rendererDescriptor);

    if (_rendererInitializer != null) {
        _rendererInitializer.initialize(rendererDescriptor, renderer);
    }

    RendererPrecedence precedence;
    try {
        precedence = renderer.getPrecedence(renderable);
        if (precedence == null) {
            logger.debug("Renderer precedence was null for {}, using MEDIUM", renderer);
            precedence = RendererPrecedence.MEDIUM;
        }

        if (precedence == RendererPrecedence.NOT_CAPABLE) {
            logger.debug("Renderer is not capable of rendering this renderable!");
            return null;
        }

        if (bestMatch != null) {
            final RendererPrecedence bestPrecedence = bestMatch.getPrecedence();
            if (precedence.ordinal() < bestPrecedence.ordinal()) {
                logger.info("Precedence {} did not match or supersede best matching precedence ({}).", precedence,
                        bestPrecedence);
                return null;
            }
        }

    } catch (final Exception e) {
        logger.error("Could not get precedence of renderer, returning null", e);
        return null;
    }

    final Class<? extends Renderable> renderableType = rendererDescriptor.getRenderableType();
    final int hierarchyDistance = ReflectionUtils.getHierarchyDistance(renderable.getClass(), renderableType);

    return new RendererSelection(renderer, precedence, hierarchyDistance);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:41,代码来源:RendererFactory.java

示例3: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final RenderableString renderable) {
    if (renderable.toString().equals("foo")) {
        return RendererPrecedence.HIGHEST;
    }
    return RendererPrecedence.HIGH;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:MockRenderers.java

示例4: testRenderNumberResult

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
public void testRenderNumberResult() throws Exception {
    final NumberResult result = new NumberResult(1234);

    final MetricBasedResultTextRenderer renderer = new MetricBasedResultTextRenderer();
    assertEquals(RendererPrecedence.LOWEST, renderer.getPrecedence(result));

    final String str = renderer.render(result);
    assertEquals("NumberResult:\n" + " - Number: 1234", str);
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:10,代码来源:MetricBasedResultTextRendererTest.java

示例5: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final TransformerComponentBuilder<FuseStreamsComponent> tjb) {
    if (tjb.getDescriptor().getComponentClass() == FuseStreamsComponent.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:FuseStreamsComponentBuilderPresenterRenderer.java

示例6: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final TransformerComponentBuilder<CoalesceMultipleFieldsTransformer> tjb) {
    if (tjb.getDescriptor().getComponentClass() == CoalesceMultipleFieldsTransformer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:CoalesceMultipleFieldsTransformerComponentBuilderPresenterRenderer.java

示例7: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerComponentBuilder<InsertIntoTableAnalyzer> ajb) {
    if (ajb.getDescriptor().getComponentClass() == InsertIntoTableAnalyzer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:InsertIntoTableJobBuilderPresenterRenderer.java

示例8: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerComponentBuilder<UpdateTableAnalyzer> ajb) {
    if (ajb.getDescriptor().getComponentClass() == UpdateTableAnalyzer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:UpdateTableJobBuilderPresenterRenderer.java

示例9: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerComponentBuilder<CompletenessAnalyzer> ajb) {
    if (ajb.getDescriptor().getComponentClass() == CompletenessAnalyzer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:CompletenessAnalyzerComponentBuilderPresenterRenderer.java

示例10: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final FilterComponentBuilder<EqualsFilter, EqualsFilter.Category> fjb) {
    if (fjb.getDescriptor().getComponentClass() == EqualsFilter.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:EqualsFilterComponentBuilderPresenterRenderer.java

示例11: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final TransformerComponentBuilder<TextCaseTransformer> renderable) {
    if (renderable.getDescriptor().getComponentClass() == TextCaseTransformer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;

}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:9,代码来源:TextCaseTransformerPresenterRenderer.java

示例12: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final TransformerComponentBuilder<TableLookupTransformer> tjb) {
    if (tjb.getDescriptor().getComponentClass() == TableLookupTransformer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:TableLookupJobBuilderPresenterRenderer.java

示例13: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerComponentBuilder<CreateStagingTableAnalyzer> ajb) {
    final Class<CreateStagingTableAnalyzer> componentClass = ajb.getDescriptor().getComponentClass();
    if (componentClass == CreateStagingTableAnalyzer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:9,代码来源:CreateStagingTableAnalyzerSwingRenderer.java

示例14: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerComponentBuilder<CreateExcelSpreadsheetAnalyzer> ajb) {
    final Class<CreateExcelSpreadsheetAnalyzer> componentClass = ajb.getDescriptor().getComponentClass();
    if (componentClass == CreateExcelSpreadsheetAnalyzer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:9,代码来源:CreateExcelSpreadsheetAnalyzerSwingRenderer.java

示例15: getPrecedence

import org.datacleaner.api.RendererPrecedence; //导入依赖的package包/类
@Override
public RendererPrecedence getPrecedence(final AnalyzerComponentBuilder<DeleteFromTableAnalyzer> ajb) {
    if (ajb.getDescriptor().getComponentClass() == DeleteFromTableAnalyzer.class) {
        return RendererPrecedence.HIGH;
    }
    return RendererPrecedence.NOT_CAPABLE;
}
 
开发者ID:datacleaner,项目名称:DataCleaner,代码行数:8,代码来源:DeleteFromTableAnalyzerPresenterRenderer.java


注:本文中的org.datacleaner.api.RendererPrecedence类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。