本文整理汇总了Java中org.springframework.roo.classpath.details.ItdTypeDetails类的典型用法代码示例。如果您正苦于以下问题:Java ItdTypeDetails类的具体用法?Java ItdTypeDetails怎么用?Java ItdTypeDetails使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ItdTypeDetails类属于org.springframework.roo.classpath.details包,在下文中一共展示了ItdTypeDetails类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even
// hoping to hear about changes to that JavaType and its ITDs
final JavaType governor = itdTypeDetails.getName();
final String localMid = managedEntityTypes.get(governor);
if (localMid != null) {
return localMid;
}
final MemberHoldingTypeDetails memberHoldingTypeDetails = getTypeLocationService()
.getTypeDetails(governor);
if (memberHoldingTypeDetails != null) {
for (final JavaType type : memberHoldingTypeDetails
.getLayerEntities()) {
final String localMidType = managedEntityTypes.get(type);
if (localMidType != null) {
return localMidType;
}
}
}
return null;
}
示例2: assertItdContents
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
/**
* Asserts that the ITD has the expected contents when the governor does or
* does not contain the required members
*
* @param alreadySerializable
* @param alreadyHasVersionField
*/
private void assertItdContents(final boolean alreadySerializable,
final boolean alreadyHasVersionField) {
// Set up
when(mockClassDetails.implementsType(JdkJavaType.SERIALIZABLE))
.thenReturn(alreadySerializable);
when(
mockClassDetails
.declaresField(SerializableMetadata.SERIAL_VERSION_FIELD))
.thenReturn(alreadyHasVersionField);
final SerializableMetadata metadata = new SerializableMetadata(
METADATA_ID, mockAspectName, mockGovernor);
// Invoke
final ItdTypeDetails itd = metadata.getItdTypeDetails();
// Check
assertEquals(alreadySerializable ? 0 : 1, itd.getImplementsTypes()
.size());
assertEquals(alreadyHasVersionField ? 0 : 1, itd.getDeclaredFields()
.size());
}
示例3: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even
// hoping to hear about changes to that JavaType and its ITDs
final JavaType governor = itdTypeDetails.getName();
final String localMid = domainTypeToRepositoryMidMap.get(governor);
if (localMid != null) {
return localMid;
}
final MemberHoldingTypeDetails memberHoldingTypeDetails = getTypeLocationService()
.getTypeDetails(governor);
if (memberHoldingTypeDetails != null) {
for (final JavaType type : memberHoldingTypeDetails
.getLayerEntities()) {
final String localMidType = domainTypeToRepositoryMidMap
.get(type);
if (localMidType != null) {
return localMidType;
}
}
}
return null;
}
示例4: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even
// hoping to hear about changes to that JavaType and its ITDs
final JavaType governor = itdTypeDetails.getName();
final String localMid = managedEntityTypes.get(governor);
if (localMid != null) {
return localMid;
}
final MemberHoldingTypeDetails memberHoldingTypeDetails = getTypeLocationService()
.getTypeDetails(governor);
if (memberHoldingTypeDetails != null) {
for (final JavaType type : memberHoldingTypeDetails
.getLayerEntities()) {
final String localMidType = managedEntityTypes.get(type);
if (localMidType != null) {
return localMidType;
}
}
}
return null;
}
示例5: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even
// hoping to hear about changes to that JavaType and its ITDs
final JavaType governor = itdTypeDetails.getName();
final String localMid = entityToConverterMidMap.get(governor);
if (localMid != null) {
return localMid;
}
final MemberHoldingTypeDetails memberHoldingTypeDetails = getTypeLocationService()
.getTypeDetails(itdTypeDetails.getGovernor().getName());
if (memberHoldingTypeDetails != null) {
for (final JavaType type : memberHoldingTypeDetails
.getLayerEntities()) {
final String localMidType = entityToConverterMidMap.get(type);
if (localMidType != null) {
return localMidType;
}
}
}
return null;
}
示例6: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even
// hoping to hear about changes to that JavaType and its ITDs
final JavaType governor = itdTypeDetails.getName();
final String localMid = entityToManagedBeanMidMap.get(governor);
if (localMid != null) {
return localMid;
}
final MemberHoldingTypeDetails memberHoldingTypeDetails = getTypeLocationService()
.getTypeDetails(governor);
if (memberHoldingTypeDetails != null) {
for (final JavaType type : memberHoldingTypeDetails
.getLayerEntities()) {
final String localMidType = entityToManagedBeanMidMap.get(type);
if (localMidType != null) {
return localMidType;
}
}
}
return null;
}
示例7: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
final ClassOrInterfaceTypeDetails governorTypeDetails = getTypeLocationService()
.getTypeDetails(itdTypeDetails.getName());
if (governorTypeDetails == null) {
return null;
}
// Check whether a relevant layer component has appeared, changed, or
// disappeared
final String localMidForLayerManagedEntity = getWebJsonMidIfLayerComponent(governorTypeDetails);
if (StringUtils.isNotBlank(localMidForLayerManagedEntity)) {
return localMidForLayerManagedEntity;
}
// Check whether the relevant MVC controller has appeared, changed, or
// disappeared
return getWebJsonMidIfMvcController(governorTypeDetails);
}
示例8: addItdTypeDetails
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
public void addItdTypeDetails(final ItdTypeDetails itdTypeDetails) {
if (itdTypeDetails == null || itdTypeDetails.getGovernor() == null) {
return;
}
if (typeMap.get(itdTypeDetails.getGovernor().getName()
.getFullyQualifiedTypeName()) == null) {
typeMap.put(itdTypeDetails.getGovernor().getName()
.getFullyQualifiedTypeName(),
new HashMap<String, MemberHoldingTypeDetails>());
}
itdIdToTypeMap.put(itdTypeDetails.getDeclaredByMetadataId(),
itdTypeDetails.getGovernor().getName()
.getFullyQualifiedTypeName());
typeMap.get(
itdTypeDetails.getGovernor().getName()
.getFullyQualifiedTypeName()).put(
itdTypeDetails.getDeclaredByMetadataId(), itdTypeDetails);
updateChanges(itdTypeDetails.getGovernor().getName(), false);
}
示例9: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even hoping to hear about changes to that JavaType and its ITDs.
final JavaType governor = itdTypeDetails.getName();
final String localMid = domainTypeToRepositoryMidMap.get(governor);
if (localMid != null) {
return localMid;
}
final MemberHoldingTypeDetails memberHoldingTypeDetails = typeLocationService.getTypeDetails(governor);
if (memberHoldingTypeDetails != null) {
for (final JavaType type : memberHoldingTypeDetails.getLayerEntities()) {
final String localMidType = domainTypeToRepositoryMidMap.get(type);
if (localMidType != null) {
return localMidType;
}
}
}
return null;
}
开发者ID:lbroudoux,项目名称:spring-roo-addon-layers-repository-elasticsearch,代码行数:21,代码来源:RepositoryElasticsearchMetadataProvider.java
示例10: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any metadata is even
// hoping to hear about changes to that JavaType and its ITDs
JavaType governor = itdTypeDetails.getName();
String localMid = entityToWebScaffoldMidMap.get(governor);
return localMid == null ? null : localMid;
}
示例11: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
final JavaType governor = itdTypeDetails.getName();
// If the governor is a form backing object, refresh its local metadata
final String localMid = entityToBatchMidMap.get(governor);
if (localMid != null) {
return localMid;
}
// If the governor is a layer component that manages a form backing
// object, refresh that object's local metadata
return getRelatedEntityComponent(governor);
}
示例12: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
// Determine the governor for this ITD, and whether any DOD metadata is
// even hoping to hear about changes to that JavaType and its ITDs
final JavaType governor = itdTypeDetails.getName();
for (final JavaType type : itdTypeDetails.getGovernor()
.getLayerEntities()) {
final String localMidType = entityToDodMidMap.get(type);
if (localMidType != null) {
return localMidType;
}
}
final String localMid = entityToDodMidMap.get(governor);
if (localMid == null) {
// No DOD is interested in this JavaType, so let's move on
return null;
}
// We have some DOD metadata, so let's check if we care if any methods
// match our requirements
for (final MethodMetadata method : itdTypeDetails.getDeclaredMethods()) {
if (BeanInfoUtils.isMutatorMethod(method)) {
// A DOD cares about the JavaType, and an ITD offers a method
// likely of interest, so let's formally trigger it to run.
// Note that it will re-scan and discover this ITD, and register
// a direct dependency on it for the future.
return localMid;
}
}
return null;
}
示例13: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
// Determine if this ITD presents a method we're interested in (namely
// accessors)
for (final MethodMetadata method : itdTypeDetails.getDeclaredMethods()) {
if (BeanInfoUtils.isAccessorMethod(method)
&& !method.getMethodName().getSymbolName().startsWith("is")) {
// We care about this ITD, so formally request an update so we
// can scan for it and process it
// Determine the governor for this ITD, and the Path the ITD is
// stored within
final JavaType governorType = itdTypeDetails.getName();
final String providesType = MetadataIdentificationUtils
.getMetadataClass(itdTypeDetails
.getDeclaredByMetadataId());
final LogicalPath itdPath = PhysicalTypeIdentifierNamingUtils
.getPath(providesType,
itdTypeDetails.getDeclaredByMetadataId());
// Produce the local MID we're going to use and make the request
return createLocalIdentifier(governorType, itdPath);
}
}
return null;
}
示例14: getLocalMidToRequest
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
@Override
protected String getLocalMidToRequest(final ItdTypeDetails itdTypeDetails) {
final JavaType governor = itdTypeDetails.getName();
// If the governor is a form backing object, refresh its local metadata
final String localMid = entityToWebScaffoldMidMap.get(governor);
if (localMid != null) {
return localMid;
}
// If the governor is a layer component that manages a form backing
// object, refresh that object's local metadata
return getWebScaffoldMidIfLayerComponent(governor);
}
示例15: build
import org.springframework.roo.classpath.details.ItdTypeDetails; //导入依赖的package包/类
public MemberHoldingTypeDetails build() {
if (existing instanceof ItdTypeDetails) {
final ItdTypeDetailsBuilder itdBuilder = new ItdTypeDetailsBuilder(
(ItdTypeDetails) existing);
// Push in all members that may have been modified
itdBuilder.setDeclaredFields(getDeclaredFields());
itdBuilder.setDeclaredMethods(getDeclaredMethods());
itdBuilder.setAnnotations(getAnnotations());
itdBuilder.setCustomData(getCustomData());
itdBuilder.setDeclaredConstructors(getDeclaredConstructors());
itdBuilder.setDeclaredInitializers(getDeclaredInitializers());
itdBuilder.setDeclaredInnerTypes(getDeclaredInnerTypes());
itdBuilder.setExtendsTypes(getExtendsTypes());
itdBuilder.setImplementsTypes(getImplementsTypes());
itdBuilder.setModifier(getModifier());
return itdBuilder.build();
}
else if (existing instanceof ClassOrInterfaceTypeDetails) {
final ClassOrInterfaceTypeDetailsBuilder cidBuilder = new ClassOrInterfaceTypeDetailsBuilder(
(ClassOrInterfaceTypeDetails) existing);
// Push in all members that may
cidBuilder.setDeclaredFields(getDeclaredFields());
cidBuilder.setDeclaredMethods(getDeclaredMethods());
cidBuilder.setAnnotations(getAnnotations());
cidBuilder.setCustomData(getCustomData());
cidBuilder.setDeclaredConstructors(getDeclaredConstructors());
cidBuilder.setDeclaredInitializers(getDeclaredInitializers());
cidBuilder.setDeclaredInnerTypes(getDeclaredInnerTypes());
cidBuilder.setExtendsTypes(getExtendsTypes());
cidBuilder.setImplementsTypes(getImplementsTypes());
cidBuilder.setModifier(getModifier());
return cidBuilder.build();
}
else {
throw new IllegalStateException(
"Unknown instance of MemberHoldingTypeDetails");
}
}