Returns the metadata node (or null, if it doesn't exist and the
"createIfNotExists" parameter is false).

@param createIfNotExists
create metadata node, if it doesn't exist

@return metadata node
422464
public Tree getMeta(boolean createIfNotExists) {
		Tree root = getRoot();
		if (root.meta == null) {
			if (createIfNotExists) {
				root.meta = new LinkedHashMap<String, Object>();
			} else {
				return null;
			}
		}
		return new Tree(root, Config.META, root.meta);
	}
709226
public ManagedEntity[] getChildEntity() throws InvalidProperty, RuntimeFault, RemoteException {
        ManagedObjectReference[] mors = (ManagedObjectReference[]) getCurrentProperty("childEntity");
        ;

        if (mors == null) {
            return new ManagedEntity[]{};
        }

        ManagedEntity[] mes = new ManagedEntity[mors.length];
        for (int i = 0; i < mors.length; i++) {
            mes[i] = MorUtil.createExactManagedEntity(getServerConnection(), mors[i]);
        }
        return mes;
    }
1148694
public <T> T getNodeMetaData(Object key) {
        if (metaDataMap == null) {
            return (T) null;
        }
        return (T) metaDataMap.get(key);
    }
629092
@Nonnull
  public static IMicroContainer createWithClones (@Nullable final IMicroNode... aChildNodes)
  {
    final IMicroContainer ret = new MicroContainer ();
    if (aChildNodes != null)
      for (final IMicroNode aChildNode : aChildNodes)
        ret.appendChild (aChildNode == null ? null : aChildNode.getClone ());
    return ret;
  }
