本文整理了Java中org.babyfish.collection.XOrderedMap
类的一些代码示例,展示了XOrderedMap
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XOrderedMap
类的具体详情如下:
包路径:org.babyfish.collection.XOrderedMap
类名称:XOrderedMap
暂无
代码示例来源:origin: babyfish-ct/babyfish
private void registerSelfStackTopInsnNode() {
List<Object> stack = this.stack;
if (stack != null &&
!stack.isEmpty() &&
stack.get(stack.size() - 1).equals(this.metadataClass.getInternalName())) {
this.selfWillBeStackTopInsnMap.put(
((MethodNode)this.mv).instructions.getLast(),
stack.size()
);
}
}
代码示例来源:origin: babyfish-ct/babyfish
private void buildPolymorphicTarget() {
for (ClassEntry classEntry : this.classEntries.values()) {
for (MethodEntry methodEntry : classEntry.methodEntries.values()) {
MethodEntry polymorphicTarget = methodEntry;
while (true) {
if (polymorphicTarget.overrideTarget != null) {
polymorphicTarget = polymorphicTarget.overrideTarget;
} else if (polymorphicTarget.bridgeTarget != null) {
polymorphicTarget = polymorphicTarget.bridgeTarget;
} else {
break;
}
}
methodEntry.polymorphicTarget = polymorphicTarget;
}
}
}
代码示例来源:origin: babyfish-ct/babyfish
private void buildOverrideChain() {
ClassEntry[] arr =
this.classEntries.values().toArray(
new ClassEntry[this.classEntries.size()]);
for (int i = 0; i < arr.length; i++) {
for (int ii = i + 1; ii < arr.length; ii++) {
for (MethodEntry methodEntry1 : arr[i].methodEntries.values()) {
int access1 = methodEntry1.methodNode.access;
if ((access1 & (Opcodes.ACC_STATIC | Opcodes.ACC_FINAL | Opcodes.ACC_PRIVATE)) == 0) {
MethodEntry methodEntry2 = arr[ii].methodEntries.get(methodEntry1.getDescriptor());
if (methodEntry2 != null) {
int access2 = methodEntry1.methodNode.access;
if ((access2 & (Opcodes.ACC_STATIC | Opcodes.ACC_PRIVATE)) == 0) {
methodEntry1.overrideTarget = methodEntry2;
}
}
}
}
}
}
}
代码示例来源:origin: babyfish-ct/babyfish
public void resolvePropertyList() {
if (this.propertyList != null) {
return;
}
if (this.superClass != null) {
this.superClass.resolvePropertyList();
}
int propertyId = this.superClass != null ? this.superClass.propertyList.size() : 0;
JPAMetadataPropertyImpl[] arr = new JPAMetadataPropertyImpl[propertyId + this.declaredProperties.size()];
if (this.superClass != null) {
this.superClass.propertyList.toArray(arr);
}
for (JPAMetadataPropertyImpl property : this.declaredProperties.values()) {
arr[propertyId] = property;
property.id = propertyId++;
}
this.propertyList = MACollections.wrap(arr);
}
代码示例来源:origin: babyfish-ct/babyfish
public PathPlanKeyBuilder setQueryPaths(String alias, Collection<? extends QueryPath> queryPaths) {
if (queryPaths == null || queryPaths.isEmpty()) {
this.queryPathMap.remove(alias);
}
XOrderedSet<QueryPath> set = new LinkedHashSet<>((queryPaths.size() * 4 + 2) / 3);
for (QueryPath queryPath : queryPaths) {
if (queryPath != null) {
set.add(QueryPaths.toStandard(queryPath));
}
}
this.queryPathMap.put(alias, queryPaths.toArray(new QueryPath[set.size()]));
this.key = null;
return this;
}
代码示例来源:origin: babyfish-ct/babyfish
public void resolveProperties() {
if (this.properties != null) {
return;
}
if (this.superClass == null) {
this.properties = this.declaredProperties;
return;
}
this.superClass.resolveProperties();
if (this.declaredProperties.isEmpty()) {
this.properties = this.superClass.properties;
return;
}
XOrderedMap<String, JPAMetadataPropertyImpl> map = new LinkedHashMap<>(this.superClass.properties);
for (JPAMetadataPropertyImpl property : this.declaredProperties.values()) {
MetadataProperty superProperty = map.put(property.getName(), property);
if (superProperty != null && !superProperty.getName().equals(property.unresolved.contravarianceFrom)) {
throw new IllegalClassException(
missContravarinaceWithSameName(
property,
superProperty,
Contravariance.class,
property.getName()
)
);
}
}
this.properties = MACollections.unmodifiable(map);
}
代码示例来源:origin: babyfish-ct/babyfish
protected LiteralParameter getLiteralParameter(Object object) {
XOrderedMap<Object, LiteralParameter> literalParameters = this.literalParameters;
if (literalParameters == null) {
this.literalParameters = literalParameters = new LinkedHashMap<>();
}
LiteralParameter literalParameter = literalParameters.get(object);
if (literalParameter == null) {
if (object instanceof LiteralExpression<?>) {
literalParameter = new LiteralParameter(literalParameters.size(),
((LiteralExpression<?>)object).getValue());
} else if (object instanceof Partition<?>) {
Collection<Object> c = new ArrayList<>();
for (Expression<?> value : ((Partition<?>)object).getValues()) {
if (value instanceof LiteralExpression<?>) {
c.add(((LiteralExpression<?>)value).getValue());
} else {
c.add(((ConstantExpression<?>)value).getValue());
}
}
literalParameter = new LiteralParameter(literalParameters.size(), c);
} else {
Arguments.mustBeInstanceOfAnyOfValue("object", object, LiteralExpression.class, Partition.class);
}
literalParameters.put(object, literalParameter);
}
return literalParameter;
}
代码示例来源:origin: babyfish-ct/babyfish
for (int i = 0; i < catches.length; i++) {
for (String exceptionInternalName : catches[i].getExceptionInternalNames()) {
catchLabels.put(exceptionInternalName, new Label());
catchActions.put(exceptionInternalName, catches[i].getMvAction());
for (Entry<String, Label> entry : catchLabels.entrySet()) {
innerMV.visitTryCatchBlock(
tryLabel,
catchLabels.firstEntry().getValue(),
entry.getValue(),
entry.getKey());
innerMV.visitJumpInsn(Opcodes.GOTO, endLabel);
for (Entry<String, Label> entry : catchLabels.entrySet()) {
innerMV.visitLabel(entry.getValue());
catchActions.get(entry.getKey()).accept(this);
innerMV.visitJumpInsn(Opcodes.GOTO, endLabel);
代码示例来源:origin: babyfish-ct/babyfish
compileResult = LEVEL_TWO_CACHE.access(queryPath); //1st level-2 reading
compileResult = LEVEL_TWO_CACHE.access(queryPath); //2nd level-2 reading
if (compileResult == null) { //2nd level-2 checking
ANTLRInputStream input = new ANTLRInputStream(queryPath);
for (int i = LEVEL_TWO_CACHE.size() - LEVEL_2_CACHE_MAX_SIZE; i >= 0; i--) {
LEVEL_TWO_CACHE.pollFirstEntry();
LEVEL_TWO_CACHE.put(queryPath, compileResult);
代码示例来源:origin: babyfish-ct/babyfish
if (!allEntityMap.containsKey(fromElementAlias)) {
allEntityMap.put(fromElementAlias, index);
Integer column;
if (subPlanAlias != null) {
column = allEntityMap.get(subPlanAlias);
if (column == null) {
throw new QueryException(
column = allEntityMap.firstEntry().getValue();
代码示例来源:origin: babyfish-ct/babyfish
MethodEntry getMethodEntry(Descriptor descriptor) {
MethodEntry methodEntry = this.methodEntries.get(descriptor);
if (methodEntry == null) {
if (this.superClassEntry == null) {
return null;
}
methodEntry = this.superClassEntry.getMethodEntry(descriptor);
}
return methodEntry;
}
代码示例来源:origin: babyfish-ct/babyfish
ClassEntry lastEntry = this.classEntries.lastEntry().getValue();
ClassNode newClassNode = new ClassNode();
newClassNode.version = Opcodes.V1_7;
for (MethodEntry methodEntry : lastEntry.methodEntries.values()) {
MethodNode methodNode = methodEntry.methodNode;
if ("<init>".equals(methodNode.name) &&
newClassEntry.superClassEntry = this.classEntries.lastEntry().getValue();
this.newClassEntry = newClassEntry;
this.classEntries.put(newClassNode.name, newClassEntry);
return retval;
代码示例来源:origin: babyfish-ct/babyfish
!isSystemClass(clazz);
clazz = clazz.getSuperclass()) {
classEntries.put(
clazz.getName().replace('.', '/'),
new ClassEntry(clazz));
for (ClassEntry classEntry : classEntries.values()) {
classEntry.superClassEntry = superClassEntry;
superClassEntry = classEntry;
代码示例来源:origin: babyfish-ct/babyfish
private void buildBridgeChain() {
for (ClassEntry classEntry : this.classEntries.values()) {
for (MethodEntry methodEntry : classEntry.methodEntries.values()) {
if ((methodEntry.methodNode.access & Opcodes.ACC_BRIDGE) != 0) {
if (methodEntry.instructions.size() < 3) {
MethodEntry targetMethodEntry = classEntry.methodEntries.get(
new Descriptor(invokeVirtualNode.name, invokeVirtualNode.desc));
if (targetMethodEntry == null) {
代码示例来源:origin: babyfish-ct/babyfish
private void modifyNewClassNode() {
ClassEntry newClassEntry = this.newClassEntry;
ClassNode newClassNode = newClassEntry.classNode;
List<ClassEntry> ces = new ArrayList<>(this.classEntries.size() + this.invokedEntries.size());
ces.addAll(this.classEntries.values());
ces.addAll(this.invokedEntries.values());
for (ClassEntry ce : ces) {
for (FieldEntry fieldEntry : ce.fieldEntries.values()) {
if (fieldEntry.getterDescriptorToAvoidIllegalAccessing != null ||
fieldEntry.setterDescriptorToAvoidIllegalAccessing != null) {
for (MethodEntry methodEntry : ce.methodEntries.values()) {
if (methodEntry.changed) {
String methodName;
List<TryCatchBlockNode> tmpTryCatchBlocks = new ArrayList<TryCatchBlockNode>();
for (ClassEntry classEntry : ces) {
for (FieldEntry fieldEntry : classEntry.fieldEntries.values()) {
if (fieldEntry.getterDescriptorToAvoidIllegalAccessing != null ||
fieldEntry.setterDescriptorToAvoidIllegalAccessing != null) {
for (MethodEntry methodEntry : classEntry.methodEntries.values()) {
if (methodEntry.descriptorToAvoidIllegalAccessing != null) {
Type[] parameterTypes = Type.getArgumentTypes(methodEntry.getDescriptor().desc);
MethodNode clinitNode = this.newClassEntry.getMethodEntry(clinitDescriptor).methodNode;
if (clinitNode.instructions.size() == 0 && tmpInstructions.size() == 0) {
this.newClassEntry.methodEntries.remove(clinitDescriptor);
this.newClassEntry.classNode.methods.remove(clinitNode);
} else {
代码示例来源:origin: babyfish-ct/babyfish
public MethodSource getMethodSource(Method method) {
ClassEntry classEntry = this.context.classEntries.get(
Type.getInternalName(method.getDeclaringClass()));
if (classEntry != null) {
MethodEntry methodEntry = classEntry.methodEntries.get(
new Descriptor(method.getName(), Type.getMethodDescriptor(method)));
return new MethodSource(methodEntry);
}
throw new IllegalArgumentException(
canNotFindMethodSource(
this.context.owner().getClass(),
method,
this.context.classEntries.firstEntry().getValue().clazz
)
);
}
}
代码示例来源:origin: babyfish-ct/babyfish
for (MetadataProperty metadataProperty : this.getMetadataClass().getDeclaredProperties().values()) {
this.generatePropertyFields(cv, metadataProperty);
for (MetadataProperty metadataProperty : this.getMetadataClass().getDeclaredProperties().values()) {
this.generatePropertyGetter(cv, metadataProperty);
this.generatePropertySetter(cv, metadataProperty);
if (this.getMetadataClass().getSuperClass() == null || !this.getMetadataClass().getDeclaredProperties().isEmpty()) {
this.generateWriteObject(cv);
this.generateReadObject(cv);
代码示例来源:origin: babyfish-ct/babyfish
@Override
public void visitFieldInsn(int opcode, String owner, String name, String desc) {
if (owner.equals(this.metadataClass.getInternalName()) &&
this.metadataClass.getDeclaredProperties().containsKey(name)) {
MetadataProperty metadataProperty = this.metadataClass.getDeclaredProperties().get(name);
Integer stackLength = this.stack.size();
if (opcode == Opcodes.PUTFIELD) {
abstractInsnNode != null;
abstractInsnNode = abstractInsnNode.getPrevious()) {
if (stackLength.equals(this.selfWillBeStackTopInsnMap.get(abstractInsnNode))) {
FieldInsnNode objectModelFieldInsnNode =
new FieldInsnNode(
代码示例来源:origin: babyfish-ct/babyfish
@Override
protected XEntry<K, V> createBaseView(
XOrderedMap<K, V> baseMap, ViewInfo viewInfo) {
if (viewInfo instanceof OrderedMapViewInfos.FirstEntry) {
return baseMap.firstEntry();
}
throw new IllegalArgumentException(CommonMessages.illegalViewInfo());
}
代码示例来源:origin: babyfish-ct/babyfish
@Override
public V access(K key) {
this.enable();
return this.<XOrderedMap<K, V>>getBase().access(key);
}
内容来源于网络,如有侵权,请联系作者删除!