com.sun.xml.internal.rngom.parse.Context Java Examples

The following examples show how to use com.sun.xml.internal.rngom.parse.Context. 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: SchemaBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example #2
Source File: SchemaBuilderImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example #3
Source File: SchemaBuilderImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example #4
Source File: SchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location loc, Annotations anno)
        throws BuildException {
    try {
        dtb.addParameter(name, value, new ValidationContextImpl(context, ns));
    } catch (DatatypeException e) {
        String detail = e.getMessage();
        int pos = e.getIndex();
        String displayedParam;
        if (pos == DatatypeException.UNKNOWN) {
            displayedParam = null;
        } else {
            displayedParam = displayParam(value, pos);
        }
        if (displayedParam != null) {
            if (detail != null) {
                error("invalid_param_detail_display", detail, displayedParam, (Locator) loc);
            } else {
                error("invalid_param_display", displayedParam, (Locator) loc);
            }
        } else if (detail != null) {
            error("invalid_param_detail", detail, (Locator) loc);
        } else {
            error("invalid_param", (Locator) loc);
        }
    }
}
 
Example #5
Source File: SchemaBuilderHost.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makeValue(String datatypeLibrary, String type,
    String value, Context c, String ns, Location _loc, Annotations _anno)
    throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    return new ParsedPatternHost(
        lhs.makeValue(datatypeLibrary,type,value,c,ns,loc.lhs,anno.lhs),
        rhs.makeValue(datatypeLibrary,type,value,c,ns,loc.rhs,anno.rhs));
}
 
Example #6
Source File: DDataPattern.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Param(String name, String value, Context context, String ns, Location loc, Annotation anno) {
    this.name = name;
    this.value = value;
    this.context = context;
    this.ns = ns;
    this.loc = loc;
    this.anno = anno;
}
 
Example #7
Source File: DataPatternBuilderHost.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location _loc, Annotations _anno) throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    lhs.addParam( name, value, context, ns, loc.lhs, anno.lhs );
    rhs.addParam( name, value, context, ns, loc.rhs, anno.rhs );
}
 
Example #8
Source File: SchemaBuilderHost.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makeValue(String datatypeLibrary, String type,
    String value, Context c, String ns, Location _loc, Annotations _anno)
    throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    return new ParsedPatternHost(
        lhs.makeValue(datatypeLibrary,type,value,c,ns,loc.lhs,anno.lhs),
        rhs.makeValue(datatypeLibrary,type,value,c,ns,loc.rhs,anno.rhs));
}
 
Example #9
Source File: DSchemaBuilderImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, CommentListImpl comments, Context context) {
    String qname;
    if(prefix==null)
        qname = localName;
    else
        qname = prefix+':'+localName;
    return new ElementAnnotationBuilderImpl(dom.createElementNS(ns,qname));
}
 
Example #10
Source File: DValuePattern.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public DValuePattern(String datatypeLibrary, String type, String value, Context context, String ns) {
    this.datatypeLibrary = datatypeLibrary;
    this.type = type;
    this.value = value;
    this.context = context;
    this.ns = ns;
}
 
Example #11
Source File: SchemaBuilderHost.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Annotations makeAnnotations(CommentList _comments, Context context) {
    CommentListHost comments = (CommentListHost) _comments;
    Annotations l = lhs.makeAnnotations((comments!=null)?comments.lhs:null, context);
    Annotations r = rhs.makeAnnotations((comments!=null)?comments.rhs:null, context);
    if(l==null || r==null)
        throw new IllegalArgumentException("annotations cannot be null");
    return new AnnotationsHost(l,r);
}
 
Example #12
Source File: DataPatternBuilderHost.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location _loc, Annotations _anno) throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    lhs.addParam( name, value, context, ns, loc.lhs, anno.lhs );
    rhs.addParam( name, value, context, ns, loc.rhs, anno.rhs );
}
 
Example #13
Source File: DValuePattern.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public DValuePattern(String datatypeLibrary, String type, String value, Context context, String ns) {
    this.datatypeLibrary = datatypeLibrary;
    this.type = type;
    this.value = value;
    this.context = context;
    this.ns = ns;
}
 
Example #14
Source File: SchemaBuilderHost.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns,
    String localName, String prefix, Location _loc, CommentList _comments,
    Context context) {
    LocationHost loc = cast(_loc);
    CommentListHost comments = (CommentListHost) _comments;

    return new ElementAnnotationBuilderHost(
        lhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.lhs, comments==null?null:comments.lhs, context),
        rhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.rhs, comments==null?null:comments.rhs, context) );
}
 
Example #15
Source File: DSchemaBuilderImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, CommentListImpl comments, Context context) {
    String qname;
    if(prefix==null)
        qname = localName;
    else
        qname = prefix+':'+localName;
    return new ElementAnnotationBuilderImpl(dom.createElementNS(ns,qname));
}
 
Example #16
Source File: DDataPattern.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Param(String name, String value, Context context, String ns, Location loc, Annotation anno) {
    this.name = name;
    this.value = value;
    this.context = context;
    this.ns = ns;
    this.loc = loc;
    this.anno = anno;
}
 
