org.babyfish.collection.XOrderedMap.values()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(10.6k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.babyfish.collection.XOrderedMap.values()方法的一些代码示例,展示了XOrderedMap.values()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XOrderedMap.values()方法的具体详情如下:
包路径:org.babyfish.collection.XOrderedMap
类名称:XOrderedMap
方法名:values

XOrderedMap.values介绍

暂无

代码示例

代码示例来源: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

public void secondaryPass(Map<String, MetadataClass> metadataClasses) {
  TypeMirror superType = (TypeMirror)this.supperMetadataClass;
  this.supperMetadataClass = null;
  while (superType instanceof DeclaredType) {
    MetadataClass superMetadataClass = metadataClasses.get(superType.toString());
    if (superMetadataClass != null) {
      this.supperMetadataClass = superMetadataClass;
      break;
    }
    superType = ((TypeElement)((DeclaredType)superType).asElement()).getSuperclass();
  }
  for (MetadataAssociation association : this.associations.values()) {
    association.secondaryPass(metadataClasses);
  }
  for (MetadataScalar scalar : this.scalars.values()) {
    scalar.secondaryPass(metadataClasses);
  }
}

代码示例来源:origin: babyfish-ct/babyfish

public Collection<LiteralParameter> getLiteralParameters() {
  if (this.literalParameters == null) {
    return MACollections.emptySet();
  }
  return MACollections.unmodifiable(this.literalParameters.values());
}

代码示例来源: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 void resolvePropertyList() {
  if (this.propertyList != null) {
    return;
  }
  if (this.superClass != null) {
    this.superClass.resolvePropertyList();
  }
  int propertyId = this.superClass != null ? this.superClass.propertyList.size() : 0;
  MetadataPropertyImpl[] arr = new MetadataPropertyImpl[propertyId + this.declaredProperties.size()];
  if (this.superClass != null) {
    this.superClass.propertyList.toArray(arr);
  }
  for (MetadataPropertyImpl property : this.declaredProperties.values()) {
    arr[propertyId] = property;
    property.id = propertyId++;
  }
  this.propertyList = MACollections.wrap(arr);
}

代码示例来源:origin: babyfish-ct/babyfish

public void validateNonReferenceClass() {
  if (this.modelType != ModelType.REFERENCE && this.superClass == null) {
    boolean hasComparableProperty = false;
    for (MetadataPropertyImpl metadataProperty : this.declaredProperties.values()) {
      if (metadataProperty.getDescriptor().charAt(0) != '[') {
        hasComparableProperty = true;
        break;
      }
    }
    if (!hasComparableProperty) {
      throw new IllegalClassException(
          nonReferenceRootModelIsNotComparable(this, this.modelType)
      );
    }
  }
}

代码示例来源: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

private boolean modifyMethods() {
  boolean retval = false;
  for (ClassEntry classEntry : this.classEntries.values()) {
    for (MethodEntry methodEntry : classEntry.methodEntries.values()) {
      if (!methodEntry.isInit() && 
          !methodEntry.isClinit() && 
          (methodEntry.methodNode.access & Opcodes.ACC_BRIDGE) == 0) {
        ClassEnhancer.this.doMethodFilter(new MethodSource(methodEntry));
        if (methodEntry.setChanged()) {
          retval = true;
        }
      }
    }
  }
  return retval;
}

代码示例来源:origin: babyfish-ct/babyfish

public void afterInit() {
  if (this.modelType != ModelType.REFERENCE) {
    for (MetadataPropertyImpl metadataProperty : this.declaredProperties.values()) {
      if (metadataProperty.propertyType != PropertyType.SCALAR) {
        throw new IllegalClassException(
            nonScalarPropertyRequireReferenceModelType(
                metadataProperty,
                metadataProperty.getDeclaringClass(),
                ModelType.REFERENCE
            )
        );
      }
    }
  }
}

代码示例来源:origin: babyfish-ct/babyfish

for (MetadataProperty declaredProperty : metadataClass.getDeclaredProperties().values()) {
  ((AbstractMetadataProperty)declaredProperty).finish();

代码示例来源:origin: babyfish-ct/babyfish

private PersistenceProvider createRawProvider() {
  XOrderedMap<String, PersistenceUnitInfo> infos;
  String[] persistenceXmlLocations = this.persistenceXmlLocations;
  if (persistenceXmlLocations == null || persistenceXmlLocations.length == 0) {
    infos = new PersistenceUnitReader().read(new String[] { DEFAULT_PERSISTENCE_XML });
  } else {
    infos = new PersistenceUnitReader().read(persistenceXmlLocations);
  }
  List<PersistenceUnitInfoDescriptor> descriptors = new ArrayList<>(infos.size());
  for (PersistenceUnitInfo info : infos.values()) {
    descriptors.add(new PersistenceUnitInfoDescriptor(info));
  }
  return Enhancer.newInstance(descriptors);
}

代码示例来源:origin: babyfish-ct/babyfish

public ObjectModelTargetGenerator(AbstractModelReplacer parent) {
  super(
      parent,
      parent.isProxySupported() ? 
          Identifiers.OBJECT_MODEL_TARGET_SIMPLE_NAME : 
          Identifiers.OBJECT_MODEL_CONTRACT_SIMPLE_NAME
  );
  for (MetadataProperty metadataProperty : this.getMetadataClass().getDeclaredProperties().values()) {
    if (metadataProperty.getPropertyType() == PropertyType.SCALAR && metadataProperty.isDeferrable()) {
      this.overrideLoadScalars = true;
      break;
    }
  }
  for (MetadataProperty metadataProperty : this.getMetadataClass().getDeclaredProperties().values()) {
    if (metadataProperty.getPropertyType() == PropertyType.ASSOCIATION ||
        metadataProperty.getPropertyType() == PropertyType.CONTRAVARIANCE) {
      this.overrideInitAssociations = true;
      break;
    }
  }
}

代码示例来源:origin: babyfish-ct/babyfish

ClassAdapter(ClassVisitor cv) {
  
  super(Opcodes.ASM5, cv);

  MetadataClass metadataClass = AbstractObjectModel4JPAReplacer.this.getMetadataClass();
  
  ObjectModel4JPAInstrumenter instrumenter = 
      (ObjectModel4JPAInstrumenter)AbstractObjectModel4JPAReplacer.this.getInstrumenter();
  ClassNode classNode = instrumenter.getClassNode(metadataClass.getName());
  if (Nulls.isNullOrEmpty(classNode.fields)) {
    this.declaredFieldNodes = MACollections.emptyMap();
  } else {
    Map<String, FieldNode> fMap = new HashMap<>((classNode.fields.size() * 4 + 2) / 3);
    for (FieldNode fieldNode : classNode.fields) {
      fMap.put(fieldNode.name, fieldNode);
    }
    this.declaredFieldNodes = fMap;
  }
  
  int capacity = (metadataClass.getDeclaredProperties().size() * 4 + 2) / 3;
  Map<String, MetadataProperty> gMap = new HashMap<>(capacity);
  Map<String, MetadataProperty> sMap = new HashMap<>(capacity);
  for (MetadataProperty metadataProperty : metadataClass.getDeclaredProperties().values()) {
    gMap.put(Identifiers.getterName(metadataProperty), metadataProperty);
    sMap.put(Identifiers.setterName(metadataProperty), metadataProperty);
  }
  this.getters = gMap;
  this.setters = sMap;
}

代码示例来源:origin: babyfish-ct/babyfish

private Collection<MetadataClass> getEmbeddedMetadataClasses() {
    Set<MetadataClass> embededdMetadataClasses = new LinkedHashSet<>(ReferenceEqualityComparator.getInstance());
    for (MetadataProperty declaredProperty : this.getMetadataClass().getDeclaredProperties().values()) {
      if (declaredProperty.getPropertyType() == PropertyType.SCALAR && declaredProperty.getTargetClass() != null) {
        boolean override = false;
        if (this.getMetadataClass().getSuperClass() != null) {
          for (MetadataProperty superProperty : this.getMetadataClass().getSuperClass().getProperties().values()) {
            if (superProperty.getTargetClass() == declaredProperty.getTargetClass()) {
              override = true;
              break;
            }
          }
        }
        if (!override) {
          embededdMetadataClasses.add(declaredProperty.getTargetClass());
        }
      }
    }
    return embededdMetadataClasses;
  }
}

代码示例来源:origin: babyfish-ct/babyfish

this.versionProperty = this.superClass.versionProperty;
for (JPAMetadataPropertyImpl property : this.declaredProperties.values()) {
  if (property.scalarType == JPAScalarType.VERSION) {
    if (this.versionProperty != null) {

代码示例来源:origin: babyfish-ct/babyfish

@Override
public void accept(Visitor visitor) {
  visitor.visitElement(this);
  for (Attribute attribute : this.attributes.values()) {
    attribute.accept(visitor);
  }
  if (visitor instanceof ChildScopeAwareVisitor) {
    ChildScopeAwareVisitor childScopeAwareVisitor = (ChildScopeAwareVisitor)visitor;
    childScopeAwareVisitor.enterChildScope(this);
    for (Node childNode : this.getChildNodes()) {
      childNode.accept(visitor);
    }
    childScopeAwareVisitor.leaveChildScope(this);
  } else {
    for (Node childNode : this.getChildNodes()) {
      childNode.accept(visitor);
    }
  }
}

代码示例来源: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

for (MetadataPropertyImpl property : this.declaredProperties.values()) {
  MetadataProperty superProperty = map.put(property.getName(), property);
  if (superProperty != null && !superProperty.getName().equals(property.unresolved.contravarianceFrom)) {

代码示例来源:origin: babyfish-ct/babyfish

this.idProperty = this.superClass.idProperty;
for (JPAMetadataPropertyImpl property : this.declaredProperties.values()) {
  if (property.scalarType == JPAScalarType.ID) {
    if (this.idProperty != null) {

代码示例来源:origin: babyfish-ct/babyfish

for (MetadataProperty metadataProperty : this.getMetadataClass().getDeclaredProperties().values()) {
  this.generatePropertyMethod(cv, (JPAMetadataProperty)metadataProperty, false);
  this.generatePropertyMethod(cv, (JPAMetadataProperty)metadataProperty, true);

相关文章