com.sun.xml.internal.rngom.digested.DPattern Java Examples

The following examples show how to use com.sun.xml.internal.rngom.digested.DPattern. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RELAXNGCompiler.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #2
Source File: RELAXNGCompiler.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #3
Source File: RELAXNGCompiler.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #4
Source File: RELAXNGCompiler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #5
Source File: RELAXNGCompiler.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #6
Source File: RELAXNGCompiler.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #7
Source File: RELAXNGCompiler.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #8
Source File: RELAXNGCompiler.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public RELAXNGCompiler(DPattern grammar, JCodeModel codeModel, Options opts) {
    this.grammar = grammar;
    this.opts = opts;
    this.model = new Model(opts,codeModel, NameConverter.smart,opts.classNameAllocator,null);

    datatypes.put("",DatatypeLib.BUILTIN);
    datatypes.put(WellKnownNamespaces.XML_SCHEMA_DATATYPES,DatatypeLib.XMLSCHEMA);

    // find all defines
    DefineFinder deff = new DefineFinder();
    grammar.accept(deff);
    this.defs = deff.defs;

    if(opts.defaultPackage2!=null)
        pkg = codeModel._package(opts.defaultPackage2);
    else
    if(opts.defaultPackage!=null)
        pkg = codeModel._package(opts.defaultPackage);
    else
        pkg = codeModel.rootPackage();
}
 
Example #9
Source File: TypeUseBinder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}
 
Example #10
Source File: ModelLoader.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #11
Source File: TypeUseBinder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}
 
Example #12
Source File: RELAXNGCompiler.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #13
Source File: ModelLoader.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #14
Source File: ModelLoader.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #15
Source File: RELAXNGCompiler.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #16
Source File: RELAXNGCompiler.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #17
Source File: ModelLoader.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #18
Source File: RELAXNGCompiler.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #19
Source File: TypeUseBinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}
 
Example #20
Source File: ModelLoader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #21
Source File: RELAXNGCompiler.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #22
Source File: TypeUseBinder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}
 
Example #23
Source File: RELAXNGCompiler.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #24
Source File: TypeUseBinder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}
 
Example #25
Source File: ModelLoader.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #26
Source File: RELAXNGCompiler.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #27
Source File: TypeUseBinder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}
 
Example #28
Source File: ModelLoader.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Common part between the XML syntax and the compact syntax.
 */
private Model loadRELAXNG(Parseable p) {
    SchemaBuilder sb = new CheckingSchemaBuilder(new DSchemaBuilderImpl(),errorReceiver);

    try {
        DPattern out = (DPattern)p.parse(sb);
        return RELAXNGCompiler.build(out,codeModel,opt);
    } catch (IllegalSchemaException e) {
        errorReceiver.error(e.getMessage(),e);
        return null;
    }
}
 
Example #29
Source File: RELAXNGCompiler.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private void compile() {
    // decide which patterns to map to classes
    promoteElementDefsToClasses();
    promoteTypeSafeEnums();
    // TODO: promote patterns with <jaxb:class> to classes
    // TODO: promote 'type' patterns to classes
    promoteTypePatternsToClasses();

    for (Map.Entry<CClassInfo,DPattern> e : bindQueue.entrySet())
        bindContentModel(e.getKey(),e.getValue());
}
 
Example #30
Source File: TypeUseBinder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private TypeUse onContainer(DContainerPattern p) {
    TypeUse t=null;
    for( DPattern child : p ) {
        TypeUse s = child.accept(this);
        if(t!=null && t!=s)
            return CBuiltinLeafInfo.STRING; // heterogenous
        t = s;
    }
    return t;
}