blob: 876b3130518a11735fcd5d73442024eb92800d5e [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008 Innoopract Informationssysteme GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Innoopract Informationssysteme GmbH - initial API and implementation
******************************************************************************/
package org.eclipse.epp.wizard.model;
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
import java.util.List;
import org.eclipse.equinox.internal.p2.metadata.InstallableUnit;
import org.jdom.JDOMException;
/**
* @author Jordi Boehme Lopez <jboehme@innoopract.com>
*/
@SuppressWarnings("restriction")
public class EPPModel {
public EPPModel( Structure structure ) {
super();
this.structure = structure;
}
private Structure structure;
public Structure getStructure() {
return structure;
}
public List<IURef> getAllRefs( IURef ref ) {
return refMap.get( ref.getIU() );
}
private HashMap<InstallableUnit, List<IURef>> refMap = new HashMap<InstallableUnit, List<IURef>>();
public HashMap<InstallableUnit, List<IURef>> getRefMap() {
return refMap;
}
public static EPPModel read( final URL modelLocation,
final URL metadataRepository )
throws IOException, JDOMException
{
return ( new EPPModelDeserializer() ).deserialize( modelLocation,
metadataRepository );
}
}