本文整理汇总了Java中com.intellij.psi.PsiCodeBlock.add方法的典型用法代码示例。如果您正苦于以下问题:Java PsiCodeBlock.add方法的具体用法?Java PsiCodeBlock.add怎么用?Java PsiCodeBlock.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.PsiCodeBlock
的用法示例。
在下文中一共展示了PsiCodeBlock.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
String fieldName = field.getName();
String parameterType = ((PsiClassReferenceType) field.getType()).getParameters()[0].getPresentableText();
// // phones = new ArrayList<>();
// // in.readTypedList(phones, Phone.CREATOR);
// methodBody.add(factory.createStatementFromText(fieldName + " = new ArrayList<" + parameterType + ">();", null));
// methodBody.add(factory.createStatementFromText("in.readTypedList(" + fieldName + ", " + parameterType + ".CREATOR);", null));
// phones = in.createTypedArrayList(Phone.CREATOR);
methodBody.add(factory.createStatementFromText(fieldName + " = in.createTypedArrayList(" + parameterType + ".CREATOR);", null));
}
示例2: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
methodBody.add(factory.createStatementFromText("out.writeValue(" + field.getName() + ");", null));
}
示例3: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
methodBody.add(factory.createStatementFromText(field.getName() + " = (" + typeNameHolder + ")in.readValue(" + typeNameHolder + ".class.getClassLoader());", null));
}
示例4: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
String typeNameHolder = field.getType().getDeepComponentType().getPresentableText();
String temp = typeNameHolder.substring(0, 1).toUpperCase() + typeNameHolder.substring(1);
methodBody.add(factory.createStatementFromText("out.write" + temp + "Array(" + field.getName() + ");", null));
}
示例5: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
String fieldName = field.getName();
String typeNameHolder = field.getType().getDeepComponentType().getPresentableText();
String temp = typeNameHolder.substring(0, 1).toUpperCase() + typeNameHolder.substring(1);
// methodBody.add(factory.createStatementFromText(fieldName + " = new " + typeNameHolder + "[in.readInt()];", null));
// methodBody.add(factory.createStatementFromText("in.read" + temp + "Array(" + fieldName + ");", null));
// nickNames = in.createStringArray();
methodBody.add(factory.createStatementFromText(fieldName + " = in.create" + temp + "Array();", null));
}
示例6: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
methodBody.add(factory.createStatementFromText("out.writeByte((byte) (" + field.getName() + " ? 1 : 0));", null));
}
示例7: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
methodBody.add(factory.createStatementFromText(field.getName() + " = 1 == in.readByte();", null));
}
示例8: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
String typeNameHolder = field.getType().getPresentableText();
String temp = typeNameHolder.substring(0, 1).toUpperCase() + typeNameHolder.substring(1);
methodBody.add(factory.createStatementFromText("out.write" + temp + "(" + field.getName() + ");", null));
}
示例9: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
String typeNameHolder = field.getType().getPresentableText();
String temp = typeNameHolder.substring(0, 1).toUpperCase() + typeNameHolder.substring(1);
methodBody.add(factory.createStatementFromText(field.getName() + " = in.read" + temp + "();", null));
}
示例10: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
// out.writeParcelableArray(phoneArray, 0);
methodBody.add(factory.createStatementFromText("out.writeTypedArray(" + field.getName() + ", 0);", null));
}
示例11: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
String fieldName = field.getName();
String deepComponentType = field.getType().getDeepComponentType().getPresentableText();
// phoneArray = in.createTypedArray(Phone.CREATOR);
methodBody.add(factory.createStatementFromText(fieldName + " = in.createTypedArray(" + deepComponentType + ".CREATOR);", null));
}
示例12: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
// out.writeTypedList(p);
methodBody.add(factory.createStatementFromText("out.writeTypedList(" + field.getName() + ");", null));
}
示例13: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
// out.writeParcelable(p, 0);
methodBody.add(factory.createStatementFromText("out.writeParcelable(" + field.getName() + ", 0);", null));
}
示例14: readMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void readMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
// p = in.readParcelable(getClass().getClassLoader())
methodBody.add(factory.createStatementFromText(field.getName() + " = in.readParcelable(" + field.getType().getPresentableText() + ".class.getClassLoader());", null));
}
示例15: writeMethod
import com.intellij.psi.PsiCodeBlock; //导入方法依赖的package包/类
@Override
public void writeMethod(PsiCodeBlock methodBody, PsiElementFactory factory, PsiField field) {
if (null == methodBody) {
return;
}
// out.writeSerializable();
methodBody.add(factory.createStatementFromText("out.writeSerializable(" + field.getName() + ");", null));
}