Example #17
Source File: DValuePattern.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public DValuePattern(String datatypeLibrary, String type, String value, Context context, String ns) {
    this.datatypeLibrary = datatypeLibrary;
    this.type = type;
    this.value = value;
    this.context = context;
    this.ns = ns;
}
 
Example #18
Source File: DSchemaBuilderImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, CommentListImpl comments, Context context) {
    String qname;
    if(prefix==null)
        qname = localName;
    else
        qname = prefix+':'+localName;
    return new ElementAnnotationBuilderImpl(dom.createElementNS(ns,qname));
}
 
Example #19
Source File: DValuePattern.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public DValuePattern(String datatypeLibrary, String type, String value, Context context, String ns) {
    this.datatypeLibrary = datatypeLibrary;
    this.type = type;
    this.value = value;
    this.context = context;
    this.ns = ns;
}
 
Example #20
Source File: DValuePattern.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public DValuePattern(String datatypeLibrary, String type, String value, Context context, String ns) {
    this.datatypeLibrary = datatypeLibrary;
    this.type = type;
    this.value = value;
    this.context = context;
    this.ns = ns;
}
 
Example #21
Source File: DDataPattern.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Param(String name, String value, Context context, String ns, Location loc, Annotation anno) {
    this.name = name;
    this.value = value;
    this.context = context;
    this.ns = ns;
    this.loc = loc;
    this.anno = anno;
}
 
Example #22
Source File: DSchemaBuilderImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns, String localName, String prefix, LocatorImpl loc, CommentListImpl comments, Context context) {
    String qname;
    if(prefix==null)
        qname = localName;
    else
        qname = prefix+':'+localName;
    return new ElementAnnotationBuilderImpl(dom.createElementNS(ns,qname));
}
 
Example #23
Source File: SchemaBuilderHost.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ParsedPattern makeValue(String datatypeLibrary, String type,
    String value, Context c, String ns, Location _loc, Annotations _anno)
    throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    return new ParsedPatternHost(
        lhs.makeValue(datatypeLibrary,type,value,c,ns,loc.lhs,anno.lhs),
        rhs.makeValue(datatypeLibrary,type,value,c,ns,loc.rhs,anno.rhs));
}
 
Example #24
Source File: SchemaBuilderHost.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns,
    String localName, String prefix, Location _loc, CommentList _comments,
    Context context) {
    LocationHost loc = cast(_loc);
    CommentListHost comments = (CommentListHost) _comments;

    return new ElementAnnotationBuilderHost(
        lhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.lhs, comments==null?null:comments.lhs, context),
        rhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.rhs, comments==null?null:comments.rhs, context) );
}
 
Example #25
Source File: DataPatternBuilderHost.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location _loc, Annotations _anno) throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    lhs.addParam( name, value, context, ns, loc.lhs, anno.lhs );
    rhs.addParam( name, value, context, ns, loc.rhs, anno.rhs );
}
 
Example #26
Source File: DDataPattern.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Param(String name, String value, Context context, String ns, Location loc, Annotation anno) {
    this.name = name;
    this.value = value;
    this.context = context;
    this.ns = ns;
    this.loc = loc;
    this.anno = anno;
}
 
Example #27
Source File: SchemaBuilderHost.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Annotations makeAnnotations(CommentList _comments, Context context) {
    CommentListHost comments = (CommentListHost) _comments;
    Annotations l = lhs.makeAnnotations((comments!=null)?comments.lhs:null, context);
    Annotations r = rhs.makeAnnotations((comments!=null)?comments.rhs:null, context);
    if(l==null || r==null)
        throw new IllegalArgumentException("annotations cannot be null");
    return new AnnotationsHost(l,r);
}
 
Example #28
Source File: SchemaBuilderHost.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public ElementAnnotationBuilder makeElementAnnotationBuilder(String ns,
    String localName, String prefix, Location _loc, CommentList _comments,
    Context context) {
    LocationHost loc = cast(_loc);
    CommentListHost comments = (CommentListHost) _comments;

    return new ElementAnnotationBuilderHost(
        lhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.lhs, comments==null?null:comments.lhs, context),
        rhs.makeElementAnnotationBuilder(ns, localName, prefix, loc.rhs, comments==null?null:comments.rhs, context) );
}
 
Example #29
Source File: SchemaBuilderHost.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Annotations makeAnnotations(CommentList _comments, Context context) {
    CommentListHost comments = (CommentListHost) _comments;
    Annotations l = lhs.makeAnnotations((comments!=null)?comments.lhs:null, context);
    Annotations r = rhs.makeAnnotations((comments!=null)?comments.rhs:null, context);
    if(l==null || r==null)
        throw new IllegalArgumentException("annotations cannot be null");
    return new AnnotationsHost(l,r);
}
 
Example #30
Source File: DataPatternBuilderHost.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void addParam(String name, String value, Context context, String ns, Location _loc, Annotations _anno) throws BuildException {
    LocationHost loc = cast(_loc);
    AnnotationsHost anno = cast(_anno);

    lhs.addParam( name, value, context, ns, loc.lhs, anno.lhs );
    rhs.addParam( name, value, context, ns, loc.rhs, anno.rhs );
}