當前位置: 首頁>>代碼示例>>Java>>正文


Java PropertyMethod.getName方法代碼示例

本文整理匯總了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.");
}
   }
 
開發者ID:PureSolTechnologies,項目名稱:DuctileDB,代碼行數:26,代碼來源:DuctileMetadataFactory.java

示例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);
   }
 
開發者ID:PureSolTechnologies,項目名稱:extended-objects-titan,代碼行數:26,代碼來源:TitanMetadataFactory.java

示例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");
}
 
開發者ID:buschmais,項目名稱:extended-objects,代碼行數:22,代碼來源:RowProxyMethodService.java

示例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);
   }
 
開發者ID:PureSolTechnologies,項目名稱:extended-objects-titan,代碼行數:10,代碼來源:TitanMetadataFactory.java

示例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);
   }
 
開發者ID:PureSolTechnologies,項目名稱:DuctileDB,代碼行數:7,代碼來源:DuctileMetadataFactory.java

示例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);
}
 
開發者ID:buschmais,項目名稱:extended-objects,代碼行數:7,代碼來源:AbstractNeo4jMetadataFactory.java

示例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();
   }
 
開發者ID:PureSolTechnologies,項目名稱:DuctileDB,代碼行數:15,代碼來源:DuctileMetadataFactory.java

示例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();
   }
 
開發者ID:PureSolTechnologies,項目名稱:extended-objects-titan,代碼行數:16,代碼來源:TitanMetadataFactory.java


注:本文中的com.buschmais.xo.spi.reflection.PropertyMethod.getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。