Package fr.soleil.data.adapter

Examples of fr.soleil.data.adapter.NumberToStringDataAdapter


        adapters.clear();
    }

    @SuppressWarnings("unchecked")
    protected NumberToStringDataAdapter getNumberAdapter(AbstractDataSource<?> source) {
        NumberToStringDataAdapter result = null;
        if ((numberController != null) && (source.getDataType() != null)
                && Number.class.equals(source.getDataType().getConcernedClass())) {
            result = numberController.getAdapter((AbstractDataSource<Number>) source);
        }
        return result;
View Full Code Here


    @Override
    protected void initPlugins(IDataSourceProducer producer, AbstractDataSource<?> source,
            ITextTarget target) {
        super.initPlugins(producer, source, target);
        NumberToStringDataAdapter numberAdapter = getNumberAdapter(source);
        if (numberAdapter != null) {
            FormatPlugin foundedPlugin = getPlugin(target, FormatPlugin.class);
            if (foundedPlugin != null) {
                try {
                    foundedPlugin.addPlugin(source.getOriginDescriptor(), numberAdapter);
View Full Code Here

    @Override
    protected void filterPlugins(final List<AbstractPlugin<?>> plugins,
            final IDataSourceProducer producer, final AbstractDataSource<?> source,
            final ITextTarget target) {
        final List<AbstractPlugin<?>> toRemove = new ArrayList<AbstractPlugin<?>>();
        NumberToStringDataAdapter numberAdapter = getNumberAdapter(source);
        for (final AbstractPlugin<?> plugin : plugins) {
            boolean connectionState;
            try {
                plugin.setFirstInitAllowed(firstInitAllowed);
                connectionState = plugin.addPlugin(producer, source.getOriginDescriptor(), target)
View Full Code Here

        for (AbstractController<?> controller : getUsedControllers()) {
            sources.addAll(controller.getSourceList());
        }
        List<NumberToStringDataAdapter> adapters = new ArrayList<NumberToStringDataAdapter>();
        for (AbstractDataSource<?> source : sources) {
            NumberToStringDataAdapter adapter = getNumberAdapter(source);
            if (adapter != null) {
                adapters.add(adapter);
            }
        }
        sources.clear();
View Full Code Here

        adapters.clear();
    }

    @SuppressWarnings("unchecked")
    protected NumberToStringDataAdapter getNumberAdapter(AbstractDataSource<?> source) {
        NumberToStringDataAdapter result = null;
        if ((numberController != null) && (source.getDataType() != null)
                && Number.class.equals(source.getDataType().getConcernedClass())) {
            result = numberController.getAdapter((AbstractDataSource<Number>) source);
        }
        return result;
View Full Code Here

    @SuppressWarnings("unchecked")
    @Override
    protected AbstractDataAdapter<U, T> createAdapter(AbstractDataSource<U> source) {
        if (targetType.equals(String.class) && sourceType.equals(Number.class)
                && source.getDataType().getConcernedClass().equals(Number.class)) {
            return (AbstractDataAdapter<U, T>) new NumberToStringDataAdapter(
                    (AbstractDataSource<Number>) source);
        }
        else {
            return super.createAdapter(source);
        }
View Full Code Here

     * @param source The {@link AbstractDataSource}
     * @return The corresponding {@link NumberToStringDataAdapter}, or <code>null</code> is there is
     *         no such adapter
     */
    public NumberToStringDataAdapter getAdapter(AbstractDataSource<U> source) {
        NumberToStringDataAdapter result = null;
        AbstractDataAdapter<U, T> adapter = adapters.get(source);
        if (adapter instanceof NumberToStringDataAdapter) {
            result = (NumberToStringDataAdapter) adapter;
        }
        return result;
View Full Code Here

    protected void initPlugins(IDataSourceProducer producer, AbstractDataSource<?> source,
            ITextTarget target) {

        super.initPlugins(producer, source, target);

        NumberToStringDataAdapter numberAdapter = getNumberAdapter(source);
        if (numberAdapter != null) {
            FormatPlugin foundedPlugin = getPlugin(target, FormatPlugin.class);

            if (foundedPlugin != null) {
                try {
View Full Code Here

        for (AbstractController<?> controller : getUsedControllers()) {
            sources.addAll(controller.getSourceList());
        }
        List<NumberToStringDataAdapter> adapters = new ArrayList<NumberToStringDataAdapter>();
        for (AbstractDataSource<?> source : sources) {
            NumberToStringDataAdapter adapter = getNumberAdapter(source);
            if (adapter != null) {
                adapters.add(adapter);
            }
        }
        sources.clear();
View Full Code Here

        adapters.clear();
    }

    @SuppressWarnings("unchecked")
    protected NumberToStringDataAdapter getNumberAdapter(AbstractDataSource<?> source) {
        NumberToStringDataAdapter result = null;
        if ((numberController != null) && (source.getDataType() != null)
                && Number.class.equals(source.getDataType().getConcernedClass())) {
            result = numberController.getAdapter((AbstractDataSource<Number>) source);
        }
        return result;
View Full Code Here

TOP

Related Classes of fr.soleil.data.adapter.NumberToStringDataAdapter

Copyright © 2018 www.massapicom. 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.