Java Compiler Compiler tm (JavaCC tm) is the most popular parser generator for use with Java tm applications. A parser generator is a tool that reads a grammar specification and converts it to a Java program that can recognize matches to the grammar. In addition to the parser generator itself, JavaCC provides other standard capabilities related to parser generation such as tree building (via a tool called JJTree included with JavaCC), actions, debugging, etc.
下蝲后的使用方式QMac&LinuxQ:(x)echo 'java -cp /path/to/javacc.jar $(basename $0) "$@"' > javacc
chmod 755 javacc
ln -s javacc jjtree
ln -s javacc jjdoc
Administrator NLR8ZC-855550-68587856625436280
yddcode Serial: lLR8ZC-855550-6858795439845000
最q对Schema 验证研究?jin)一下, 代码如下Q?br /> 所需JAR包需要自׃载(版本一定要正确Q?/p>
public class SchemaValidation {
public static void main(String[] args) {
validate();
}
public static void validate() {
try {
SchemaValidation demo = new SchemaValidation();
// Give the xml(标准化越来越q了(jin)) and schema name
InputStream xml(标准化越来越q了(jin))String = demo.getClass().getResourceAsStream("GBAInit.xml(标准化越来越q了(jin))");
InputStream schemaStr = demo.getClass().getResourceAsStream("GBAInitSchema.xsd");
SAXReader reader = createSAXReader(schemaStr);
System.out.println("XSD parse successfully !");
Document document = reader.read(xml(标准化越来越q了(jin))String);
System.out.println("Successfully validation .. . ");
} catch (DocumentException e) {
System.out.println("Exception occurred: " + e);
Throwable nestedException = e.getNestedException();
if (nestedException != null) {
System.out.println("NestedException: " + nestedException);
nestedException.printStackTrace();
} else {
e.printStackTrace();
}
} catch (Throwable t) {
System.out.println("Exception occurred: " + t);
t.printStackTrace();
}
}
/** Registers the Verifier with the SAXReader */
protected SAXReader createSAXReader(InputStream schemaURI) throws Exception {
System.out.println("Loaded schema document: " + schemaURI);
// use autodetection of schemas
VerifierFactory factory = new com.sun.msv.verifier.jarv.TheFactoryImpl();
Schema schema = factory.compileSchema(schemaURI);
Verifier verifier = schema.newVerifier();
verifier.setErrorHandler(new ErrorHandler() {
public void error(SAXParseException e) {
System.out.println("ERROR: " + e);
}
public void fatalError(SAXParseException e) {
System.out.println("FATAL: " + e);
}
public void warning(SAXParseException e) {
System.out.println("WARNING: " + e);
}
});
// now install the verifying filter
VerifierFilter filter = verifier.getVerifierFilter();
SAXReader reader = new SAXReader();
reader.setxml(标准化越来越q了(jin))Filter(filter);
return reader;
}
本文来源?WEB开发网 原文链接Qhttp://www.cncms.com.cn/ajax/9977.htm
Intent应该是Android中特有的东西。你可以在Intent中指?span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E7%A8%8B%E5%BA%8F">E序要执行的动作Q比如:(x)view,edit,dialQ,以及(qing)E序执行到该动作时所需要的资料。都指定好后Q只要调用startActivity()QAndroidpȝ?x)自动寻找最W合你指定要求的应用E序Qƈ执行该程序?br />
下面列出几种Intent的用?br /> 昄|页:
调用拨号E序
调用发?span class="t_tag" onclick="tagshow(event)" href="tag.php?name=%E7%9F%AD%E4%BF%A1">短信的程?
|
title(blank:false)Q表C字段不可为空
2、在message属性中Q定义该字段为空时候的提示Q格式是领域包名.领域模型cdU?属性名U?限制属性名U?提示信息
例:(x)cn.tigertian.grails.domain.News.title.blank=请填写标?br />
3、在面上加入如下代码:(x)
Caused by: javax.faces.convert.ConverterException: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:91)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:630)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:91)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
... 110 more
Caused by: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:87)
... 113 more
后来在国外网站上面找C(jin)问题所在:(x)
Hello,
the problem still exists in MyFaces Core 1.2.6.
I have a selectOneMenu with a value binding to a boolean property.
In the boolean converter the ClassCastException still occurs.
...
Caused by: javax.faces.convert.ConverterException: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:91)
at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:630)
at org.apache.myfaces.shared_impl.renderkit.html.HtmlRadioRendererBase.encodeEnd(HtmlRadioRendererBase.java:91)
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
... 110 more
Caused by: java.lang.ClassCastException: org.apache.myfaces.shared_impl.renderkit.RendererUtils$1
cannot be cast to java.lang.Boolean
at javax.faces.convert.BooleanConverter.getAsString(BooleanConverter.java:87)
... 113 more
In RendererUtils there are some tests that value equals NOTHING. However the equals method
of the NOTHING-Serializable isn't overriden. Therefore it has no effect.
Overriding the equals method as in the patch of paul works.
有些东西没有实现Q导致了(jin)q个问题。这个可能需要你自己单实C下源文g然后~译成库文g?jin),感觉ȝ?ch)换成了(jin)SelectOneMenu?jin)?br /> 后面有时间再看了(jin)