001/** 002 * '$RCSfile$' 003 * '$Author$' 004 * '$Date$' 005 * '$Revision$' 006 * 007 * For Details: 008 * http://www.kepler-project.org 009 * 010 * Copyright (c) 2006-2013 The Regents of the 011 * University of California. All rights reserved. Permission is hereby granted, 012 * without written agreement and without license or royalty fees, to use, copy, 013 * modify, and distribute this software and its documentation for any purpose, 014 * provided that the above copyright notice and the following two paragraphs 015 * appear in all copies of this software. IN NO EVENT SHALL THE UNIVERSITY OF 016 * CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, 017 * OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS 018 * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE 019 * POSSIBILITY OF SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY 020 * DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 021 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE 022 * SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF 023 * CALIFORNIA HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 024 * ENHANCEMENTS, OR MODIFICATIONS. 025 */ 026package ptolemy.moml; 027 028import java.util.List; 029 030import ptolemy.kernel.CompositeEntity; 031import ptolemy.kernel.util.Workspace; 032 033/** 034 * An abstract class that defines the interface for LibraryBuilder. 035 * The main purpose of a library builder is to create a moml library 036 * from something other than a moml document. The first 037 * implementation of this class is going to be to create a library 038 * from a directory of ksw files. 039 * @author Chad Berkley 040 * @version $Id$ 041 * @since Ptolemy II 5.2 042 * @Pt.ProposedRating Red (berkley) 043 * @Pt.AcceptedRating Red (berkley) 044 */ 045public abstract class LibraryBuilder { 046 /////////////////////////////////////////////////////////////////// 047 //// public methods //// 048 049 /** 050 * Construct a library builder. 051 */ 052 public LibraryBuilder() { 053 // Nothing to do, but makes it easier to use reflection. 054 } 055 056 /** 057 * Add a list of Attributes. 058 * @param attributeList The list of Attributes. 059 */ 060 public void addAttributes(List attributeList) { 061 _attributes = attributeList; 062 } 063 064 /** 065 * Get the list of Attributes associated with this LibraryBuilder. 066 * @return The list of Attributes. 067 */ 068 public List getAttributes() { 069 return _attributes; 070 } 071 072 /** 073 * Build the library. This should be built in the form of a 074 * ComponentEntity See the VergilApplication code if you want an 075 * example of what the ComponentEntity should look like. 076 * @param workspace The workspace. 077 * @return ComponentEntity 078 * @exception Exception 079 */ 080 public abstract CompositeEntity buildLibrary(Workspace workspace) 081 throws Exception; 082 083 /////////////////////////////////////////////////////////////////// 084 //// protected members //// 085 086 /** Attributes that can be added to a LibraryBuilder via moml configuration. 087 */ 088 protected List _attributes; 089}