本文整理匯總了Java中com.buschmais.xo.spi.reflection.PropertyMethod.getName方法的典型用法代碼示例。如果您正苦於以下問題:Java PropertyMethod.getName方法的具體用法?Java PropertyMethod.getName怎麽用?Java PropertyMethod.getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.buschmais.xo.spi.reflection.PropertyMethod
的用法示例。
在下文中一共展示了PropertyMethod.getName方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createIndexedPropertyMetadata
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
@Override
public DuctileIndexedPropertyMetadata createIndexedPropertyMetadata(PropertyMethod propertyMethod) {
Property property = propertyMethod.getAnnotationOfProperty(Property.class);
String name = property != null ? property.value() : propertyMethod.getName();
Class<?> declaringClass = propertyMethod.getAnnotatedElement().getDeclaringClass();
Class<? extends Element> type = null;
if (declaringClass.getAnnotation(VertexDefinition.class) != null) {
type = DuctileVertex.class;
} else if (declaringClass.getAnnotation(EdgeDefinition.class) != null) {
type = DuctileEdge.class;
} else {
throw new XOException("Property '" + name
+ "' was found with index annotation, but the declaring type is neither a vertex nor an edge.");
}
Indexed indexedAnnotation = propertyMethod.getAnnotation(Indexed.class);
boolean unique = indexedAnnotation.unique();
Class<?> dataType = propertyMethod.getType();
if (Serializable.class.isAssignableFrom(dataType)) {
@SuppressWarnings("unchecked")
Class<? extends Serializable> serializableDataType = (Class<? extends Serializable>) dataType;
return new DuctileIndexedPropertyMetadata(name, unique, serializableDataType, type);
} else {
throw new XOException("Illegal data type '" + dataType.getName() + "' found. Type is not serializable.");
}
}
示例2: createIndexedPropertyMetadata
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
@Override
public TitanIndexedPropertyMetadata createIndexedPropertyMetadata(
PropertyMethod propertyMethod) {
Property property = propertyMethod
.getAnnotationOfProperty(Property.class);
String name = property != null ? property.value() : propertyMethod
.getName();
Class<?> declaringClass = propertyMethod.getAnnotatedElement()
.getDeclaringClass();
Class<? extends Element> type = null;
if (declaringClass.getAnnotation(VertexDefinition.class) != null) {
type = Vertex.class;
} else if (declaringClass.getAnnotation(EdgeDefinition.class) != null) {
type = Edge.class;
} else {
throw new XOException(
"Property '"
+ name
+ "' was found with index annotation, but the declaring type is neither a vertex nor an edge.");
}
Indexed indexedAnnotation = propertyMethod.getAnnotation(Indexed.class);
boolean unique = indexedAnnotation.unique();
Class<?> dataType = propertyMethod.getType();
return new TitanIndexedPropertyMetadata(name, unique, dataType, type);
}
示例3: RowProxyMethodService
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
public RowProxyMethodService(SortedSet<Class<?>> types) {
for (Class<?> type : types) {
BeanMethodProvider beanMethodProvider = BeanMethodProvider.newInstance(type);
Collection<AnnotatedMethod> typeMethodsOfType = beanMethodProvider.getMethods();
for (AnnotatedMethod typeMethod : typeMethodsOfType) {
if (!(typeMethod instanceof GetPropertyMethod)) {
throw new XOException("Only get methods are supported for projections: '" + typeMethod.getAnnotatedElement().getName() + "'.");
}
PropertyMethod propertyMethod = (PropertyMethod) typeMethod;
GetMethod proxyMethod = new GetMethod(propertyMethod.getName(), propertyMethod.getType());
addProxyMethod(proxyMethod, propertyMethod.getAnnotatedElement());
}
}
addMethod(new AsMethod(), CompositeObject.class, "as", Class.class);
addMethod(new GetDelegateMethod<>(), CompositeObject.class, "getDelegate");
addMethod(new com.buschmais.xo.impl.proxy.query.row.GetMethod(), CompositeRowObject.class, "get", String.class, Class.class);
addMethod(new GetColumnsMethod(), CompositeRowObject.class, "getColumns");
addMethod(new HashCodeMethod(), Object.class, "hashCode");
addMethod(new EqualsMethod(), Object.class, "equals", Object.class);
addMethod(new ToStringMethod(), Object.class, "toString");
}
示例4: createPropertyMetadata
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
@Override
public TitanPropertyMetadata createPropertyMetadata(
PropertyMethod propertyMethod) {
Property property = propertyMethod
.getAnnotationOfProperty(Property.class);
String name = property != null ? property.value() : propertyMethod
.getName();
return new TitanPropertyMetadata(name);
}
示例5: createPropertyMetadata
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
@Override
public DuctilePropertyMetadata createPropertyMetadata(PropertyMethod propertyMethod) {
Property property = propertyMethod.getAnnotationOfProperty(Property.class);
String name = property != null ? property.value() : propertyMethod.getName();
return new DuctilePropertyMetadata(name);
}
示例6: createPropertyMetadata
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
@Override
public PropertyMetadata createPropertyMetadata(PropertyMethod propertyMethod) {
Property property = propertyMethod.getAnnotationOfProperty(Property.class);
String name = property != null ? property.value() : propertyMethod.getName();
return new PropertyMetadata(name);
}
示例7: determinePropertyName
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
/**
* This method is a helper method to extract the name from a
* {@link PropertyMethod}.
*
* @param propertyMethod
* is the {@link PropertyMethod} object which represents the
* method for which the name is to be checked.
* @return A {@link String} object is returned containing the name of the
* edge.
*/
private static String determinePropertyName(PropertyMethod propertyMethod) {
VertexDefinition property = propertyMethod.getAnnotationOfProperty(VertexDefinition.class);
return property != null ? property.value() : propertyMethod.getName();
}
示例8: determinePropertyName
import com.buschmais.xo.spi.reflection.PropertyMethod; //導入方法依賴的package包/類
/**
* This method is a helper method to extract the name from a
* {@link PropertyMethod}.
*
* @param propertyMethod
* is the {@link PropertyMethod} object which represents the
* method for which the name is to be checked.
* @return A {@link String} object is returned containing the name of the
* edge.
*/
private static String determinePropertyName(PropertyMethod propertyMethod) {
VertexDefinition property = propertyMethod
.getAnnotationOfProperty(VertexDefinition.class);
return property != null ? property.value() : propertyMethod.getName();
}