119224
private Node createNode(String nodeName, JsonObject jsonNode, String urlPropName) throws NetworkConfigurationException {

//        jsonNode.
//        if (jsonNode.isNull(urlPropName)) {
//            return  null;
//        }

        String url = jsonNode.getString(urlPropName, null);
        if (url == null) {
            return null;
        }

        Properties props = extractProperties(jsonNode, "grpcOptions");

        if (null != props) {
            String value = props.getProperty("grpc.keepalive_time_ms");
            if (null != value) {
                props.remove("grpc.keepalive_time_ms");
                props.put("grpc.NettyChannelBuilderOption.keepAliveTime", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
            }

            value = props.getProperty("grpc.keepalive_timeout_ms");
            if (null != value) {
                props.remove("grpc.keepalive_timeout_ms");
                props.put("grpc.NettyChannelBuilderOption.keepAliveTimeout", new Object[] {new Long(value), TimeUnit.MILLISECONDS});
            }
        }

        // Extract the pem details
        getTLSCerts(nodeName, jsonNode, props);

        return new Node(nodeName, url, props, jsonNode);
    }
1328407
public static Node getContentNode(final Node subject) {
        return subject == null ? null : NodeFactory.createURI(subject.getURI().replace("/" + FCR_METADATA, ""));
    }
222925
@Override
	public Contents createIfNotExists(Contents contents) throws SQLException {
		verifyCreate(contents);
		return super.createIfNotExists(contents);
	}
636960
public static MetamodelImpl getMetamodel(final KunderaMetadata kunderaMetadata, String... persistenceUnits)
    {
        MetamodelImpl metamodel = null;
        for (String pu : persistenceUnits)
        {
            metamodel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(pu);

            if (metamodel != null)
            {
                return metamodel;
            }
        }

        // FIXME: I need to verify this why we need common entity metadata now!
        // if (metamodel == null)
        // {
        // metamodel = (MetamodelImpl)
        // kunderaMetadata.getApplicationMetadata().getMetamodel(
        // Constants.COMMON_ENTITY_METADATAS);
        // }
        return metamodel;
    }
334065
private ResourceXMLParser.Entity createEntity(final INodeEntry node) {
        final ResourceXMLParser.Entity ent = new ResourceXMLParser.Entity();
        ent.setName(node.getNodename());
        ent.setResourceType(NODE_ENTITY_TAG);
        

        if(null!=node.getAttributes()){
            for (final String setName : node.getAttributes().keySet()) {
                String value = node.getAttributes().get(setName);
                ent.setProperty(setName, value);
            }
        }
        if(null!=node.getTags()){
            ent.setProperty("tags", joinStrings(node.getTags(), ", "));
        }



        return ent;
    }
732715
@Override
    protected Node getNativeTree() {
        IIOMetadataNode root = new IIOMetadataNode(NATIVE_METADATA_FORMAT_NAME);

        root.appendChild(createHeaderNode());

        if (header.mode == PSD.COLOR_MODE_INDEXED) {
            root.appendChild(createPaletteNode());
        }

        if (imageResources != null && !imageResources.isEmpty()) {
            root.appendChild(createImageResourcesNode());
        }

        if (layerInfo != null && !layerInfo.isEmpty()) {
            root.appendChild(createLayerInfoNode());
        }

        if (globalLayerMask != null && globalLayerMask != PSDGlobalLayerMask.NULL_MASK) {
            root.appendChild(createGlobalLayerMaskNode());
        }

        return root;
    }
1187424
@SuppressWarnings("unused") // called through reflection by RequestServer
  public MetadataV3 fetchSchemaMetadata(int version, MetadataV3 docs) {
    if ("void".equals(docs.schemaname)) {
      docs.schemas = new SchemaMetadataV3[0];
      return docs;
    }

    docs.schemas = new SchemaMetadataV3[1];
    // NOTE: this will throw an exception if the classname isn't found:
    Schema schema = Schema.newInstance(docs.schemaname);
    // get defaults
    try {
      Iced impl = (Iced) schema.getImplClass().newInstance();
      schema.fillFromImpl(impl);
    }
    catch (Exception e) {
      // ignore if create fails; this can happen for abstract classes
    }
    SchemaMetadataV3 meta = new SchemaMetadataV3(new SchemaMetadata(schema));
    docs.schemas[0] = meta;
    return docs;
  }
31005
protected function createMissingSitesNode()
    {
        $this->dispatch(self::EVENT_NOTICE, sprintf('Checking for "%s" node ...', SiteService::SITES_ROOT_PATH));
        $rootNode = $this->contextFactory->create()->getRootNode();
        // We fetch the workspace to be sure it's known to the persistence manager and persist all
        // so the workspace and site node are persisted before we import any nodes to it.
        $rootNode->getContext()->getWorkspace();
        $this->persistenceManager->persistAll();
        $sitesNode = $rootNode->getNode(SiteService::SITES_ROOT_PATH);
        if ($sitesNode === null) {
            $taskDescription = sprintf('Create missing site node "<i>%s</i>"', SiteService::SITES_ROOT_PATH);
            $taskClosure = function () use ($rootNode) {
                $rootNode->createNode(NodePaths::getNodeNameFromPath(SiteService::SITES_ROOT_PATH));
                $this->persistenceManager->persistAll();
            };
            $this->dispatch(self::EVENT_TASK, $taskDescription, $taskClosure);
        }
    }
359247
public static Document createDOMDocument()
    {
        try {
            return DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        } catch (ParserConfigurationException ex) {
            LOGGER.error("Cannot create DOM Documents", ex);
            return null;
        }
    }
1090493
private static String initCreateEmbeddedNodeQuery(EntityKeyMetadata entityKeyMetadata) {
		StringBuilder queryBuilder = new StringBuilder( "CREATE " );
		queryBuilder.append( "(n:" );
		queryBuilder.append( EMBEDDED );
		queryBuilder.append( ":" );
		appendLabel( entityKeyMetadata, queryBuilder );
		appendProperties( entityKeyMetadata, queryBuilder );
		queryBuilder.append( ") RETURN n" );
		return queryBuilder.toString();
	}
1239259
@GetMapping("/sp/metadata")
    public ResponseEntity<String> getFirstServiceProviderMetadata() {
        val saml2Client = builtClients.findClient(SAML2Client.class);
        if (saml2Client != null) {
            return getSaml2ClientServiceProviderMetadataResponseEntity(saml2Client);
        }
        return getNotAcceptableResponseEntity();
    }
1188056
private NodeInterface getRelatedNode(boolean add) {

		T relatedNode = null;

		if ((currentObject != null) && (currentObject instanceof NodeInterface)) {

			NodeInterface localNode = (NodeInterface) currentObject;
			relatedNode = localNode.getProperty(sourceKey);
			
			if (relatedNode == null && add && sourceKey instanceof RelationProperty) {

				final RelationProperty relationProperty = (RelationProperty)sourceKey;
				final App app                           = StructrApp.getInstance();
				final Class<T> relatedType              = relationProperty.getTargetType();

				if (relatedType != null) {
					
					try {
						relatedNode = app.create(relatedType);
						relationProperty.addSingleElement(securityContext, localNode, relatedNode);

					} catch (FrameworkException fex) {

						logger.warn("", fex);
					}
					
				} else {
					
					logger.error("Related type was null for {}", currentObject);
				}
			}
		}

		return relatedNode;
	}
391319
private Node getNode(boolean bDataRoot)
    {
        if (m_data == null)
        {
            DocumentBuilder db = Util.getDocumentBuilder();
            synchronized (db)
            {
                m_data = (Node)db.newDocument();
                String rootTag = ROOT_TAG;
                if (this.getMessageDataDesc(null) != null)
                	if (this.getMessageDataDesc(null).getKey() != null)
                		rootTag = this.getMessageDataDesc(null).getKey();
                ((Document)m_data).appendChild(((Document)m_data).createElement(rootTag));
            }
        }
        if (bDataRoot)
        	if (m_data instanceof Document)
        		return ((Document)m_data).getDocumentElement();
        return (Node)m_data;
    }