當前位置: 首頁>>代碼示例>>Java>>正文


Java XmlPullParserException.getMessage方法代碼示例

本文整理匯總了Java中org.codehaus.plexus.util.xml.pull.XmlPullParserException.getMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java XmlPullParserException.getMessage方法的具體用法?Java XmlPullParserException.getMessage怎麽用?Java XmlPullParserException.getMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.codehaus.plexus.util.xml.pull.XmlPullParserException的用法示例。


在下文中一共展示了XmlPullParserException.getMessage方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getArchetypeCatalog

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
public ArchetypeCatalog getArchetypeCatalog()
    throws IOException, ArchetypeCatalogNotFoundException
{
    File file = new File( root, "archetype-catalog.xml" );
    if ( !file.isFile() )
    {
        throw new ArchetypeCatalogNotFoundException();
    }
    ArchetypeCatalogXpp3Reader reader = new ArchetypeCatalogXpp3Reader();
    InputStream inputStream = null;
    try
    {
        inputStream = new FileInputStream( file );
        return reader.read( inputStream );
    }
    catch ( XmlPullParserException e )
    {
        IOException ioe = new IOException( e.getMessage() );
        ioe.initCause( e );
        throw ioe;
    }
    finally
    {
        IOUtils.closeQuietly( inputStream );
    }
}
 
開發者ID:mojohaus,項目名稱:mrm,代碼行數:27,代碼來源:DiskArtifactStore.java

示例2: getArchetypeCatalog

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
public synchronized ArchetypeCatalog getArchetypeCatalog()
    throws IOException, ArchetypeCatalogNotFoundException
{
    if ( archetypeCatalog != null )
    {
        ArchetypeCatalogXpp3Reader reader = new ArchetypeCatalogXpp3Reader();
        InputStream inputStream = null;
        try
        {
            inputStream = new ByteArrayInputStream( archetypeCatalog.getBytes() );
            return reader.read( inputStream );
        }
        catch ( XmlPullParserException e )
        {
            throw new ArchetypeCatalogNotFoundException( e.getMessage(), e );
        }
        finally
        {
            IOUtils.closeQuietly( inputStream );
        }
    }
    else
    {
        throw new ArchetypeCatalogNotFoundException();
    }
}
 
開發者ID:mojohaus,項目名稱:mrm,代碼行數:27,代碼來源:MemoryArtifactStore.java

示例3: getArchetypeCatalog

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
public ArchetypeCatalog getArchetypeCatalog()
    throws IOException, ArchetypeCatalogNotFoundException
{
    Entry entry = backing.get( "archetype-catalog.xml" );
    if ( !( entry instanceof FileEntry ) )
    {
        throw new ArchetypeCatalogNotFoundException();
    }
    ArchetypeCatalogXpp3Reader reader = new ArchetypeCatalogXpp3Reader();
    InputStream inputStream = null;
    try
    {
        inputStream =  ( (FileEntry) entry ).getInputStream();
        return reader.read( inputStream );
    }
    catch ( XmlPullParserException e )
    {
        IOException ioe = new IOException( e.getMessage() );
        ioe.initCause( e );
        throw ioe;
    }
    finally
    {
        IOUtils.closeQuietly( inputStream );
    }
}
 
開發者ID:mojohaus,項目名稱:mrm,代碼行數:27,代碼來源:FileSystemArtifactStore.java

示例4: getRawModel

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
/**
 * Gets the current raw model before any interpolation what-so-ever.
 *
 * @param modifiedPomXMLEventReader The {@link ModifiedPomXMLEventReader} to get the raw model for.
 * @return The raw model.
 * @throws IOException if the file is not found or if the file does not parse.
 */
public static Model getRawModel( ModifiedPomXMLEventReader modifiedPomXMLEventReader )
    throws IOException
{
    StringReader stringReader = null;
    try
    {
        stringReader = new StringReader( modifiedPomXMLEventReader.asStringBuilder().toString() );
        MavenXpp3Reader reader = new MavenXpp3Reader();
        return reader.read( stringReader );
    }
    catch ( XmlPullParserException e )
    {
        IOException ioe = new IOException( e.getMessage() );
        ioe.initCause( e );
        throw ioe;
    }
    finally
    {
        if ( stringReader != null )
        {
            stringReader.close();
        }
    }
}
 
開發者ID:petr-ujezdsky,項目名稱:versions-maven-plugin-svn-clone,代碼行數:32,代碼來源:PomHelper.java

