Package org.apache.directory.ldapstudio.browser.core.model.ldif.parser

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.parser.LdifParser


                    {
                        StringBuffer sb = new StringBuffer();
                        new CopyEntryAsLdifAction( CopyEntryAsLdifAction.MODE_INCLUDE_OPERATIONAL_ATTRIBUTES )
                            .serialializeEntries( new IEntry[]
                                { ( IEntry ) o }, sb );
                        LdifFile model = new LdifParser().parse( sb.toString() );
                        treeViewer.setInput( model );
                        treeViewer.expandToLevel( 2 );
                    }
                }
            }
View Full Code Here


     * Creates a new instance of LdifDocumentProvider.
     */
    public LdifDocumentProvider()
    {
        super();
        this.ldifParser = new LdifParser();
        this.ldifDocumentSetupParticipant = new LdifDocumentSetupParticipant();
    }
View Full Code Here

    private void validate()
    {

        String dummyLdif = "dn: cn=dummy" + BrowserCoreConstants.LINE_SEPARATOR + modWidget.getLdifFragment();
        LdifFile model = new LdifParser().parse( dummyLdif );
        LdifContainer[] containers = model.getContainers();
        if ( containers.length == 0 )
        {
            setPageComplete( false );
            return;
View Full Code Here

     */
    public void loadFromLdif( Reader reader )
    {
        try
        {
            LdifParser parser = new LdifParser();
            LdifEnumeration enumeration = parser.parse( reader );
            if ( enumeration.hasNext( null ) )
            {
                LdifContainer container = enumeration.next( null );
                if ( container instanceof LdifContentRecord )
                {
View Full Code Here

                return;
            }

            try
            {
                LdifParser parser = new LdifParser();
                IDocument document = viewer.getDocument();
                ITypedRegion partition = document.getPartition( cursorPos );

                // now use position relative to partition
                int offset = partition.getOffset();
                int relativePos = cursorPos - offset;

                // parse partition
                String s = document.get( partition.getOffset(), partition.getLength() );
                LdifFile model = parser.parse( s );
                LdifContainer container = LdifFile.getContainer( model, relativePos );
                if ( container != null )
                {
                    LdifPart part = LdifFile.getContainerContent( container, relativePos );
View Full Code Here

        monitor.worked( 1 );

        try
        {
            Reader ldifReader = new BufferedReader( new FileReader( this.ldifFile ) );
            LdifParser parser = new LdifParser();
            LdifEnumeration enumeration = parser.parse( ldifReader );

            Writer logWriter;
            if ( this.logFile != null )
            {
                logWriter = new BufferedWriter( new FileWriter( this.logFile ) );
View Full Code Here

        monitor.worked( 1 );

        try
        {
            Reader ldifReader = new StringReader( this.ldif );
            LdifParser parser = new LdifParser();
            LdifEnumeration enumeration = parser.parse( ldifReader );

            Writer logWriter = new Writer()
            {
                public void close()
                {
View Full Code Here

                return;
            }

            try
            {
                LdifParser parser = new LdifParser();
                IDocument document = viewer.getDocument();
                ITypedRegion partition = document.getPartition( cursorPos );

                // now use position relative to partition
                int offset = partition.getOffset();
                int relativePos = cursorPos - offset;

                // parse partition
                String s = document.get( partition.getOffset(), partition.getLength() );
                LdifFile model = parser.parse( s );
                LdifContainer container = LdifFile.getContainer( model, relativePos );
                if ( container != null )
                {
                    LdifPart part = LdifFile.getContainerContent( container, relativePos );
View Full Code Here

                    {
                        StringBuffer sb = new StringBuffer();
                        new CopyEntryAsLdifAction( CopyEntryAsLdifAction.MODE_INCLUDE_OPERATIONAL_ATTRIBUTES )
                            .serialializeEntries( new IEntry[]
                                { ( IEntry ) o }, sb );
                        LdifFile model = new LdifParser().parse( sb.toString() );
                        treeViewer.setInput( model );
                        treeViewer.expandToLevel( 2 );
                    }
                }
            }
View Full Code Here

                    {
                        int size = readIn.readInt();
                        byte[] bytes = new byte[size];
                        readIn.read( bytes );
                        String ldif = new String( bytes );
                        LdifFile model = new LdifParser().parse( ldif );
                        LdifRecord[] ldifRecords = model.getRecords();
                        records = new LdifContentRecord[ldifRecords.length];
                        for ( int i = 0; i < ldifRecords.length; i++ )
                        {
                            if ( ldifRecords[i] instanceof LdifContentRecord )
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.ldif.parser.LdifParser

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.