当前位置: 首页>>代码示例>>Java>>正文


Java StringUtils类代码示例

本文整理汇总了Java中org.jf.util.StringUtils的典型用法代码示例。如果您正苦于以下问题:Java StringUtils类的具体用法?Java StringUtils怎么用?Java StringUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


StringUtils类属于org.jf.util包,在下文中一共展示了StringUtils类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: makeAnnotator

import org.jf.util.StringUtils; //导入依赖的package包/类
@Nonnull
public static SectionAnnotator makeAnnotator(@Nonnull DexAnnotator annotator, @Nonnull MapItem mapItem) {
    return new SectionAnnotator(annotator, mapItem) {
        @Nonnull @Override public String getItemName() {
            return "string_id_item";
        }

        @Override
        public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) {
            int stringDataOffset = dexFile.readSmallUint(out.getCursor());
            try {
                String stringValue = dexFile.getString(itemIndex);
                out.annotate(4, "string_data_item[0x%x]: \"%s\"", stringDataOffset,
                        StringUtils.escapeString(stringValue));
                return;
            } catch (Exception ex) {
                System.err.print("Error while resolving string value at index: ");
                System.err.print(itemIndex);
                ex.printStackTrace(System.err);
            }

            out.annotate(4, "string_id_item[0x%x]", stringDataOffset);
        }
    };
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:26,代码来源:StringIdItem.java

示例2: makeAnnotator

import org.jf.util.StringUtils; //导入依赖的package包/类
@Nonnull
public static SectionAnnotator makeAnnotator(@Nonnull DexAnnotator annotator, @Nonnull MapItem mapItem) {
    return new SectionAnnotator(annotator, mapItem) {
        @Nonnull @Override public String getItemName() {
            return "string_data_item";
        }

        @Override
        protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) {
            DexReader reader = dexFile.readerAt(out.getCursor());
            int utf16Length = reader.readSmallUleb128();
            out.annotateTo(reader.getOffset(), "utf16_size = %d", utf16Length);

            String value = reader.readString(utf16Length);
            out.annotateTo(reader.getOffset() + 1, "data = \"%s\"", StringUtils.escapeString(value));
        }
    };
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:19,代码来源:StringDataItem.java

示例3: getReferenceString

import org.jf.util.StringUtils; //导入依赖的package包/类
@Nullable
public static String getReferenceString(Reference reference) {
    if (reference instanceof StringReference) {
        return String.format("\"%s\"", StringUtils.escapeString(((StringReference)reference).getString()));
    }
    if (reference instanceof TypeReference) {
        return ((TypeReference)reference).getType();
    }
    if (reference instanceof FieldReference) {
        return getFieldDescriptor((FieldReference)reference);
    }
    if (reference instanceof MethodReference) {
        return getMethodDescriptor((MethodReference)reference);
    }
    return null;
}
 
开发者ID:Miracle963,项目名称:zjdroid,代码行数:17,代码来源:ReferenceUtil.java

示例4: makeAnnotator

