Examples of SchemaParser


Examples of org.apache.directory.ldapstudio.browser.core.model.schema.parser.SchemaParser

            LdifAttrValLine line = lines[i];
            String attributeName = line.getUnfoldedAttributeDescription();
            String value = line.getValueAsString();

            SchemaLexer lexer = new SchemaLexer( new StringReader( value ) );
            SchemaParser parser = new SchemaParser( lexer );

            try
            {
                if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES ) )
                {
                    ObjectClassDescription ocd = parser.objectClassDescription();
                    ocd.setSchema( this );
                    ocd.setLine( line );
                    this.addObjectClassDescription( ocd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES ) )
                {
                    AttributeTypeDescription atd = parser.attributeTypeDescription();
                    atd.setSchema( this );
                    atd.setLine( line );
                    this.addAttributeTypeDescription( atd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES ) )
                {
                    LdapSyntaxDescription lsd = parser.syntaxDescription();
                    lsd.setSchema( this );
                    lsd.setLine( line );
                    this.addLdapSyntaxDescription( lsd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES ) )
                {
                    MatchingRuleDescription mrd = parser.matchingRuleDescription();
                    mrd.setSchema( this );
                    mrd.setLine( line );
                    this.addMatchingRuleDescription( mrd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE ) )
                {
                    MatchingRuleUseDescription mrud = parser.matchingRuleUseDescription();
                    mrud.setSchema( this );
                    mrud.setLine( line );
                    this.addMatchingRuleUseDescription( mrud );
                }
                else if ( attributeName.equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) )
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.schema.parser.SchemaParser

            LdifAttrValLine line = lines[i];
            String attributeName = line.getUnfoldedAttributeDescription();
            String value = line.getValueAsString();

            SchemaLexer lexer = new SchemaLexer( new StringReader( value ) );
            SchemaParser parser = new SchemaParser( lexer );

            try
            {
                if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES ) )
                {
                    ObjectClassDescription ocd = parser.objectClassDescription();
                    ocd.setSchema( this );
                    ocd.setLine( line );
                    this.addObjectClassDescription( ocd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES ) )
                {
                    AttributeTypeDescription atd = parser.attributeTypeDescription();
                    atd.setSchema( this );
                    atd.setLine( line );
                    this.addAttributeTypeDescription( atd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES ) )
                {
                    LdapSyntaxDescription lsd = parser.syntaxDescription();
                    lsd.setSchema( this );
                    lsd.setLine( line );
                    this.addLdapSyntaxDescription( lsd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES ) )
                {
                    MatchingRuleDescription mrd = parser.matchingRuleDescription();
                    mrd.setSchema( this );
                    mrd.setLine( line );
                    this.addMatchingRuleDescription( mrd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE ) )
                {
                    MatchingRuleUseDescription mrud = parser.matchingRuleUseDescription();
                    mrud.setSchema( this );
                    mrud.setLine( line );
                    this.addMatchingRuleUseDescription( mrud );
                }
                else if ( attributeName.equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) )
View Full Code Here

