KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > content > BasicDescription


1 /*******************************************************************************
2  * Copyright (c) 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.content;
12
13 import org.eclipse.core.runtime.content.IContentDescription;
14 import org.eclipse.core.runtime.content.IContentType;
15
16 public abstract class BasicDescription implements IContentDescription {
17
18     protected IContentTypeInfo contentTypeInfo;
19
20     public BasicDescription(IContentTypeInfo contentTypeInfo) {
21         this.contentTypeInfo = contentTypeInfo;
22     }
23
24     /**
25      * @see IContentDescription
26      */

27     public IContentType getContentType() {
28         ContentType contentType = contentTypeInfo.getContentType();
29         //TODO performance: potential creation of garbage
30
return new ContentTypeHandler(contentType, contentType.getCatalog().getGeneration());
31     }
32
33     public IContentTypeInfo getContentTypeInfo() {
34         return contentTypeInfo;
35     }
36 }
37
Popular Tags