Search in sources :

Example 1 with Descriptor

use of org.springsource.ide.eclipse.commons.content.core.util.Descriptor in project eclipse-integration-commons by spring-projects.

the class ContentManager method read.

private void read(File file) throws CoreException {
    DescriptorMatcher matcher = new DescriptorMatcher(this);
    DescriptorReader reader = new DescriptorReader();
    reader.read(file);
    List<Descriptor> descriptors = reader.getDescriptors();
    for (Descriptor descriptor : descriptors) {
        if (!matcher.match(descriptor)) {
            continue;
        }
        ContentItem item = itemById.get(descriptor.getId());
        if (item == null) {
            item = createItem(descriptor);
            if (item != null) {
                itemById.put(item.getId(), item);
            }
        }
        if (item != null) {
            if (descriptor.isLocal()) {
                item.setLocalDescriptor(descriptor);
            } else {
                item.setRemoteDescriptor(descriptor);
            }
        }
    }
}
Also used : DescriptorMatcher(org.springsource.ide.eclipse.commons.internal.content.core.DescriptorMatcher) Descriptor(org.springsource.ide.eclipse.commons.content.core.util.Descriptor) DescriptorReader(org.springsource.ide.eclipse.commons.content.core.util.DescriptorReader)

Example 2 with Descriptor

use of org.springsource.ide.eclipse.commons.content.core.util.Descriptor in project eclipse-integration-commons by spring-projects.

the class DescriptorMatcherTest method setUp.

@Override
protected void setUp() throws Exception {
    descriptor = new Descriptor();
    System.setProperty("org.springsource.sts", "abc");
    matcher = new DescriptorMatcher(new ContentManager());
    matcher.setVersion(null);
}
Also used : ContentManager(org.springsource.ide.eclipse.commons.content.core.ContentManager) Descriptor(org.springsource.ide.eclipse.commons.content.core.util.Descriptor)

Aggregations

Descriptor (org.springsource.ide.eclipse.commons.content.core.util.Descriptor)2 ContentManager (org.springsource.ide.eclipse.commons.content.core.ContentManager)1 DescriptorReader (org.springsource.ide.eclipse.commons.content.core.util.DescriptorReader)1 DescriptorMatcher (org.springsource.ide.eclipse.commons.internal.content.core.DescriptorMatcher)1