Browse Source

Made a object to model imports.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269154 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 24 years ago
parent
commit
16db5240fb
1 changed files with 82 additions and 0 deletions
  1. +82
    -0
      proposal/myrmidon/src/java/org/apache/myrmidon/components/model/Import.java

+ 82
- 0
proposal/myrmidon/src/java/org/apache/myrmidon/components/model/Import.java View File

@@ -0,0 +1,82 @@
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.myrmidon.components.model;

/**
* Imports in a build file.
*
* @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
*/
public class Import
{
//Name of library (this is location independent)
private final String m_library;

//Do we need this??
//private final String m_namespace;

//The type to be imported from library
private final String m_type;

//The name of type instance
private final String m_name;

public Import( final String library )
{
this( library, null, null );
}

public Import( final String library, final String type, final String name )
{
m_library = library;
m_type = type;
m_name = name;
//If only one of name or type is null, throw an exception
if( null == m_type || null == m_name )
{
if( null != m_type || null != m_name )
{
throw new IllegalArgumentException( "Can not have an import that specifies " +
"only one of name or type" );
}
}
}

/**
* Get type
*
* @return the type
*/
public final String getType()
{
return m_type;
}

/**
* Get name of imported
*
* @return the name
*/
public final String getName()
{
return m_name;
}

/**
* Get name of library
*
* @return the library name
*/
public final String getLibrary()
{
return m_library;
}
}



Loading…
Cancel
Save