Package org.apache.directory.studio.ldifparser.model

Examples of org.apache.directory.studio.ldifparser.model.LdifFile


    }


    public LdifFile parse( String ldif )
    {
        LdifFile model = new LdifFile();
        if ( ldif != null )
        {
            LdifEnumeration enumeration = this.parse( new StringReader( ldif ) );
            try
            {
                while ( enumeration.hasNext() )
                {
                    LdifContainer container = enumeration.next();
                    model.addContainer( container );
                }
            }
            catch ( Exception e )
            {
            }
View Full Code Here


            public boolean hasNext()
            {
                if ( containerList.isEmpty() )
                {

                    LdifFile model = new LdifFile();

                    // parse header
                    if ( !headerParsed )
                    {
                        checkAndParseComment( model );
                        checkAndParseVersion( model );
                        checkAndParseComment( model );
                        headerParsed = true;
                    }

                    // parse body (in a loop)
                    if ( headerParsed && !bodyParsed )
                    {
                        // parse comment lines
                        if ( !checkAndParseComment( model ) )
                        {
                            // parse record
                            if ( !checkAndParseRecord( model ) )
                            {
                                // parse unknown
                                if ( !checkAndParseOther( model ) )
                                {
                                    // end of body
                                    bodyParsed = true;
                                }
                            }
                        }
                    }

                    // parse footer
                    if ( headerParsed && bodyParsed && !footerParsed )
                    {
                        checkAndParseComment( model );
                        footerParsed = true;
                    }

                    LdifContainer[] containers = model.getContainers();
                    this.containerList.addAll( Arrays.asList( containers ) );
                    return !containerList.isEmpty() && !( containers[0] instanceof LdifEOFContainer );

                }
                else
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldifparser.model.LdifFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.