R
-这个访问者的方法的返回类型。利用游客不需要返回的结果
Void
。
P
-这个访问者的方法的附加参数的类型。利用游客不需要一个额外的参数
Void
。
@SupportedSourceVersion(value=RELEASE_8) public class SimpleTypeVisitor8<R,P> extends SimpleTypeVisitor7<R,P>
RELEASE_7
源版本类型的客人。访问相应的
RELEASE_8
和早期的语言构建的呼叫
defaultAction
方法,通过他们的论点,
defaultAction
的相应参数。
这类方法可以被重写受一般合同。注:标注方法在具体的子类与@Override
将有助于确保方法重写的打算。
警告:该类实现的接口的TypeVisitor
可能方法添加到它在未来适应新的,未知的,语言结构增加了java编程语言的未来版本™。因此,方法的名字开始与"visit"
可能是未来这类添加;避免不兼容类扩展这个类不能声明任何实例方法的名字开始与"visit"
。
当这样一个新的访问方法的补充,在这类的默认实现将调用visitUnknown
方法。一个新的简单类型的访问者类也将被引入到对应的新的语言水平,这名游客将有不同的默认行为的访问方法的问题。当新的客人介绍,全部或部分游客可能被弃用。
注意:添加在访问类的一个新的访问方法的默认实现会发生而不是添加一个默认的方法直接在访客界面由于java SE 8语言特征不能从这个版本需要运行在java SE 7实现使用这个版本的API。那只需要运行在java SE 8和以后可能会利用这种情况的默认方法的API的未来版本。
SimpleTypeVisitor6
,
SimpleTypeVisitor7
DEFAULT_VALUE
Modifier | Constructor and Description |
---|---|
protected |
SimpleTypeVisitor8()
对于具体的子类的构造函数;采用
null 为默认值。
|
protected |
SimpleTypeVisitor8(R defaultValue)
用于具体子类的构造函数;使用默认值的参数。
|
Modifier and Type | Method and Description |
---|---|
R |
visitIntersection(IntersectionType t, P p)
这
IntersectionType 实施访问调用
defaultAction 。
|
visitUnion
defaultAction, visitArray, visitDeclared, visitError, visitExecutable, visitNoType, visitNull, visitPrimitive, visitTypeVariable, visitWildcard
visit, visit, visitUnknown
protected SimpleTypeVisitor8()
null
为默认值。
protected SimpleTypeVisitor8(R defaultValue)
defaultValue
-分配给
SimpleTypeVisitor6.DEFAULT_VALUE
价值
public R visitIntersection(IntersectionType t, P p)
IntersectionType
实施访问调用
defaultAction
。
visitIntersection
接口
TypeVisitor<R,P>
visitIntersection
方法重写,继承类
AbstractTypeVisitor6<R,P>
t
型访问
p
-客人指定的参数
defaultAction
结果
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.