Examples of LdifChangeTypeLine


Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifChangeTypeLine

                        this.addStyleRange( presentation, offset + attributeNameLength + valueTypeLength, valueLength,
                            VALUE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifChangeTypeLine )
                    {
                        LdifChangeTypeLine changeTypeLine = ( LdifChangeTypeLine ) line;
                        int changeTypeSpecLength = changeTypeLine.getRawChangeTypeSpec().length();
                        int valueTypeLength = changeTypeLine.getRawValueType().length();
                        int changeTypeLength = changeTypeLine.getRawChangeType().length();
                        this.addStyleRange( presentation, offset, changeTypeSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + changeTypeSpecLength, valueTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );

                        if ( container instanceof LdifChangeAddRecord )
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifChangeTypeLine

        LdifCommentLine[] commentLines = getCommentLines();

        // check record type: to decide the record type we need the next token
        // first check keywords 'control' and 'changetype'
        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                        }
                    }
                }

                changeTypeLine = getChangeTypeLine();
            }

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseAttrValRecord( record );
                }
                else if ( changeTypeLine.isDelete() )
                {
                    record = new LdifChangeDeleteRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeDeleteRecord( record );
                }
                else if ( changeTypeLine.isModify() )
                {
                    record = new LdifChangeModifyRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModifyRecord( ( LdifChangeModifyRecord ) record );
                }
                else if ( changeTypeLine.isModDn() )
                {
                    record = new LdifChangeModDnRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModDnRecord( ( LdifChangeModDnRecord ) record );
                }
                else
                {
                    record = new LdifChangeRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                }
            }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifChangeTypeLine

                {
                    sepToken = this.scanner.matchSep();
                }
            }

            LdifChangeTypeLine ctLine = new LdifChangeTypeLine( changeTypeSpecToken.getOffset(),
                getValueOrNull( changeTypeSpecToken ), getValueOrNull( changeTypeTypeToken ),
                getValueOrNull( changeTypeToken ), getValueOrNull( sepToken ) );

            return ctLine;
        }
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.lines.LdifChangeTypeLine

                        this.addStyleRange( presentation, offset + attributeNameLength + valueTypeLength, valueLength,
                            VALUE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifChangeTypeLine )
                    {
                        LdifChangeTypeLine changeTypeLine = ( LdifChangeTypeLine ) line;
                        int changeTypeSpecLength = changeTypeLine.getRawChangeTypeSpec().length();
                        int valueTypeLength = changeTypeLine.getRawValueType().length();
                        int changeTypeLength = changeTypeLine.getRawChangeType().length();
                        this.addStyleRange( presentation, offset, changeTypeSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + changeTypeSpecLength, valueTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );

                        if ( container instanceof LdifChangeAddRecord )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifChangeTypeLine

                        this.addStyleRange( presentation, offset + attributeNameLength + valueTypeLength, valueLength,
                            VALUE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifChangeTypeLine )
                    {
                        LdifChangeTypeLine changeTypeLine = ( LdifChangeTypeLine ) line;
                        int changeTypeSpecLength = changeTypeLine.getRawChangeTypeSpec().length();
                        int valueTypeLength = changeTypeLine.getRawValueType().length();
                        int changeTypeLength = changeTypeLine.getRawChangeType().length();
                        this.addStyleRange( presentation, offset, changeTypeSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + changeTypeSpecLength, valueTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );

                        if ( container instanceof LdifChangeAddRecord )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifChangeTypeLine

        LdifCommentLine[] commentLines = getCommentLines();

        // check record type: to decide the record type we need the next token
        // first check keywords 'control' and 'changetype'
        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                        }
                    }
                }

                changeTypeLine = getChangeTypeLine();
            }

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseAttrValRecord( record );
                }
                else if ( changeTypeLine.isDelete() )
                {
                    record = new LdifChangeDeleteRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeDeleteRecord( record );
                }
                else if ( changeTypeLine.isModify() )
                {
                    record = new LdifChangeModifyRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModifyRecord( ( LdifChangeModifyRecord ) record );
                }
                else if ( changeTypeLine.isModDn() )
                {
                    record = new LdifChangeModDnRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModDnRecord( ( LdifChangeModDnRecord ) record );
                }
                else
                {
                    record = new LdifChangeRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                }
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifChangeTypeLine

                {
                    sepToken = this.scanner.matchSep();
                }
            }

            LdifChangeTypeLine ctLine = new LdifChangeTypeLine( changeTypeSpecToken.getOffset(),
                getValueOrNull( changeTypeSpecToken ), getValueOrNull( changeTypeTypeToken ),
                getValueOrNull( changeTypeToken ), getValueOrNull( sepToken ) );

            return ctLine;
        }
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.lines.LdifChangeTypeLine

        LdifCommentLine[] commentLines = getCommentLines();

        // check record type: to decide the record type we need the next token
        // first check keywords 'control' and 'changetype'
        LdifControlLine controlLine = getControlLine();
        LdifChangeTypeLine changeTypeLine = getChangeTypeLine();
        if ( controlLine != null || changeTypeLine != null )
        {

            LdifChangeRecord record = null;

            // save all parts before changetype line
            List partList = new ArrayList();
            if ( dnErrorToken != null )
            {
                partList.add( new LdifInvalidPart( dnErrorToken.getOffset(), dnErrorToken.getValue() ) );
            }
            for ( int i = 0; i < commentLines.length; i++ )
            {
                partList.add( commentLines[i] );
            }
            if ( controlLine != null )
            {
                partList.add( controlLine );
                if ( !controlLine.isValid() )
                {
                    LdifToken errorToken = this.cleanupLine();
                    if ( errorToken != null )
                    {
                        partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                    }
                }
            }

            // save comments and controls before changetype line
            while ( changeTypeLine == null && ( commentLines.length > 0 || controlLine != null ) )
            {

                commentLines = getCommentLines();
                for ( int i = 0; i < commentLines.length; i++ )
                {
                    partList.add( commentLines[i] );
                }

                controlLine = getControlLine();
                if ( controlLine != null )
                {
                    partList.add( controlLine );
                    if ( !controlLine.isValid() )
                    {
                        LdifToken errorToken = this.cleanupLine();
                        if ( errorToken != null )
                        {
                            partList.add( new LdifInvalidPart( errorToken.getOffset(), errorToken.getValue() ) );
                        }
                    }
                }

                changeTypeLine = getChangeTypeLine();
            }

            if ( changeTypeLine != null )
            {

                if ( changeTypeLine.isAdd() )
                {
                    record = new LdifChangeAddRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseAttrValRecord( record );
                }
                else if ( changeTypeLine.isDelete() )
                {
                    record = new LdifChangeDeleteRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeDeleteRecord( record );
                }
                else if ( changeTypeLine.isModify() )
                {
                    record = new LdifChangeModifyRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModifyRecord( ( LdifChangeModifyRecord ) record );
                }
                else if ( changeTypeLine.isModDn() )
                {
                    record = new LdifChangeModDnRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                    parseChangeModDnRecord( ( LdifChangeModDnRecord ) record );
                }
                else
                {
                    record = new LdifChangeRecord( dnLine );
                    append( record, partList );
                    record.setChangeType( changeTypeLine );
                    if ( !changeTypeLine.isValid() )
                    {
                        this.cleanupLine( record );
                    }
                }
            }
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.lines.LdifChangeTypeLine

                {
                    sepToken = this.scanner.matchSep();
                }
            }

            LdifChangeTypeLine ctLine = new LdifChangeTypeLine( changeTypeSpecToken.getOffset(),
                getValueOrNull( changeTypeSpecToken ), getValueOrNull( changeTypeTypeToken ),
                getValueOrNull( changeTypeToken ), getValueOrNull( sepToken ) );

            return ctLine;
        }
View Full Code Here

Examples of org.apache.directory.studio.ldifparser.model.lines.LdifChangeTypeLine

                        this.addStyleRange( presentation, offset + attributeNameLength + valueTypeLength, valueLength,
                            VALUE_TEXT_ATTRIBUTE );
                    }
                    else if ( line instanceof LdifChangeTypeLine )
                    {
                        LdifChangeTypeLine changeTypeLine = ( LdifChangeTypeLine ) line;
                        int changeTypeSpecLength = changeTypeLine.getRawChangeTypeSpec().length();
                        int valueTypeLength = changeTypeLine.getRawValueType().length();
                        int changeTypeLength = changeTypeLine.getRawChangeType().length();
                        this.addStyleRange( presentation, offset, changeTypeSpecLength, KEYWORD_TEXT_ATTRIBUTE );
                        this.addStyleRange( presentation, offset + changeTypeSpecLength, valueTypeLength,
                            VALUETYPE_TEXT_ATTRIBUTE );

                        if ( container instanceof LdifChangeAddRecord )
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.