本文整理汇总了Java中com.sun.tools.javac.code.Symbol.TypeSymbol方法的典型用法代码示例。如果您正苦于以下问题:Java Symbol.TypeSymbol方法的具体用法?Java Symbol.TypeSymbol怎么用?Java Symbol.TypeSymbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.code.Symbol
的用法示例。
在下文中一共展示了Symbol.TypeSymbol方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRealType
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
private Symbol.TypeSymbol getRealType(Type type) {
//List<String> to return String
if (type.allparams().size()>0)
return getRealType(type.allparams().get(0));
if (type instanceof Type.TypeVar){
return daoEnv.getRealTypeByTypeParameter(type);
}
return type.tsym;
}
示例2: getFields
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
private List<String> getFields(Symbol.TypeSymbol type) {
String typeStr = type.toString();
if (!fieldsMap.containsKey(typeStr)) {
List<Symbol.VarSymbol> varSymbols = getMember(Symbol.VarSymbol.class, ElementKind.FIELD, type);
fieldsMap.put(typeStr, varSymbols.stream().filter(s->!s.isStatic()).map(Symbol.VarSymbol::toString).collect(Collectors.toList()));
}
return fieldsMap.get(typeStr);
}
示例3: getBinaryName
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
/**
* Returns a binary name of a type.
* @param element for which the binary name should be returned
* @return the binary name, see Java Language Specification 13.1
* @throws IllegalArgumentException when the element is not a javac element
*/
public static String getBinaryName (TypeElement element) throws IllegalArgumentException {
if (element instanceof Symbol.TypeSymbol) {
return ((Symbol.TypeSymbol)element).flatName().toString();
}
else {
throw new IllegalArgumentException ();
}
}
示例4: verifyExtensionInterfaces
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
private void verifyExtensionInterfaces( JCTree.JCClassDecl tree )
{
if( !hasAnnotation( tree.getModifiers().getAnnotations(), Extension.class ) )
{
return;
}
outer:
for( JCExpression iface: tree.getImplementsClause() )
{
final Symbol.TypeSymbol ifaceSym = iface.type.tsym;
if( ifaceSym == _tp.getSymtab().objectType.tsym )
{
continue;
}
for( Attribute.Compound anno: ifaceSym.getAnnotationMirrors() )
{
if( anno.type.toString().equals( Structural.class.getName() ) )
{
continue outer;
}
}
// extension interfaces must be structural
_tp.report( iface, Diagnostic.Kind.ERROR, ExtIssueMsg.MSG_ONLY_STRUCTURAL_INTERFACE_ALLOWED_HERE.get( iface.toString() ) );
}
}
示例5: getReturnType
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
public Symbol.TypeSymbol getReturnType() {
return returnType;
}
示例6: getFirstParamType
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
public Symbol.TypeSymbol getFirstParamType(){
return getRealType(params.get(0).asType());
}
示例7: getRealTypeByTypeParameter
import com.sun.tools.javac.code.Symbol; //导入方法依赖的package包/类
public Symbol.TypeSymbol getRealTypeByTypeParameter(Type type) {
if (typeParameter == null) throw new RuntimeException("未从类定义中获取类型变量实例,请联系技术支持");
return typeParameter.tsym;
}