示例5: read

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
public Metadata read( Reader input, Map<String, ?> options )
    throws IOException
{
    if ( input == null )
    {
        throw new IllegalArgumentException( "input reader missing" );
    }

    try
    {
        MetadataXpp3Reader r = new MetadataXpp3Reader();
        return r.read( input, isStrict( options ) );
    }
    catch ( XmlPullParserException e )
    {
        throw new MetadataParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
    }
    finally
    {
        IOUtil.close( input );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:23,代碼來源:DefaultMetadataReader.java

示例6: read

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
public Settings read( Reader input, Map<String, ?> options )
    throws IOException
{
    if ( input == null )
    {
        throw new IllegalArgumentException( "input reader missing" );
    }

    try
    {
        SettingsXpp3Reader r = new SettingsXpp3Reader();
        return r.read( input, isStrict( options ) );
    }
    catch ( XmlPullParserException e )
    {
        throw new SettingsParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
    }
    finally
    {
        IOUtil.close( input );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:23,代碼來源:DefaultSettingsReader.java

示例7: read

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
private Model read( Reader reader, boolean strict, InputSource source )
    throws IOException
{
    try
    {
        if ( source != null )
        {
            return new MavenXpp3ReaderEx().read( reader, strict, source );
        }
        else
        {
            return new MavenXpp3Reader().read( reader, strict );
        }
    }
    catch ( XmlPullParserException e )
    {
        throw new ModelParseException( e.getMessage(), e.getLineNumber(), e.getColumnNumber(), e );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:20,代碼來源:DefaultModelReader.java

示例8: getMetadata

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public Metadata getMetadata( String path )
    throws IOException, MetadataNotFoundException
{
    File file = root;
    String[] parts = StringUtils.strip( path, "/" ).split( "/" );
    for ( int i = 0; i < parts.length; i++ )
    {
        file = new File( file, parts[i] );
    }
    file = new File( file, "maven-metadata.xml" );
    if ( !file.isFile() )
    {
        throw new MetadataNotFoundException( path );
    }
    MetadataXpp3Reader reader = new MetadataXpp3Reader();
    InputStream inputStream = null;
    try
    {
        inputStream = new FileInputStream( file );
        return reader.read( inputStream );
    }
    catch ( XmlPullParserException e )
    {
        IOException ioe = new IOException( e.getMessage() );
        ioe.initCause( e );
        throw ioe;
    }
    finally
    {
        IOUtils.closeQuietly( inputStream );
    }
}
 
開發者ID:mojohaus,項目名稱:mrm,代碼行數:36,代碼來源:DiskArtifactStore.java

示例9: getMetadata

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
/**
 * {@inheritDoc}
 */
public Metadata getMetadata( String path )
    throws IOException, MetadataNotFoundException
{
    Entry entry = backing.get(
        StringUtils.join( StringUtils.split( StringUtils.strip( path, "/" ), "/" ), "/" ) + "/maven-metadata.xml" );
    if ( !( entry instanceof FileEntry ) )
    {
        throw new MetadataNotFoundException( path );
    }
    MetadataXpp3Reader reader = new MetadataXpp3Reader();
    InputStream inputStream = null;
    try
    {
        inputStream = ( (FileEntry) entry ).getInputStream();
        return reader.read( inputStream );
    }
    catch ( XmlPullParserException e )
    {
        IOException ioe = new IOException( e.getMessage() );
        ioe.initCause( e );
        throw ioe;
    }
    finally
    {
        IOUtils.closeQuietly( inputStream );
    }
}
 
開發者ID:mojohaus,項目名稱:mrm,代碼行數:31,代碼來源:FileSystemArtifactStore.java

示例10: getRawModel

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
/**
 * Gets the raw model before any interpolation what-so-ever.
 *
 * @param moduleProjectFile The project file to get the raw model for.
 * @return The raw model.
 * @throws IOException if the file is not found or if the file does not parse.
 */
public static Model getRawModel( File moduleProjectFile )
    throws IOException
{
    try (FileInputStream input = new FileInputStream( moduleProjectFile ))
    {
        return new MavenXpp3Reader().read( input );
    }
    catch ( XmlPullParserException e )
    {
        throw new IOException( e.getMessage(), e );
    }
}
 
開發者ID:mojohaus,項目名稱:versions-maven-plugin,代碼行數:20,代碼來源:PomHelper.java

示例11: toMavenMetadata

import org.codehaus.plexus.util.xml.pull.XmlPullParserException; //導入方法依賴的package包/類
/**
 * Creates a maven <code>Metadata</code> out of a <code>java.io.Reader</code> and will close the reader.
 *
 * @param reader Reader representing content of maven-metadata.xml
 * @return Metadata object created from the reader
 * @throws java.io.IOException If the input reader doesn't holds a valid maven metadata
 */
public static Metadata toMavenMetadata(Reader reader) throws IOException {
    MetadataXpp3Reader metadataReader = new MetadataXpp3Reader();
    try {
        return metadataReader.read(reader, false);
    } catch (XmlPullParserException e) {
        throw new IOException("Failed to parse metadata: " + e.getMessage());
    } finally {
        IOUtils.closeQuietly(reader);
    }
}
 
開發者ID:alancnet,項目名稱:artifactory,代碼行數:18,代碼來源:MavenModelUtils.java


注:本文中的org.codehaus.plexus.util.xml.pull.XmlPullParserException.getMessage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。