class ReadableCategoryPopulator extends
        AbstractDataPopulator<Category, ReadableCategory> {

    @Override
    public ReadableCategory populate(final Category source,
            final ReadableCategory target,
            final MerchantStore store,
            final Language language) throws ConversionException {<FILL_FUNCTION_BODY>}

    @Override
    protected ReadableCategory createTarget() {
        return null;
    }

}


        Validate.notNull(source, "Category must not be null");

        target.setLineage(source.getLineage());
        if (source.getDescriptions() != null && source.getDescriptions().size() > 0) {

            CategoryDescription description = source.getDescription();
            if (source.getDescriptions().size() > 1) {
                for (final CategoryDescription desc : source.getDescriptions()) {
                    if (desc.getLanguage().getCode().equals(language.getCode())) {
                        description = desc;
                        break;
                    }
                }
            }

            if (description != null) {
                final com.salesmanager.shop.model.catalog.category.CategoryDescription desc = new com.salesmanager.shop.model.catalog.category.CategoryDescription();
                desc.setFriendlyUrl(description.getSeUrl());
                desc.setName(description.getName());
                desc.setId(source.getId());
                desc.setDescription(description.getDescription());
                desc.setKeyWords(description.getMetatagKeywords());
                desc.setHighlights(description.getCategoryHighlight());
                desc.setTitle(description.getMetatagTitle());
                desc.setMetaDescription(description.getMetatagDescription());

                target.setDescription(desc);
            }

        }

        if (source.getParent() != null) {
            final com.salesmanager.shop.model.catalog.category.Category parent = new com.salesmanager.shop.model.catalog.category.Category();
            parent.setCode(source.getParent().getCode());
            parent.setId(source.getParent().getId());
            target.setParent(parent);
        }

        target.setCode(source.getCode());
        target.setId(source.getId());
        if (source.getDepth() != null) {
            target.setDepth(source.getDepth());
        }
        target.setSortOrder(source.getSortOrder());
        target.setVisible(source.isVisible());
        target.setFeatured(source.isFeatured());

        return target;

    
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.catalog.category.ReadableCategory populate(com.salesmanager.core.model.catalog.category.Category, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesmanager.core.business.exception.ConversionException,public void setLocale(java.util.Locale) <variables>private java.util.Locale locale