Example usage for java.io Serializable getClass

List of usage examples for java.io Serializable getClass

Introduction

In this page you can find the example usage for java.io Serializable getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:org.projectforge.web.wicket.AbstractListPage.java

/**
 * @param item The item where to add the css classes.
 * @param rowDataId If the current row data is equals to the hightlightedRow then the style will contain highlighting.
 * @param highlightedRowId The current row to highlight (id of the data object behind the row).
 * @param isDeleted Is this entry deleted? Then the deleted style will be added.
 * @return/*w ww .ja va 2 s . c o  m*/
 */
protected static void appendCssClasses(final Item<?> item, final Serializable rowDataId,
        final Serializable highlightedRowId, final boolean isDeleted) {
    if (rowDataId == null) {
        return;
    }
    if (rowDataId instanceof Integer == false) {
        log.warn("Error in calling getCssStyle: Integer expected instead of " + rowDataId.getClass());
    }
    if (highlightedRowId != null && rowDataId != null
            && ObjectUtils.equals(highlightedRowId, rowDataId) == true) {
        appendCssClasses(item, RowCssClass.HIGHLIGHTED);
    }
    if (isDeleted == true) {
        appendCssClasses(item, RowCssClass.MARKED_AS_DELETED);
    }
}

From source file:com.dasasian.chok.tool.ZkTool.java

public void read(String path) {
    Serializable data = zkClient.readData(path);
    System.out.println("from type: " + data.getClass().getName());
    System.out.println("to string: " + data.toString());
}

From source file:net.sf.katta.tool.ZkTool.java

public void read(String path) {
    Serializable data = _zkClient.readData(path);
    System.out.println("from type: " + data.getClass().getName());
    System.out.println("to string: " + data.toString());
}

From source file:org.springframework.security.acls.jdbc.AclClassIdUtils.java

private boolean isString(Serializable object) {
    return object.getClass().isAssignableFrom(String.class);
}

From source file:com.clican.pluto.cms.dao.hibernate.BaseDao.java

@SuppressWarnings("unchecked")
protected void initializeLazySet(Serializable obj, String propertyName) {
    try {//from w  ww. j  av a 2s.  c o  m
        Method method = obj.getClass().getMethod(
                "get" + propertyName.substring(0, 1).toUpperCase() + propertyName.substring(1), new Class[] {});
        Set<Serializable> property = (Set<Serializable>) method.invoke(obj, new Object[] {});
        if (property == null) {
            return;
        }
        for (Serializable s : property) {
            if (s.getClass().getName().equals(obj.getClass().getName())) {
                initializeLazySet(s, propertyName);
            }
        }
    } catch (Exception e) {
        log.error("", e);
    }
}

From source file:org.kuali.coeus.common.budget.impl.copy.DeepCopyPostProcessorImpl.java

private Serializable processDeepCopyIgnoreAnnotation(Serializable copiedObject) {
    List<Field> list = new ArrayList<Field>();
    findAllFields(copiedObject.getClass(), list);
    for (Field field : list) {
        if (field.isAnnotationPresent(DeepCopyIgnore.class)) {
            Annotation deepCopyIgnoreAnn = field.getAnnotation(DeepCopyIgnore.class);
            if (deepCopyIgnoreAnn != null) {
                try {
                    ObjectUtils.setObjectProperty(copiedObject, field.getName(), null);
                } catch (Exception e) {
                    LOG.error(e.getMessage(), e);
                }//w ww. jav  a 2s  .co m
            }
        }
        if (field.getType().isAssignableFrom(List.class)) {
            List<Serializable> objectList = (List<Serializable>) ObjectUtils.getPropertyValue(copiedObject,
                    field.getName());
            if (objectList != null)
                for (Serializable objectFromList : objectList) {
                    processDeepCopyWithDeepCopyIgnore(objectFromList);
                }
        }
    }
    return copiedObject;
}

From source file:com.kaching.platform.hibernate.types.AbstractImmutableType.java

/** Returns the cached value.
 *//*from   w  ww  .  j  a  v  a2 s . c  o m*/
public final Object assemble(Serializable cached, Object owner) throws HibernateException {
    if (cached != null) {
        log.trace("assemble " + cached + " (" + cached.getClass() + "), owner is " + owner);
    }
    return cached;
}

From source file:org.devproof.portal.core.module.common.repository.DataProviderRepositoryImpl.java

private void appendTableJoin(Serializable beanQuery, StringBuilder hqlQuery) {
    if (beanQuery.getClass().isAnnotationPresent(BeanJoin.class)) {
        BeanJoin join = beanQuery.getClass().getAnnotation(BeanJoin.class);
        hqlQuery.append(" ").append(join.value()).append(" ");
    }//w w w. j a  v a 2  s .com
}

From source file:org.alfresco.repo.transfer.fsr.FileTransferReceiverRequisiteManifestProcessor.java

protected void processNode(TransferManifestNormalNode node) {

    //Skip over any nodes that are not parented with a cm:contains association or 
    //are not content nodes (we don't need their content)
    if (!ContentModel.ASSOC_CONTAINS.equals(node.getPrimaryParentAssoc().getTypeQName())
            || !ContentModel.TYPE_CONTENT.equals(node.getAncestorType())) {
        return;// w  ww. j  a  v a 2  s . c  om
    }

    Serializable value = node.getProperties().get(ContentModel.PROP_CONTENT);
    if ((value != null) && ContentData.class.isAssignableFrom(value.getClass())) {
        ContentData srcContent = (ContentData) value;
        if (srcContent.getContentUrl() != null && !srcContent.getContentUrl().isEmpty()) {
            // Only ask for content if content is new or if contentUrl is modified
            boolean contentisMissing = fileTransferReceiver.isContentNewOrModified(node.getNodeRef().toString(),
                    srcContent.getContentUrl());
            if (contentisMissing) {
                if (log.isDebugEnabled()) {
                    log.debug("No node on destination, content is required: " + srcContent.getContentUrl());
                }
                out.missingContent(node.getNodeRef(), ContentModel.PROP_CONTENT,
                        TransferCommons.URLToPartName(srcContent.getContentUrl()));
            }
        }
    }
}

From source file:org.broadleafcommerce.openadmin.server.service.persistence.module.provider.AbstractFieldPersistenceProvider.java

protected Class<?> getListFieldType(Serializable instance, FieldManager fieldManager, Property property,
        PersistenceManager persistenceManager) {
    Class<?> returnType = null;
    Field field = fieldManager.getField(instance.getClass(), property.getName());
    java.lang.reflect.Type type = field.getGenericType();
    if (type instanceof ParameterizedType) {
        ParameterizedType pType = (ParameterizedType) type;
        Class<?> clazz = (Class<?>) pType.getActualTypeArguments()[0];
        Class<?>[] entities = persistenceManager.getDynamicEntityDao()
                .getAllPolymorphicEntitiesFromCeiling(clazz);
        if (!ArrayUtils.isEmpty(entities)) {
            returnType = entities[entities.length - 1];
        }/*from w ww.java  2s . c o m*/
    }
    return returnType;
}