Examples of Schema


Examples of com.hp.gloze.www_w3_org_2001_XMLSchema.schema

 
  public static schema loadSchema(URL url) throws Exception {
    // look up a schema by its URL
    // dump it if it gets too large
    if (schemaCache.size()>SCHEMA_CACHE_MAX) clearCache();
    schema xs = GlozeURL.schemaCache.get(url);
    if (!GlozeURL.schemaCache.containsKey(url)) {
      // otherwise parse the input
      if ("true".equals(System.getProperty("gloze.verbose"))) logger.info("reading " + url);
      Document doc = XMLUtility.read(input(url, null));
      if (doc!=null) {
        xs = (schema) XMLBean.newShallowInstance(doc.getDocumentElement());
        // add to the cache before continuing with imports
        GlozeURL.schemaCache.put(url, xs);
        // required to break loops in mutually imported schema
        xs.set_url(url);
        xs.set_location(parent(url));
        xs.populate();
      }
    }
    return xs;
  }
View Full Code Here

Examples of com.impetus.kundera.configure.ClientProperties.DataStore.Schema

        /**
         * @return the replication_factor
         */
        public String getReplication_factor(String schemaName)
        {
            Schema schema = getSchema(schemaName);
            String replication = "1";
            if (schema != null && schema.getSchemaProperties() != null && !schema.getSchemaProperties().isEmpty())
            {
                replication = schema.getSchemaProperties().getProperty(CassandraConstants.REPLICATION_FACTOR);
            }

            if (logger.isInfoEnabled())
            {
                logger.info("Returning replication factor value {}", replication);
View Full Code Here

Examples of com.impetus.kundera.rest.dto.Schema

                emfImpl.getKunderaMetadataInstance().getApplicationMetadata()
                    .getPersistenceUnitMetadata(persistenceUnit);
            String schemaStr = puMetadata.getProperty("kundera.keyspace");

            if (schemaStr != null) {
                Schema schema = new Schema();
                schema.setSchemaName(schemaStr);

               
                MetamodelImpl metamodel = (MetamodelImpl) em.getEntityManagerFactory().getMetamodel();
                Map<String, EntityMetadata> metamodelMap = metamodel.getEntityMetadataMap();

                for (String clazz : metamodelMap.keySet()) {
                    EntityMetadata m = metamodelMap.get(clazz);
                    Table table = new Table();
                    table.setEntityClassName(clazz);
                    table.setTableName(m.getTableName());
                    table.setSimpleEntityClassName(m.getEntityClazz().getSimpleName());

                    schema.addTable(table);
                }
                schemaMetadata.addSchema(schema);
            }
        }
View Full Code Here

Examples of com.laamella.snelxml.generator.xsdreader.Schema

            final ModelTransformer modelTransformer = new ModelTransformer();

            for (String xsd : xsds) {
                log.info("Processing: {}", xsd);
                final XSModel xsModel = schemaLoader.loadURI(new File(schemaDirectory, xsd).toURI().toString());
                Schema schema = xsdReader.readXsd(xsd, xsModel);
                final Model model = modelTransformer.transform(schema);
                readerGenerator.generate(model);
                gatherMapperGenerator.generate(model);
                immutableModelGenerator.generate(model);
                immutableModelMapperGenerator.generate(model);
View Full Code Here

Examples of com.netflix.jmeter.utils.Schema

        for (String host : endpoints)
        {
            try
            {
                CClient c = CClient.getClient(host, port);
                new Schema(c).createKeyspace();
                c.socket.close();
                break;
            }
            catch (Exception unlucky)
            {
View Full Code Here

Examples of com.redspr.redquerybuilder.core.shared.meta.Schema

    protected Session getSession() {
        return createSession(null);
    }

    protected Session createSession(Configuration config) {
        Schema schema = new Schema();
        Database database = new Database(schema);

        Type stringType = new Type("VARCHAR");
        stringType.setOperators(new Operator[] {
                new Operator("="),
                new Operator("IS NULL", Cardinality.ZERO),
                new Operator("LIKE"), new Operator("CUSTOM_OP") });

        // XXX IN done better as hint or style?
        Type refType = new Type("REFS");
        refType.setEditor(new Editor.SelectEditor());
        refType.setOperators(new Operator[]{
                new Operator("IN", Cardinality.MULTI),
                new Operator("NOT IN", Cardinality.MULTI)});

        Type suggestType = new Type("SUGGEST");
        suggestType.setEditor(new SuggestEditor());
        suggestType.setOperators(new Operator[]{new Operator("=")});

        Type singleRefType = new Type("REF");
        singleRefType.setEditor(new Editor.SelectEditor());
        singleRefType.setOperators(new Operator[] {
                new Operator("="),
                new Operator("IS NULL", Cardinality.ZERO),
                new Operator("CUSTOM_OP", Cardinality.ONE)});

        Type dateType = new Type("DATE");
        dateType.setEditor(new Editor.DateEditor());
        Type[] types = new Type[]{stringType, dateType, refType, singleRefType};
        database.setTypes(types);

        Table person = new Table("PERSON"); // XXX want case sensitivity?
        Column personId = new Column("id", stringType);
        person.add(personId);
        person.add(new Column("sex", singleRefType));
        person.add(new Column("owner", stringType));
        person.add(new Column("category", refType));
        person.add(new Column("category2", refType));
        person.add(new Column("county", suggestType));
        schema.add(person);

        {
            Table log = new Table("Log");
            log.add(new Column("id", stringType));
            log.add(new Column("date", dateType));
            Column pc = new Column("parent", stringType);
            ConstraintReferential fk = new ConstraintReferential("parentfk",
                    log);
            fk.setRefTable(person);
            fk.setColumns(new Column[] {pc });
            fk.setRefColumns(new Column[] {personId });
            log.add(fk);
            log.add(pc);

            schema.add(log);
        }

        {
            Table order = new Table("Order");
            order.add(new Column("date", dateType));
            Column pc = new Column("parent", stringType);
            ConstraintReferential fk = new ConstraintReferential("orderparentfk",
                    order);
            fk.setRefTable(person);
            fk.setColumns(new Column[] {pc });
            fk.setRefColumns(new Column[] {personId });
            order.add(fk);
            order.add(pc);

            schema.add(order);
        }

        if (config == null) {
            config = createSimpleConfig();
        }
View Full Code Here

Examples of com.stratio.cassandra.index.schema.Schema

    public void testPhraseQuery()
    {

        Map<String, ColumnMapper<?>> map = new HashMap<>();
        map.put("name", new ColumnMapperBoolean());
        Schema mappers = new Schema(EnglishAnalyzer.class.getName(), map);

        List<String> values = new ArrayList<>();
        values.add("hola");
        values.add("adios");
View Full Code Here

Examples of com.sun.xml.bind.v2.schemagen.xmlschema.Schema

         * @param systemIds
         *      System IDs of the other schema documents. "" indicates 'implied'.
         */
        private void writeTo(Result result, Map<Namespace,String> systemIds) throws IOException {
            try {
                Schema schema = TXW.create(Schema.class,ResultFactory.createSerializer(result));

                // additional namespace declarations to be made.
                Map<String, String> xmlNs = types.getXmlNs(uri);

                for (Map.Entry<String, String> e : xmlNs.entrySet()) {
                    schema._namespace(e.getValue(),e.getKey());
                }

                if(useSwaRef)
                    schema._namespace(WellKnownNamespace.SWA_URI,"swaRef");

                if(useMimeNs)
                    schema._namespace(WellKnownNamespace.XML_MIME_URI,"xmime");

                attributeFormDefault = Form.get(types.getAttributeFormDefault(uri));
                attributeFormDefault.declare("attributeFormDefault",schema);

                elementFormDefault = Form.get(types.getElementFormDefault(uri));
                // TODO: if elementFormDefault is UNSET, figure out the right default value to use
                elementFormDefault.declare("elementFormDefault",schema);


                // declare XML Schema namespace to be xs, but allow the user to override it.
                // if 'xs' is used for other things, we'll just let TXW assign a random prefix
                if(!xmlNs.containsValue(WellKnownNamespace.XML_SCHEMA)
                && !xmlNs.containsKey("xs"))
                    schema._namespace(WellKnownNamespace.XML_SCHEMA,"xs");
                schema.version("1.0");

                if(uri.length()!=0)
                    schema.targetNamespace(uri);

                // declare prefixes for them at this level, so that we can avoid redundant
                // namespace declarations
                for (Namespace ns : depends) {
                    schema._namespace(ns.uri);
                }

                if(selfReference && uri.length()!=0) {
                    // use common 'tns' prefix for the own namespace
                    // if self-reference is needed
                    schema._namespace(uri,"tns");
                }

                schema._pcdata(newline);

                // refer to other schemas
                for( Namespace n : depends ) {
                    Import imp = schema._import();
                    if(n.uri.length()!=0)
                        imp.namespace(n.uri);
                    String refSystemId = systemIds.get(n);
                    if(refSystemId!=null && !refSystemId.equals("")) {
                        // "" means implied. null if the SchemaOutputResolver said "don't generate!"
                        imp.schemaLocation(relativize(refSystemId,result.getSystemId()));
                    }
                    schema._pcdata(newline);
                }
                if(useSwaRef) {
                    schema._import().namespace(WellKnownNamespace.SWA_URI).schemaLocation("http://ws-i.org/profiles/basic/1.1/swaref.xsd");
                }
                if(useMimeNs) {
                    schema._import().namespace(WellKnownNamespace.XML_MIME_URI).schemaLocation("http://www.w3.org/2005/05/xmlmime");
                }

                // then write each component
                for (Map.Entry<String,ElementDeclaration> e : elementDecls.entrySet()) {
                    e.getValue().writeTo(e.getKey(),schema);
                    schema._pcdata(newline);
                }
                for (ClassInfo<T, C> c : classes) {
                    if (c.getTypeName()==null) {
                        // don't generate anything if it's an anonymous type
                        continue;
                    }
                    if(uri.equals(c.getTypeName().getNamespaceURI()))
                        writeClass(c, schema);
                    schema._pcdata(newline);
                }
                for (EnumLeafInfo<T, C> e : enums) {
                    if (e.getTypeName()==null) {
                        // don't generate anything if it's an anonymous type
                        continue;
                    }
                    if(uri.equals(e.getTypeName().getNamespaceURI()))
                        writeEnum(e,schema);
                    schema._pcdata(newline);
                }
                for (ArrayInfo<T, C> a : arrays) {
                    writeArray(a,schema);
                    schema._pcdata(newline);
                }
                for (Map.Entry<String,AttributePropertyInfo<T,C>> e : attributeDecls.entrySet()) {
                    TopLevelAttribute a = schema.attribute();
                    a.name(e.getKey());
                    if(e.getValue()==null)
                        writeTypeRef(a,stringType,"type");
                    else
                        writeAttributeTypeRef(e.getValue(),a);
                    schema._pcdata(newline);
                }

                // close the schema
                schema.commit();
            } catch( TxwException e ) {
                logger.log(Level.INFO,e.getMessage(),e);
                throw new IOException(e.getMessage());
            }
        }
View Full Code Here

Examples of com.sun.xml.internal.bind.v2.schemagen.xmlschema.Schema

         * @param systemIds
         *      System IDs of the other schema documents. "" indicates 'implied'.
         */
        private void writeTo(Result result, Map<Namespace,String> systemIds) throws IOException {
            try {
                Schema schema = TXW.create(Schema.class,ResultFactory.createSerializer(result));

                // additional namespace declarations to be made.
                Map<String, String> xmlNs = types.getXmlNs(uri);

                for (Map.Entry<String, String> e : xmlNs.entrySet()) {
                    schema._namespace(e.getValue(),e.getKey());
                }

                if(useSwaRef)
                    schema._namespace(WellKnownNamespace.SWA_URI,"swaRef");

                attributeFormDefault = Form.get(types.getAttributeFormDefault(uri));
                attributeFormDefault.declare("attributeFormDefault",schema);

                elementFormDefault = Form.get(types.getElementFormDefault(uri));
                // TODO: if elementFormDefault is UNSET, figure out the right default value to use
                elementFormDefault.declare("elementFormDefault",schema);


                // declare XML Schema namespace to be xs, but allow the user to override it.
                // if 'xs' is used for other things, we'll just let TXW assign a random prefix
                if(!xmlNs.containsValue(WellKnownNamespace.XML_SCHEMA)
                && !xmlNs.containsKey("xs"))
                    schema._namespace(WellKnownNamespace.XML_SCHEMA,"xs");
                schema.version("1.0");

                if(uri.length()!=0)
                    schema.targetNamespace(uri);

                // declare prefixes for them at this level, so that we can avoid redundant
                // namespace declarations
                for (Namespace ns : depends) {
                    schema._namespace(ns.uri);
                }

                if(selfReference && uri.length()!=0) {
                    // use common 'tns' prefix for the own namespace
                    // if self-reference is needed
                    schema._namespace(uri,"tns");
                }

                schema._pcdata(newline);

                // refer to other schemas
                for( Namespace n : depends ) {
                    Import imp = schema._import();
                    if(n.uri.length()!=0)
                        imp.namespace(n.uri);
                    String refSystemId = systemIds.get(n);
                    if(refSystemId!=null && !refSystemId.equals("")) {
                        // "" means implied. null if the SchemaOutputResolver said "don't generate!"
                        imp.schemaLocation(relativize(refSystemId,result.getSystemId()));
                    }
                    schema._pcdata(newline);
                }
                if(useSwaRef) {
                    schema._import().namespace(WellKnownNamespace.SWA_URI).schemaLocation("http://ws-i.org/profiles/basic/1.1/swaref.xsd");
                }

                // then write each component
                for (Map.Entry<String,ElementDeclaration> e : elementDecls.entrySet()) {
                    e.getValue().writeTo(e.getKey(),schema);
                    schema._pcdata(newline);
                }
                for (ClassInfo<T, C> c : classes) {
                    if (c.getTypeName()==null) {
                        // don't generate anything if it's an anonymous type
                        continue;
                    }
                    if(uri.equals(c.getTypeName().getNamespaceURI()))
                        writeClass(c, schema);
                    schema._pcdata(newline);
                }
                for (EnumLeafInfo<T, C> e : enums) {
                    if (e.getTypeName()==null) {
                        // don't generate anything if it's an anonymous type
                        continue;
                    }
                    if(uri.equals(e.getTypeName().getNamespaceURI()))
                        writeEnum(e,schema);
                    schema._pcdata(newline);
                }
                for (ArrayInfo<T, C> a : arrays) {
                    writeArray(a,schema);
                    schema._pcdata(newline);
                }
                for (Map.Entry<String,AttributePropertyInfo<T,C>> e : attributeDecls.entrySet()) {
                    TopLevelAttribute a = schema.attribute();
                    a.name(e.getKey());
                    if(e.getValue()==null)
                        writeTypeRef(a,stringType,"type");
                    else
                        writeAttributeTypeRef(e.getValue(),a);
                    schema._pcdata(newline);
                }

                // close the schema
                schema.commit();
            } catch( TxwException e ) {
                logger.log(Level.INFO,e.getMessage(),e);
                throw new IOException(e.getMessage());
            }
        }
View Full Code Here

Examples of com.sun.xml.internal.xsom.impl.parser.state.Schema

//        System.out.println("parsing "+baseUri);



        try {
            Schema s = new Schema(this,includeMode,expectedNamespace);
            setRootHandler(s);

            try {
                parser.parser.parse(source,this,
                    getErrorHandler(),
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.