import org.jf.util.StringUtils; //导入依赖的package包/类
public static SectionAnnotator makeAnnotator( DexAnnotator annotator,  MapItem mapItem) {
    return new SectionAnnotator(annotator, mapItem) {
         @Override public String getItemName() {
            return "string_id_item";
        }

        @Override
        public void annotateItem( AnnotatedBytes out, int itemIndex,  String itemIdentity) {
            int stringDataOffset = dexFile.readSmallUint(out.getCursor());
            try {
                String stringValue = dexFile.getString(itemIndex);
                out.annotate(4, "string_data_item[0x%x]: \"%s\"", stringDataOffset,
                        StringUtils.escapeString(stringValue));
                return;
            } catch (Exception ex) {
                System.err.print("Error while resolving string value at index: ");
                System.err.print(itemIndex);
                ex.printStackTrace(System.err);
            }

            out.annotate(4, "string_id_item[0x%x]", stringDataOffset);
        }
    };
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:25,代码来源:StringIdItem.java

示例5: makeAnnotator

import org.jf.util.StringUtils; //导入依赖的package包/类
public static SectionAnnotator makeAnnotator( DexAnnotator annotator,  MapItem mapItem) {
    return new SectionAnnotator(annotator, mapItem) {
         @Override public String getItemName() {
            return "string_data_item";
        }

        @Override
        protected void annotateItem( AnnotatedBytes out, int itemIndex,  String itemIdentity) {
            DexReader reader = dexFile.readerAt(out.getCursor());
            int utf16Length = reader.readSmallUleb128();
            out.annotateTo(reader.getOffset(), "utf16_size = %d", utf16Length);

            String value = reader.readString(utf16Length);
            out.annotateTo(reader.getOffset() + 1, "data = \"%s\"", StringUtils.escapeString(value));
        }
    };
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:18,代码来源:StringDataItem.java

示例6: makeAnnotator

import org.jf.util.StringUtils; //导入依赖的package包/类
@Nonnull
public static SectionAnnotator makeAnnotator(@Nonnull DexAnnotator annotator, @Nonnull MapItem mapItem) {
    return new SectionAnnotator(annotator, mapItem) {
        @Nonnull
        @Override
        public String getItemName() {
            return "string_data_item";
        }

        @Override
        protected void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) {
            DexReader reader = dexFile.readerAt(out.getCursor());
            int utf16Length = reader.readSmallUleb128();
            out.annotateTo(reader.getOffset(), "utf16_size = %d", utf16Length);

            String value = reader.readString(utf16Length);
            out.annotateTo(reader.getOffset() + 1, "data = \"%s\"", StringUtils.escapeString(value));
        }
    };
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:21,代码来源:StringDataItem.java

示例7: getReferenceString

import org.jf.util.StringUtils; //导入依赖的package包/类
@Nullable
public static String getReferenceString(Reference reference) {
    if (reference instanceof StringReference) {
        return String.format("\"%s\"", StringUtils.escapeString(((StringReference) reference).getString()));
    }
    if (reference instanceof TypeReference) {
        return ((TypeReference) reference).getType();
    }
    if (reference instanceof FieldReference) {
        return getFieldDescriptor((FieldReference) reference);
    }
    if (reference instanceof MethodReference) {
        return getMethodDescriptor((MethodReference) reference);
    }
    return null;
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:17,代码来源:ReferenceUtil.java

示例8: writeTo

import org.jf.util.StringUtils; //导入依赖的package包/类
@Override
public boolean writeTo(IndentingWriter writer) throws IOException {
    writer.write(".source");

    if (sourceFile != null) {
        writer.write(" \"");
        StringUtils.writeEscapedString(writer, sourceFile);
        writer.write('"');
    }
    return true;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:12,代码来源:SetSourceFileMethodItem.java

示例9: writeSourceFile

import org.jf.util.StringUtils; //导入依赖的package包/类
private void writeSourceFile(IndentingWriter writer) throws IOException {
    String sourceFile = classDef.getSourceFile();
    if (sourceFile != null) {
        writer.write(".source \"");
        StringUtils.writeEscapedString(writer, sourceFile);
        writer.write("\"\n");
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:9,代码来源:ClassDefinition.java

示例10: getReferenceAnnotation

import org.jf.util.StringUtils; //导入依赖的package包/类
public static String getReferenceAnnotation(@Nonnull DexBackedDexFile dexFile, int stringIndex, boolean quote) {
    try {
        String string = dexFile.getString(stringIndex);
        if (quote) {
            string = String.format("\"%s\"", StringUtils.escapeString(string));
        }
        return String.format("string_id_item[%d]: %s", stringIndex, string);
    } catch (Exception ex) {
        ex.printStackTrace(System.err);
    }
    return String.format("string_id_item[%d]", stringIndex);
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:13,代码来源:StringIdItem.java

示例11: getReferenceAnnotation

import org.jf.util.StringUtils; //导入依赖的package包/类
public static String getReferenceAnnotation( DexBackedDexFile dexFile, int stringIndex, boolean quote) {
    try {
        String string = dexFile.getString(stringIndex);
        if (quote) {
            string = String.format("\"%s\"", StringUtils.escapeString(string));
        }
        return String.format("string_id_item[%d]: %s", stringIndex, string);
    } catch (Exception ex) {
        ex.printStackTrace(System.err);
    }
    return String.format("string_id_item[%d]", stringIndex);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:13,代码来源:StringIdItem.java

示例12: makeAnnotator

import org.jf.util.StringUtils; //导入依赖的package包/类
@Nonnull
public static SectionAnnotator makeAnnotator(@Nonnull DexAnnotator annotator, @Nonnull MapItem mapItem) {
    return new SectionAnnotator(annotator, mapItem) {
        @Nonnull
        @Override
        public String getItemName() {
            return "string_id_item";
        }

        @Override
        public void annotateItem(@Nonnull AnnotatedBytes out, int itemIndex, @Nullable String itemIdentity) {
            int stringDataOffset = dexFile.readSmallUint(out.getCursor());
            try {
                String stringValue = dexFile.getString(itemIndex);
                out.annotate(4, "string_data_item[0x%x]: \"%s\"", stringDataOffset,
                        StringUtils.escapeString(stringValue));
                return;
            } catch (Exception ex) {
                System.err.print("Error while resolving string value at index: ");
                System.err.print(itemIndex);
                ex.printStackTrace(System.err);
            }

            out.annotate(4, "string_id_item[0x%x]", stringDataOffset);
        }
    };
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:28,代码来源:StringIdItem.java


注:本文中的org.jf.util.StringUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。