/** * Narrows this feed using categories with an appropriate kind value. * This will loop through the categories, checking if they represent kinds, * and adapting the feed to that kind if an appropriate adaptation was * found. This will return the most specific subtype of the narrowed type. */ @Override protected Element narrow(ElementMetadata<?,?> meta, ValidationContext vc) { String kind = Kinds.getElementKind(this); if (kind != null) { return adapt(this, meta, kind); } return super.narrow(meta, vc); }
/** * Narrows this feed using categories with an appropriate kind value. * This will loop through the categories, checking if they represent kinds, * and adapting the feed to that kind if an appropriate adaptation was * found. This will return the most specific subtype of the narrowed type. */ @Override protected Element narrow(ElementMetadata<?,?> meta, ValidationContext vc) { String kind = Kinds.getElementKind(this); if (kind != null) { return adapt(this, meta, kind); } return super.narrow(meta, vc); }
/** * Narrows this feed using categories with an appropriate kind value. * This will loop through the categories, checking if they represent kinds, * and adapting the feed to that kind if an appropriate adaptation was * found. This will return the most specific subtype of the narrowed type. */ @Override protected Element narrow(ElementMetadata<?,?> meta, ValidationContext vc) { Element narrowed = this; for (Category category : getCategories()) { if (Namespaces.gKind.equals(category.getScheme())) { narrowed = adapt(narrowed, meta, category.getTerm()); } } if (narrowed == this) { narrowed = super.narrow(meta, vc); } return narrowed; }