Examples of org.apache.directory.ldapstudio.schemas.io.SchemaParser

     * @throws IOException if error opening the .schema file
     *
     */
    public void read() throws IOException, ParseException
    {
        SchemaParser parser = null;
        parser = SchemaParser.parserFromURL( url );

        if ( parser == null )
            throw new FileNotFoundException( "Schema model object: no path or url specified !" ); //$NON-NLS-1$

        parser.parse();

        ObjectClassLiteral[] objectClasses = parser.getObjectClasses();
        AttributeTypeLiteral[] attributeTypes = parser.getAttributeTypes();

        for ( AttributeTypeLiteral literal : attributeTypes )
        {
            AttributeType AT = new AttributeType( literal, this );
            AT.addListener( this );
View Full Code Here

Examples of org.apache.directory.ldapstudio.schemas.io.SchemaParser

     * @throws IOException if error opening the .schema file
     *
     */
    public void read() throws IOException, ParseException
    {
        SchemaParser parser = null;
        parser = SchemaParser.parserFromURL( url );

        if ( parser == null )
            throw new FileNotFoundException( "Schema model object: no path or url specified !" ); //$NON-NLS-1$

        parser.parse();

        ObjectClassLiteral[] objectClasses = parser.getObjectClasses();
        AttributeTypeLiteral[] attributeTypes = parser.getAttributeTypes();

        for ( AttributeTypeLiteral literal : attributeTypes )
        {
            AttributeType AT = new AttributeType( literal, this );
            AT.addListener( this );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.schema.parser.SchemaParser

            LdifAttrValLine line = lines[i];
            String attributeName = line.getUnfoldedAttributeDescription();
            String value = line.getValueAsString();

            SchemaLexer lexer = new SchemaLexer( new StringReader( value ) );
            SchemaParser parser = new SchemaParser( lexer );

            try
            {
                if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES ) )
                {
                    ObjectClassDescription ocd = parser.objectClassDescription();
                    ocd.setSchema( this );
                    ocd.setLine( line );
                    this.addObjectClassDescription( ocd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES ) )
                {
                    AttributeTypeDescription atd = parser.attributeTypeDescription();
                    atd.setSchema( this );
                    atd.setLine( line );
                    this.addAttributeTypeDescription( atd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES ) )
                {
                    LdapSyntaxDescription lsd = parser.syntaxDescription();
                    lsd.setSchema( this );
                    lsd.setLine( line );
                    this.addLdapSyntaxDescription( lsd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES ) )
                {
                    MatchingRuleDescription mrd = parser.matchingRuleDescription();
                    mrd.setSchema( this );
                    mrd.setLine( line );
                    this.addMatchingRuleDescription( mrd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE ) )
                {
                    MatchingRuleUseDescription mrud = parser.matchingRuleUseDescription();
                    mrud.setSchema( this );
                    mrud.setLine( line );
                    this.addMatchingRuleUseDescription( mrud );
                }
                else if ( attributeName.equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.schema.parser.SchemaParser

            LdifAttrValLine line = lines[i];
            String attributeName = line.getUnfoldedAttributeDescription();
            String value = line.getValueAsString();

            SchemaLexer lexer = new SchemaLexer( new StringReader( value ) );
            SchemaParser parser = new SchemaParser( lexer );

            try
            {
                if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_OBJECTCLASSES ) )
                {
                    ObjectClassDescription ocd = parser.objectClassDescription();
                    ocd.setSchema( this );
                    ocd.setLine( line );
                    this.addObjectClassDescription( ocd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_ATTRIBUTETYPES ) )
                {
                    AttributeTypeDescription atd = parser.attributeTypeDescription();
                    atd.setSchema( this );
                    atd.setLine( line );
                    this.addAttributeTypeDescription( atd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_LDAPSYNTAXES ) )
                {
                    LdapSyntaxDescription lsd = parser.syntaxDescription();
                    lsd.setSchema( this );
                    lsd.setLine( line );
                    this.addLdapSyntaxDescription( lsd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULES ) )
                {
                    MatchingRuleDescription mrd = parser.matchingRuleDescription();
                    mrd.setSchema( this );
                    mrd.setLine( line );
                    this.addMatchingRuleDescription( mrd );
                }
                else if ( attributeName.equalsIgnoreCase( Schema.SCHEMA_ATTRIBUTE_MATCHINGRULEUSE ) )
                {
                    MatchingRuleUseDescription mrud = parser.matchingRuleUseDescription();
                    mrud.setSchema( this );
                    mrud.setLine( line );
                    this.addMatchingRuleUseDescription( mrud );
                }
                else if ( attributeName.equalsIgnoreCase( IAttribute.OPERATIONAL_ATTRIBUTE_CREATE_TIMESTAMP ) )
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.SchemaParser

            log.info(_loc.get("revtool-running"));
            SchemaGenerator gen = new SchemaGenerator(conf);
            gen.generateSchemas();
            schema = gen.getSchemaGroup();
        } else {
            SchemaParser parser = new XMLSchemaParser(conf);
            File file;
            for (int i = 0; i < args.length; i++) {
                file = Files.getFile(args[i], loader);
                log.info(_loc.get("revtool-running-file", file));
                parser.parse(file);
            }
            schema = parser.getSchemaGroup();
        }

        // flags
        ReverseMappingTool tool = newInstance(conf);
        tool.setSchemaGroup(schema);
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.SchemaParser

            log.info(_loc.get("revtool-running"));
            SchemaGenerator gen = new SchemaGenerator(conf);
            gen.generateSchemas();
            schema = gen.getSchemaGroup();
        } else {
            SchemaParser parser = new XMLSchemaParser(conf);
            File file;
            for (int i = 0; i < args.length; i++) {
                file = Files.getFile(args[i], loader);
                log.info(_loc.get("revtool-running-file", file));
                parser.parse(file);
            }
            schema = parser.getSchemaGroup();
        }

        // flags
        ReverseMappingTool tool = new ReverseMappingTool(conf);
        tool.setSchemaGroup(schema);
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.SchemaParser

            log.info(_loc.get("revtool-running"));
            SchemaGenerator gen = new SchemaGenerator(conf);
            gen.generateSchemas();
            schema = gen.getSchemaGroup();
        } else {
            SchemaParser parser = new XMLSchemaParser(conf);
            File file;
            for (int i = 0; i < args.length; i++) {
                file = Files.getFile(args[i], loader);
                log.info(_loc.get("revtool-running-file", file));
                parser.parse(file);
            }
            schema = parser.getSchemaGroup();
        }

        // flags
        ReverseMappingTool tool = new ReverseMappingTool(conf);
        tool.setSchemaGroup(schema);
View Full Code Here

Examples of org.apache.openjpa.jdbc.schema.SchemaParser

       
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        ser.serialize(new OutputStreamWriter(out), ser.PRETTY);
        byte[] bytes = out.toByteArray();
       
        SchemaParser parser = new XMLSchemaParser(this.conf);
        parser.parse(new InputStreamReader
                (new ByteArrayInputStream(bytes)), "bytes");
        return parser.getSchemaGroup();
    }
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.